16f627a CPU configuration

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

The 16f627a CPU has 8 configuration attributes (labelled field A to H in the table below). The attributes specific to the 16f627a CPU are defined in the file hwreg-p16f627a.h To correctly configure the 16f627a 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 16f627a would look like:

e.g.
	include "hwreg-p16f627a.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_CLKOUT

NOTE: 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_ON
CFG_BODEN_OFF attribute name retained for backwards compatability with 16F62X
this attribute is equivalent to CFG_BOREN_OFF
D
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 function
CFG_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/CLKIN
CFG_RC_OSC_NOCLKOUT Resistor Capacitor (RC) oscillator
without CLKOUT
RA6/OSC2/CLKOUT pin is I/O function
Resistor and Capacitor on RA7/OSC1/CLKIN
CFG_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 function
CFG_INTOSC_OSC_NOCLKOUT Internal (INTOSC) oscillator
without clock output
RA6/OSC2/CLKOUT pin is I/O function
RA7/OSC1/CLKIN pin is I/O function
CFG_INTRC_OSC_CLKOUT attribute name retined for backwards compatability with 16F62X
this attribute is equivalent to CFG_INTOSC_OSC_CLKOUT
CFG_INTRC_OSC_NOCLKOUT attribute name retined for backwards compatability with 16F62X
this attribute is equivalent to CFG_INTOSC_OSC_NOCLKOUT
CFG_EXTCLK_OSC External Clock (EC)
RA6/OSC2/CLKOUT pin is I/O function
RA7/OSC1/CLKIN pin is CLKIN function
CFG_HS_OSC High Speed Crystal / Resonator (HS) oscillator
CFG_XT_OSC Crystal / Resonator (XT) oscillator
CFG_LP_OSC Low Power Crystal (LP) oscillator