PDA

View Full Version : I don't understand my mistake



kik1kou
- 31st January 2015, 10:46
hello everybody,

before format my PC, my code worked well and the compilator too
after I installed all my programs (same programs) on my fresh windows, I got a error that I don't understand why...

this is my code simplified :

#CONFIG
CONFIG PLLSEL = PLL3X ;3x clock multiplier
CONFIG CFGPLLEN = ON ;PLL Disabled (firmware controlled)
CONFIG CPUDIV = NOCLKDIV ;CPU uses system clock (no divide)
CONFIG LS48MHZ = SYS48X8 ;System clock at 48 MHz, USB clock divider is set to 8
CONFIG FOSC = INTOSCIO ;HS oscillator, high power 16MHz to 25MHz
CONFIG PCLKEN = OFF ;Primary oscillator enabled
CONFIG FCMEN = OFF ;Fail-Safe Clock Monitor disabled
CONFIG IESO = OFF ;Oscillator Switchover mode disabled
CONFIG nPWRTEN = OFF ;Power up timer enabled
CONFIG BOREN = OFF ;BOR controlled by firmware (SBOREN is enabled)
CONFIG BORV = 285 ;BOR set to 1.9V nominal
CONFIG nLPBOR = OFF ;Low-Power Brown-out Reset disabled
CONFIG WDTEN = ON ;WDT enabled in hardware (SWDTEN ignored)
CONFIG WDTPS = 512 ;1:512
CONFIG CCP2MX = RC1 ;CCP2 input/output is multiplexed with RC1
CONFIG PBADEN = OFF ;PORTB<5:0> pins are configured as digital I/O on Reset
CONFIG T3CMX = RC0 ;T3CKI function is on RC0
CONFIG SDOMX = RB3 ;SDO function is on RB3
CONFIG MCLRE = ON ;MCLR pin enabled; RE3 input disabled
CONFIG STVREN = ON ;Stack full/underflow will cause Reset
CONFIG LVP = OFF ;Single-Supply ICSP disabled
CONFIG XINST = OFF ;Instruction set extension and Indexed Addressing mode disabled
#ENDCONFIG

DEFINE OSC 48

OSCCON = %01110000 'OSCint = 16Mhz
OSCCON2 = %00010000
ACTCON = %10010000

ProgramStart:
clearwdt
goto programstart


with this code, I got a config directive error

http://img4.hostingpics.net/pics/346529Sanstitre.jpg


and the error file :

http://img4.hostingpics.net/pics/934184Sanstitre.jpg

someboby can help me to resolve this error?

thanks

HenrikOlsson
- 31st January 2015, 11:01
Hi,
CONFIG nPWRTEN = OFF
CONFIG nLPBOR = OFF

I don't the n's should be there. I don't have the config files on this computer but verify that 285 is indeed a valid setting for the brownout, message says it's not....

Are you compiling for the correct chip?

/Henrik.

kik1kou
- 31st January 2015, 11:35
hi,

this was my first idea, but the n's is correct, it is the same in pic18f45k50.pbpinc file
and the 285 value for BORV is correct too

may be I don't check an option in editor option? I really don't know because this code work well before format and install the computer...

kik1kou
- 31st January 2015, 12:56
hi,

I find my mistake :-)
I uninstall mplab 8.85 for the last mplab version : 8.92...

and now all my code is compiled without error ... really crazy :-)