晶振选择位
// RC oscillator
#define FOSC_EXTRC 0xFFFF // 直接用内部的RC时钟电路
// HS oscillator
#define FOSC_HS 0xFFFE // 使用超过4M的石英晶体振荡器
// XT oscillator
#define FOSC_XT 0xFFFD // 使用1M到4M的石英晶体振荡器
// LP oscillator
#define FOSC_LP 0xFFFC // 使用低于1M的陶瓷振荡器,不是什么感抗震荡
看门狗控制位
/* 看门狗控制位 */
// Watchdog Timer Enable bit
// WDT enabled
#define WDTE_ON 0xFFFF
// WDT disabled
#define WDTE_OFF 0xFFFB
代码保护位
/* 代码保护位 */
// Flash Program Memory Code Protection bit
// Code protection off
#define CP_OFF 0xFFFF
// All program memory code-protected
#define CP_ON 0xDFFF
EEPROM代码保护位
/* EEPROM代码保护位 */
// Data EEPROM Memory Code Protection bit
// Data EEPROM code protection off
#define CPD_OFF 0xFFFF
// Data EEPROM code-protected
#define CPD_ON 0xFEFF
电源启动分时器启用位
/* 电源启动分时器启用位 */
// Power-up Timer Enable bit
// PWRT disabled
#define PWRTE_OFF 0xFFFF
// PWRT enabled
#define PWRTE_ON 0xFFF7
在线串行编程启动位
/* 低电压(单电源)在线串行编程启用位 */
// Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit
// RB3/PGM pin has PGM function; low-voltage programming enabled
#define LVP_ON 0xFFFF
// RB3 is digital I/O, HV on MCLR must be used for programming
#define LVP_OFF 0xFF7F
在线调试模式位
/* 在线调试模式位 */
// In-Circuit Debugger Mode bit
// In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
#define DEBUG_OFF 0xFFFF
// In-Circuit Debugger enabled, RB6 and RB7 are dedicated to the debugger
#define DEBUG_ON 0xF7FF
关于FLASH
// Flash Program Memory Write Enable bits
// Write protection off; all program memory may be written to by EECON control
#define WRT_OFF 0xFFFF
// 0000h to 00FFh write-protected; 0100h to 1FFFh may be written to by EECON control
#define WRT_256 0xFDFF
// 0000h to 07FFh write-protected; 0800h to 1FFFh may be written to by EECON control
#define WRT_1FOURTH 0xFBFF
// 0000h to 0FFFh write-protected; 1000h to 1FFFh may be written to by EECON control
#define WRT_HALF 0xF9FF