DEFINE OSC 8
in picbasic doesnt seem to work, and leaving the oscillator speed undefined causes the chip to run at 1/4 speed.
Is there some other configuration option I should be changing? Do I have to change the config bits?
sur eit have something to do with the config fuses... open then 18F2455.inc file in the PBP folder... you'll find those
Code:
__CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
__CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H
__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
change them to
[code]
try to change with
Code:
__CONFIG _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
and at the top of your code add
Code:
DEFINE OSC 8
OSCCON=%01110000
it should work... i should. Refer to the datasheet section 2.0
Bookmarks