I count 76, are you sure that's the error?
I count 76, are you sure that's the error?
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
You can use something like that
Code:#CONFIG CFG1 = _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF CFG11 = _LVP_OFF & _CP_ON __config _CONFIG1, CFG1 & CFG11 __config _CONFIG2, _BOR21V #ENDCONFIG
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
cnc, it's not an error, it's just over the IDE gutter (which you can still move to whatever else but 80).
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I would like to know the same thing... That is, how can one break long "__CONFIG" lines into shorter lines?
Below is an example of how to compile your program for two different PIC's, 16F1828 and 16F690. It works NOW... but getting the config statements right cost me a lot of time.
Specifically the fact that "__CONFIG _CONFIG1," works for 16F1828 and "__CONFIG" (no comma) had to be used for the 16F690.
Is the fact that some PIC's require a comma in the config line and some do not determined by MPLAB??
Code:#IF __PROCESSOR__ = "16F1828" #CONFIG __CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_ON & _PWRTE_OFF & _MCLRE_OFF & _CP_ON & _CPD_OFF & _BOREN_OFF & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF __CONFIG _CONFIG2, _WRT_OFF & _PLLEN_OFF & _STVREN_OFF & _BORV_25 & _LVP_OFF #endconfig #else #IF __PROCESSOR__ = "16F690" #CONFIG __CONFIG _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_OFF & _MCLRE_OFF & _CP_ON & _CPD_OFF & _BOD_OFF & _IESO_OFF & _FCMEN_OFF #endconfig #ELSE #ERROR "Program does not support " + __PROCESSOR__ #ENDIF #endif #msg "compiling for target " + __PROCESSOR__
Dwight
These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.
If the chip only has one config word, you don't specify the word's name because it doesn't have one.
For chips with more than one config word, you must specify the word with _CONFIG1 or _CONFIG2 etc.
If you like commenting everthing really well, you can do the configs like this ...
Code:#if __PROCESSOR__ = "16F1828" #config CFG = _FOSC_INTOSC ; Oscillator CFG=CFG& _WDTE_ON ; Watch Dog Timer CFG=CFG& _PWRTE_OFF ; Power-on Timer CFG=CFG& _MCLRE_OFF ; Master Clear Reset CFG=CFG& _CP_ON ; Code Protect CFG=CFG& _CPD_OFF ; EEPROM Data Protect CFG=CFG& _BOREN_OFF ; Brown-out Detect CFG=CFG& _CLKOUTEN_OFF ; FOSC/4 Output CFG=CFG& _IESO_OFF ; Internal External Switchover CFG=CFG& _FCMEN_OFF ; Fail-Safe Clock Monitor __CONFIG _CONFIG1, CFG CFG = _WRT_OFF ; Flash table writes CFG=CFG& _PLLEN_OFF ; 4xPLL OSC multiplier CFG=CFG& _STVREN_OFF ; Stack Over/Underflow CFG=CFG& _BORV_25 ; Brown-out voltage CFG=CFG& _LVP_OFF ; Low Voltage Programming __CONFIG _CONFIG2, CFG #endconfig #else #IF __PROCESSOR__ = "16F690" #config CFG = _INTRC_OSC_NOCLKOUT ; Oscillator CFG=CFG& _WDT_ON ; Watch Dog Timer CFG=CFG& _PWRTE_OFF ; Power-on Timer CFG=CFG& _MCLRE_OFF ; Master Clear Reset CFG=CFG& _CP_ON ; Code Protect CFG=CFG& _CPD_OFF ; EEPROM Data Protect CFG=CFG& _BOD_OFF ; Brown-out Detect CFG=CFG& _IESO_OFF ; Internal External Switchover CFG=CFG& _FCMEN_OFF ; Fail-Safe Clock Monitor __CONFIG CFG #endconfig #else #error "Program does not support " + __PROCESSOR__ #endif #endif #msg "compiling for target " + __PROCESSOR__
DT
Hi:
Thanks Steve, it works now !.
Greetings...
Ruben de la Pena Valdes.
Still doable the long way, still easy though
Not too hot with that method, but neatCode:ASM __CONFIG _CONFIG1, B'11111101010100' ; 1------------- CP: Code Protection off ; -1------------ CPMX: CCP1 on RB0 ; --1----------- DEBUG: Disabled. RB<7:6> are general purpose i/o ; ---11--------- WRT: Write Protection off ; -----1-------- CPD: Code Protection off ; ------0------- LVP: Disabled. RB3 Is General I/O ; -------1------ BOREN: Enable Brown Out Reset ; --------0----- MCLRE: Disable MCLR, RA5 Is digital I/O ; ----------0--- PWRTE: Enable Power-Up Timer ; -----------1-- WDTEN: Enable Watch Dog Timer ; ---------1--00 FOSC: INTRC, NOCLKOUT __CONFIG _CONFIG2, b'11111111111100' ; xxxxxxxxxxxx-- unimplemented ; ------------0- IESO: Disable Internal/External Swichover ; -------------0 FCMEN: Disable Fail-Safe Clock Monitor ENDASM
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks