Hi,
Here are the CONFIGs I use for my 2431:If you're running on the internal oscillator then you need to change from HSPLL to IRCIO.Code:#CONFIG CONFIG OSC = HSPLL CONFIG FCMEN = ON CONFIG IESO = OFF CONFIG PWRTEN = ON CONFIG BOREN = ON CONFIG BORV = 42 CONFIG WDTEN = OFF CONFIG WDPS = 512 CONFIG WINEN = OFF CONFIG PWMPIN = OFF CONFIG LPOL = HIGH CONFIG HPOL = HIGH CONFIG T1OSCMX = OFF CONFIG MCLRE = ON CONFIG STVREN = ON CONFIG LVP = OFF CONFIG DEBUG = OFF CONFIG CP0 = ON CONFIG CP1 = ON CONFIG CP2 = ON CONFIG CP3 = ON CONFIG CPB = OFF CONFIG CPD = OFF CONFIG WRT0 = OFF CONFIG WRT1 = OFF CONFIG WRT2 = OFF CONFIG WRT3 = OFF CONFIG WRTC = OFF CONFIG WRTB = OFF CONFIG WRTD = OFF CONFIG EBTR0 = OFF CONFIG EBTR1 = OFF CONFIG EBTR2 = OFF CONFIG EBTR3 = OFF CONFIG EBTRB = OFF #ENDCONFIG
The oscillator section of the datasheet indicates that the internal oscillator defaults to 4Mhz but looking at the initialization condition of the OSCCON register it seems like bits 4,5,6 are all zero on power up - which would give you 31kHz. If you then have the clock DEFINED to 8MHz your 500ms PAUSE will actually be 322 seconds....
So, without actually testing this I'd try something like/Henrik.Code:DEFINE OSC 8 OSCCON = %01110010 ' Internal oscillator, 8MHz







Bookmarks