本帖最后由 renyaq 于 2020-3-21 11:50 编辑
PIC单片机头文件中,关于芯片配置字有如下内容:
#define CONFIG_ADDR 0x2007
/*osc configurations*/
#define RC 0x3FFF // resistor/capacitor
#define HS 0x3FFE // high speed crystal/resonator
#define XT 0x3FFD // crystal/resonator
#define LP 0x3FFC // low power crystal/resonator
/*watchdog*/
#define WDTEN 0x3FFF // enable watchdog timer
#define WDTDIS 0x3FFB // disable watchdog timer
/*power up timer*/
#define PWRTEN 0x3FF7 // enable power up timer
#define PWRTDIS 0x3FFF // disable power up timer
/*brown out reset*/
#define BOREN 0x3FFF // enable brown out reset
#define BORDIS 0x3FBF // disable brown out reset
/*Low Voltage Programmable*/
#define LVPEN 0x3FFF // low voltage programming enabled
#define LVPDIS 0x3F7F // low voltage programming disabled
/*data code protected*/
#define DP 0x3EFF // protect data code
// alternately
#define DPROT 0x3EFF // use DP
#define DUNPROT 0x3FFF // use UNPROTECT
/* Flash memory write enable/protect */
#define WRTEN 0x3FFF /* flash memory write enabled */
#define WP1 0x3DFF /* protect 0000 - 00FF */
#define WP2 0x3BFF /* protect 0000 - 07FF(76A/77A) / 03FF(73A/74A) */
#define WP3 0x39FF /* protect 0000 - 1FFF(76A/77A) / 0FFF(73A/74A) */
/*debug option*/
#define DEBUGEN 0x37FF // debugger enabled
#define DEBUGDIS 0x3FFF // debugger disabled
/*code protection*/
#define PROTECT 0x1FFF /* protect program code */
#define UNPROTECT 0x3FFF /* do not protect the code */
问题:
为什么PIC单片机的配置字中,几个不同的功能,但头文件中,地址却是相同的呢?
|