Each attribute in the configuration table below has two or more possible values associated with it.
e.g. the watchdog attribute (labelled field F ) 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 16f648a CPU has 8 configuration attributes (labelled field A to H in the table below). The attributes specific to the 16f648a CPU are defined in the file hwreg-p16f648a.h To correctly configure the 16f648a 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 16f648a would look like:
e.g. include "hwreg-p16f648a.h" pragma cpu_config CFG_CP_ON pragma cpu_config CFG_DATA_CP_ON pragma cpu_config CFG_BOREN_ON pragma cpu_config CFG_MCLRE_ON pragma cpu_config CFG_PWRTE_ON pragma cpu_config CFG_WDT_ON pragma cpu_config CFG_LVP_ON pragma cpu_config CFG_RC_OSC_CLKOUTNOTE: All attributes for a given processor must be specified, attributes for different processors may not be mixed.
Field Attribute XCSB value Description A Program Memory Code Protect CFG_CP_ON code protect all program memory CFG_CP_OFF do not code protect any program memory B Data Memory Code Protected CFG_DATA_CP_ON data memory is code protected CFG_DATA_CP_OFF data memory is NOT code protected C Brown-Out Reset CFG_BOREN_ON Brown-Out Reset enable CFG_BOREN_OFF Brown-Out Reset disable CFG_BODEN_ON attribute name retained for backwards compatability with 16F62X
this attribute is equivalent to CFG_BOREN_ONCFG_BODEN_OFF attribute name retained for backwards compatability with 16F62X
this attribute is equivalent to CFG_BOREN_OFFD RA5/MCLR pin function select CFG_MCLRE_ON RA5/MCLR pin function is digital I/O, MCLR internally tied to VDD CFG_MCLRE_OFF RA5/MCLR pin function is MCLR E Power-Up Timer CFG_PWRTE_ON power-up timer enable CFG_PWRTE_OFF power-up timer disable F Watchdog timer CFG_WDT_ON watchdog timer enable CFG_WDT_OFF watchdog timer disable G Low Voltage In-Circuit Programming CFG_LVP_ON Low Voltage in-circuit serial Programming enabled
RB3/PGM pin has PGM functionCFG_LVP_OFF Low Voltage in-circuit serial Programming disabled
RB3/PGM pin has digital I/O function
(high voltage must be present on MCLR pin for programming)H Oscillator CFG_RC_OSC_CLKOUT Resistor Capacitor (RC) oscillator
with CLKOUT
RA6/OSC2/CLKOUT pin is CLKOUT function
Resistor and Capacitor on RA7/OSC1/CLKINCFG_RC_OSC_NOCLKOUT Resistor Capacitor (RC) oscillator
without CLKOUT
RA6/OSC2/CLKOUT pin is I/O function
Resistor and Capacitor on RA7/OSC1/CLKINCFG_ER_OSC_CLKOUT Backwards compatability to 16F62X CFG_ER_OSC_NOCLKOUT Backwards compatability to 16F62X CFG_INTOSC_OSC_CLKOUT Internal (INTOSC) oscillator
with clock output
RA6/OSC2/CLKOUT pin is CLKOUT function
RA7/OSC1/CLKIN pin is I/O functionCFG_INTOSC_OSC_NOCLKOUT Internal (INTOSC) oscillator
without clock output
RA6/OSC2/CLKOUT pin is I/O function
RA7/OSC1/CLKIN pin is I/O functionCFG_INTRC_OSC_CLKOUT attribute name retined for backwards compatability with 16F62X
this attribute is equivalent to CFG_INTOSC_OSC_CLKOUTCFG_INTRC_OSC_NOCLKOUT attribute name retined for backwards compatability with 16F62X
this attribute is equivalent to CFG_INTOSC_OSC_NOCLKOUTCFG_EXTCLK_OSC External Clock (EC)
RA6/OSC2/CLKOUT pin is I/O function
RA7/OSC1/CLKIN pin is CLKIN functionCFG_HS_OSC High Speed Crystal / Resonator (HS) oscillator CFG_XT_OSC Crystal / Resonator (XT) oscillator CFG_LP_OSC Low Power Crystal (LP) oscillator