16.6.2 Control B

Name: CTRLB
Offset: 0x01
Reset: 0x30
Property: Configuration Change Protection

Bit 76543210 
 FLMAPLOCK FLMAP[1:0]EEWPAPPDATAWPBOOTRPAPPCODEWP 
Access R/WR/WR/WR/WR/WR/WR/W 
Reset 0110000 

Bit 7 – FLMAPLOCK Flash Mapping Lock

This bit is cleared by a Reset.

This bit is set by writing a '1' to it.

Writing a ‘0’ to this bit has no effect.

Writing a ‘1’ to this bit prevents further writing of the FLMAP bit field.

Bits 5:4 – FLMAP[1:0] Flash Section Mapped into Data Space

Select what part (in blocks of 32 KB) of the Flash will be mapped as part of the CPU data space and accessible through LD/ST instructions.

This bit field controls what part of the Flash, in blocks of 32 KB, will be mapped to the CPU data space.

This bit field is not under Configuration Change Protection.

ValueNameMapped Flash Section (KB)
8 KB Flash16 KB Flash32 KB Flash64 KB Flash
0SECTION00-80-16 0-32 0-32
1SECTION132-64
2SECTION20-32
3SECTION332-64

Bit 3 – EEWP EEPROM Write Protect

This bit is cleared by a Reset.

This bit is set by writing a '1' to it.

Writing a ‘0’ to this bit has no effect.

Writing a ‘1’ to this bit prevents further updates of the EEPROM.

Bit 2 – APPDATAWP Application Data Write Protection

This bit is cleared by a Reset.

This bit is set by writing a '1' to it.

Writing a ‘0’ to this bit has no effect.

Writing a ‘1’ to this bit prevents further updates to the Application Data section.

Bit 1 – BOOTRP Boot Section Read Protection

This bit is cleared by a Reset.

This bit is set by writing a '1' to it.

Writing a ‘0’ to this bit has no effect.

Writing a ‘1’ to this bit protects the BOOT section from reading and instruction fetching. If a read is issued from the other Flash sections, it will return ‘0’. An instruction fetch from the BOOT section will return an NOP instruction. This bit can only be written from the BOOT section. The read protection will only take effect when leaving the BOOT section after the bit is written.

Bit 0 – APPCODEWP Application Code Write Protection

This bit is cleared by a Reset.

This bit is set by writing a '1' to it.

Writing a ‘0’ to this bit has no effect.

Writing a ‘1’ to this bit prevents further updates to the Application Code section.