18f2550 oscillator problems
Hi all,
I am running an 18f2550 using internal oscillator. I have a timing problem that causes the program to run what I believe is 4 times slower than it should.
I have the following fuses set in 18f255.inc in the PBP directory.
__CONFIG _CONFIG1L, _PLLDIV_1_1L
__CONFIG _CONFIG1H, _FOSC_INTOSCIO_EC_1H
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H
__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
I have the following code running on chip.
OSCCON=%01100000
DEFINE OSC 4
TRISA=%0000000
ADCON1 = 7 ' A/D off, all digital
high PORTA.5
pause 1000
low PORTA.5
pause 1000
high PORTA.5
I am sure the LED on PORTA.5 is staying on for 4 seconds and then goes off for 4 seconds before finally coming back on. What am I doing wrong?