Re: #config length ?
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.
Bookmarks