31.5.9 Feature Unlock Key REGISTER

Note:
  1. KEY can only be written when STATUS.BUSY=0.
  2. KEY resets to 0 (a valid lock code) on a successful write to CTRLA, SWAP or an unsuccessful write to any register (any write that sets KEYERR).
  3. KEY allows for multiple writes to configuration registers when using CFGKEY. To lock, write a Valid Lock Code to KEY.
  4. Byte and Half-Word writes are ignored but result in a bus error.
Table 31-20. Register Bit Attribute Legend
SymbolDescriptionSymbolDescriptionSymbolDescription
RReadable bitHCCleared by Hardware(Grey cell)Unimplemented
WWritable bitHSSet by HardwareXBit is unknown at Reset
KWrite to clearSSoftware settable bit
Name: KEY
Offset: 0x20
Reset: 0x00000000
Property: R/W

Bit 3130292827262524 
 CODE[23:16] 
Access WWWWWWWW 
Reset 00000000 
Bit 2322212019181716 
 CODE[15:8] 
Access WWWWWWWW 
Reset 00000000 
Bit 15141312111098 
 CODE[7:0] 
Access WWWWWWWW 
Reset 00000000 
Bit 76543210 
 FEATURE[7:0] 
Access R/W/HCR/W/HCR/W/HCR/W/HCR/W/HCR/W/HCR/W/HCR/W/HC 
Reset 00000000 

Bits 31:8 – CODE[23:0] This register is used to lock and unlock write access to other Flash Contoller SFR bits. The KEY state remains active until it is written to a Valid Lock Code or an CTRLOP is written. 0x91C32C = Valid Unlock code - Unlocks selected SFR(s) Others = Valid Lock Code - Locks all SFR protected by KEY register Note: KEY can only be written when BUSY=0. Note: KEY resets to 0 (a valid lock code) on a successful write to CTRLOP, SWAP or an unsuccessful write to any register (any write that sets KEYERR).

This register is used to lock and unlock write access to other FCW SFR bits.

The KEY state remains active until it is written to a Valid Lock Code or CTRLOP is written.

0x91C32C= Valid Unlock code - Unlocks selected SFR(s)

All Others = Valid Lock Code - Locks all SFR protected by KEY register

Bits 7:0 – FEATURE[7:0] This register is used to lock and unlock write access to other Flash Contoller SFR bits. Others = Invalid selection - Key Value set to 00 - Locks all SFR protected by KEY register Note: KEY can only be written when BUSY=0. Note: KEY reset to 0 (a valid lock code) on a successful write to CTRLOP, SWAP or an unsuccessful write to any register (any write that sets KEYERR).

This register is used to lock and unlock write access to other FCW SFR bits.

0x00= no selection, invalid selection, or invalid Key - Locks all SFR protected by KEY register

0x01= WRKEY Value: Unlock SFR bits associated with Write/Erase

0x02= SWAPKEY Value: Unlock SFR bits associated with Panel Swapping

0x04= CFGKEY Value: Unlock SFR bits associated with general Flash configuration

all other values: Invalid selection - Key Value set to 00 - Locks all SFR protected by KEY register

ValueNameDescription
0LOCKALLNo selection, invalid selection, or invalid Key - Locks all SFR protected by KEY register
1WRKEYWRKEY Value: Unlock SFR bits associated with Write/Erase
2SWAPKEYSWAPKEY Value: Unlock SFR bits associated with Panel Swapping
4CFGKEYCFGKEY Value: Unlock SFR bits associated with general Flash configuration