16f688 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 H ) has the possible values

one and only one of these values must be specified when configuring the CPU

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

e.g.
	include "hwreg-p16f688.h"

	pragma cpu_config CFG_FCMEN_ON
	pragma cpu_config CFG_IESO_ON
	pragma cpu_config CFG_BOD_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_EXTRC_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
  CFG_FCMEN_ON Fail-Safe Clock Monitor is enabled
CFG_FCMEN_OFF Fail-Safe Clock Monitor is disabled
B
  CFG_IESO_ON Internal External Switchover mode is enabled
CFG_IESO_OFF Internal External Switchover mode is disabled
C
  CFG_BOD_ON BOD enabled
CFG_BOD_NSLEEP BOD enabled during operation and disabled in Sleep
CFG_BOD_SBODEN BOD controlled by SBODEN bit (PCON bit 4)
CFG_BOD_OFF BOD disabled
D
Data EEPROM code protect CFG_CPD_ON Data EEPROM is code protected
CFG_CPD_OFF Data EEPROM is not protected
E
Program Memory Code Protect CFG_CP_ON code protect all program memory
CFG_CP_OFF do not code protect any program memory
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_EXTRC_OSC_CLKOUT RC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN
CFG_EXTRC_OSC_NOCLKOUT RCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, RC on RA5/OSC1/CLKIN
CFG_INTRC_OSC_CLKOUT INTOSC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN
CFG_INTRC_OSC_NOCLKOUT INTOSCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN
CFG_EC_OSC external clock on RA5/OSC1/CLKIN and I/O function on RA4/OSC2/CLKOUT pin
CFG_HS_OSC High Speed Crystal / Resonator (HS) 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_LP_OSC Low Power Crystal (LP) oscillator on RA4/OSC2/CLKOUT and RA5/OSC1/CLKIN