I'm working my way around a new PIC, the 18F13K22 at a smokin' 64 MHz using the internal osc and PLL. Finally got that working but for the life of me, I can't get pin 7 (RC3) to toggle. The following code toggles pin 8 (RC4) but not pin 7:
Am I missing something silly and obvious?Code:#config CONFIG FOSC = IRC ;Internal RC oscillator CONFIG PLLEN = ON ;Oscillator multiplied by 4 CONFIG IESO = OFF ;Oscillator Switchover mode disabled CONFIG BOREN = OFF ;Brown-out Reset disabled in hardware and software CONFIG WDTEN = OFF ;WDT is controlled by SWDTEN bit of the WDTCON register CONFIG WDTPS = 32768 ;1:32768 CONFIG MCLRE = ON ;MCLR pin enabled, RA3 input pin disabled CONFIG XINST = ON ;Instruction set extension and Indexed Addressing mode enabled #ENDCONFIG DEFINE OSC 64 ANSEL = 0 ANSELH = 0 LATC = %11000100 TRISC = %00000000 LATB = %01000000 TRISB = %00110000 LATA = %00000000 TRISA = %00000111 'Set internal osc to 16 MHz, PLL enabled OSCCON.6 = 1 OSCCON.5 = 1 OSCCON.4 = 1 OSCTUNE.6 = %1 pause 500 Main: LATC.4 = 1 LATC.3 = 1 pause 500 LATC.4 = 0 LATC.3 = 0 pause 500 goto Main
Best Regards,
Paul




Bookmarks