The program is below.
Code: Select all
program P24HJ32GP202_LED_BLINK
main:
TRISA = 0x0000
while TRUE
LATA = 0xFFFF
delay_ms(5)
LATA = 0x0000
delay_ms(5)
wend
end.
#1 Post by Chaz » 29 Jan 2010 08:10
Code: Select all
program P24HJ32GP202_LED_BLINK
main:
TRISA = 0x0000
while TRUE
LATA = 0xFFFF
delay_ms(5)
LATA = 0x0000
delay_ms(5)
wend
end.
#2 Post by javor.pas » 29 Jan 2010 10:32
#3 Post by peterverkaik » 29 Jan 2010 14:16
Code: Select all
'//external resonator 20MHz
'//Fosc = (20MHz/10)*(79)/2 = 79MHz
'// PLLPRE^ ^PLLPOST
'// 2MHz 158MHz
sub procedure PLL_Init
PLLFBD = 77 '// M = 79
CLKDIV = (CLKDIV AND $FFE0) OR 8 'PLLPRE = 8 '// N1 = 10
CLKDIV = (CLKDIV AND $FF3F) OR 0 'PLLPOST = 0 '// N2 = 2
OSCTUN = 0
RCON.SWDTEN = 0
'// Clock switch to incorporate PLL
OSCCONH = 0x01 '// Initiate Clock Switch to FRC with PLL (NOSC=0b001)
OSCCONL = 0x01 '// Start clock switching
while ((OSCCON AND $7000) <> $4000) '// Wait for Clock switch to occur
wend
while (OSCCON.LOCK_ <> 1)
wend
end sub
#4 Post by Chaz » 29 Jan 2010 20:39
#5 Post by extrapilot » 01 Feb 2010 03:17
Return to “mikroBasic PRO for dsPIC30/33 and PIC24 General”