Each attribute in the configuration table below has two or more possible values associated with it.
e.g. the watchdog attribute (labelled field H ) has the possible values
one and only one of these values must be specified when configuring the CPU
- CFG_WDT_ON
- CFG_WDT_OFF
The 16f690 CPU has 9 configuration attributes (labelled field A to I in the table below). The attributes specific to the 16f690 CPU are defined in the file hwreg-p16f690.h To correctly configure the 16f690 CPU each attribute must be set to a valid value. This is done by using one "pragma cpu_config" statement per attribute. A valid configuration for 16f690 would look like:
e.g. include "hwreg-p16f690.h" pragma cpu_config CFG_FCMEN_ON pragma cpu_config CFG_IESO_ON pragma cpu_config CFG_BOR_ON pragma cpu_config CFG_CPD_ON pragma cpu_config CFG_CP_ON pragma cpu_config CFG_MCLRE_ON pragma cpu_config CFG_PWRTE_ON pragma cpu_config CFG_WDT_ON pragma cpu_config CFG_LP_OSCNOTE: All attributes for a given processor must be specified, attributes for different processors may not be mixed.
Field Attribute XCSB value Description A CFG_FCMEN_ON fail-safe clock monitor enable CFG_FCMEN_OFF fail-safe clock monitor disable B CFG_IESO_ON internal external switchover mode enable CFG_IESO_OFF internal external switchover mode disable C Brown-Out Reset CFG_BOR_ON BOR enabled CFG_BOR_NSLEEP BOR enabled during operation and disabled in Sleep CFG_BOR_SBODEN BOR controlled by SBOREN bit of the PCON register CFG_BOR_OFF BOR disabled D Data EEPROM code protect CFG_CPD_ON data memory code protection enable CFG_CPD_OFF data memory code protection disable E Program Memory Code Protect CFG_CP_ON program memory code protection enable CFG_CP_OFF program memory code protection disable F CFG_MCLRE_ON RA3/MCLR pin function is digital I/O, MCLR internally tied to VDD CFG_MCLRE_OFF RA3/MCLR pin function is MCLR G Power-Up Timer CFG_PWRTE_ON power-up timer enable CFG_PWRTE_OFF power-up timer disable H Watchdog timer CFG_WDT_ON watchdog timer enable CFG_WDT_OFF watchdog timer disable I Oscillator CFG_LP_OSC Low Power Crystal (LP) oscillator on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN CFG_XT_OSC Crystal / Resonator (XT) oscillator on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN CFG_HS_OSC High Speed Crystal / Resonator (HS) oscillator on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN CFG_EC_OSC I/O function on RA4/OSC2/CLKOUT pin, CLKIN on RA5/OSC1/CLKIN CFG_INTRC_OSC_NOCLKOUT I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN CFG_INTRC_OSC_CLKOUT CLKOUT function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN CFG_EXTRC_OSC_NOCLKOUT CLKOUT function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN CFG_EXTRC_OSC_CLKOUT I/O function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN CFG_INTOSCIO same as CFG_INTRC_OSC_NOCLKOUT CFG_INTOSC same as CFG_INTRC_OSC_CLKOUT CFG_EXTRCIO same as CFG_EXTRC_OSC_NOCLKOUT CFG_EXTRC same as CFG_EXTRC_OSC_CLKOUT