I also use PBP 2.60C on a 18F24K22 (same family of PICs). Looks like you're missing one register, try this:
Code:
' PIC 18F24K22 int osc 64MHz
asm
__CONFIG _CONFIG1H, _FOSC_INTIO67_1H & _PLLCFG_ON_1H & _PRICLKEN_ON_1H & _FCMEN_ON_1H & _IESO_OFF_1H
__CONFIG _CONFIG2L, _PWRTEN_ON_2L & _BOREN_SBORDIS_2L & _BORV_285_2L
__CONFIG _CONFIG2H, _WDTEN_OFF_2H
__CONFIG _CONFIG3H, _CCP2MX_PORTC1_3H & _PBADEN_OFF_3H & _HFOFST_OFF_3H & _T3CMX_PORTB5_3H & _P2BMX_PORTC0_3H & _MCLRE_EXTMCLR_3H
__CONFIG _CONFIG4L, _STVREN_OFF_4L & _LVP_OFF_4L & _XINST_OFF_4L & _DEBUG_OFF_4L
endasm
' Define LOADER_USED to allow use of the boot loader.
' This will not affect normal program operation.
' Define LOADER_USED 1
DEFINE OSC 64
;INCLUDE "AllDigital.pbp"
;DEFINE SHOWDIGITAL 1
OSCCON = %01110000 ' I didn't need to set bit 7 of OSCCON for SLEEP
OSCCON2 = %10000100
OSCTUNE = %11000000
ADCON0 = %00000000 ' Disable ADC
ANSELA = 0
ANSELB = 0
ANSELC = 0
' Your code
CM1CON0.7 = 0 'Disable comparator1
CM2CON0.7 = 0 'Disable comparator2
'Port direction
TRISA = 0 'All are Outputs
TRISB = 0 'All are Outputs
TRISC = 0 'All are Outputs
START:
PortC.3 = 1 : pause 500 'Turn the LED on and wait for half a second
PortC.3 = 0 : pause 500 'Turn the LED off and wait for half a second
GOTO START
END
I just noticed I didn't set the MFINTOSC Frequency Stable bit in OSCCON, don't know the impact of that. I'd start by adding OSCCON2 first, I know I put that there for a reason, just can't remember - I got this code running back in January.
Robert
Bookmarks