ATMEGA406 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// Clock Selection : Start-up time: 14 CK + 62.5 ms
// Boot Reset vector Enabled : CLEAR
// Select boot size : Boot Flash size=2048 words Boot address=$4800
// Preserve EEPROM through the Chip Erase cycle : CLEAR
// Watchdog timer always on : CLEAR
#pragma config SUT_CKSEL = SUT_CKSEL_14CK_62MS5, BOOTRST = CLEAR, BOOTSZ = BOOTSZ_2048W_4800, EESAVE = CLEAR, WDTON = CLEAR
#pragma config <setting>=<literal constant>
For example:
// Clock Selection : Start-up time: 14 CK + 62.5 ms
// Boot Reset vector Enabled : CLEAR
// Select boot size : Boot Flash size=2048 words Boot address=$4800
// Preserve EEPROM through the Chip Erase cycle : CLEAR
// Watchdog timer always on : CLEAR
#pragma config SUT_CKSEL = 0x5, BOOTRST = 0x1, BOOTSZ = 0x0, EESAVE = 0x1, WDTON = 0x1

Configuration Registers & Settings

Register: LOW
SUT_CKSEL Clock Selection
SUT_CKSEL_14CK_0MS Start-up time: 14 CK + 0 ms
SUT_CKSEL_14CK_3MS9 Start-up time: 14 CK + 3.9 ms
SUT_CKSEL_14CK_62MS5 Start-up time: 14 CK + 62.5 ms
SUT_CKSEL_14CK_0MS Start-up time: 14 CK + 0 ms
SUT_CKSEL_14CK_3MS9 Start-up time: 14 CK + 3.9 ms
SUT_CKSEL_14CK_62MS5 Start-up time: 14 CK + 62.5 ms
BOOTRST Boot Reset vector Enabled
SET
CLEAR
BOOTSZ Select boot size
BOOTSZ_256W_4F00 Boot Flash size=256 words Boot address=$4F00
BOOTSZ_512W_4E00 Boot Flash size=512 words Boot address=$4E00
BOOTSZ_1024W_4C00 Boot Flash size=1024 words Boot address=$4C00
BOOTSZ_2048W_4800 Boot Flash size=2048 words Boot address=$4800
EESAVE Preserve EEPROM through the Chip Erase cycle
SET
CLEAR
WDTON Watchdog timer always on
SET
CLEAR
Register: HIGH
JTAGEN JTAG Interface Enabled
SET
CLEAR
OCDEN On-Chip Debug Enabled
SET
CLEAR
Register: LOCKBIT
LB Memory Lock
LB_PROG_VER_DISABLED Further programming and verification disabled
LB_PROG_DISABLED Further programming disabled
LB_NO_LOCK No memory lock features enabled
BLB0 Boot Loader Protection Mode
BLB0_LPM_SPM_DISABLE LPM and SPM prohibited in Application Section
BLB0_LPM_DISABLE LPM prohibited in Application Section
BLB0_SPM_DISABLE SPM prohibited in Application Section
BLB0_NO_LOCK No lock on SPM and LPM in Application Section
BLB1 Boot Loader Protection Mode
BLB1_LPM_SPM_DISABLE LPM and SPM prohibited in Boot Section
BLB1_LPM_DISABLE LPM prohibited in Boot Section
BLB1_SPM_DISABLE SPM prohibited in Boot Section
BLB1_NO_LOCK No lock on SPM and LPM in Boot Section