30.2.23.7 Key - SFR Unlock Register

Table 30-10. Register Bit Attribute Legend
Symbol Description Symbol Description Symbol Description
R Readable bit HC Cleared by Hardware (Grey cell) Unimplemented
W Writable bit HS Set by Hardware X Bit is unknown at Reset
K Write to clear S Software settable bit
Name: KEY
Offset: 0x001C
Reset: 0x00000000
Property: PAC Write-Protection

Bit 3130292827262524 
 KEY[31:24] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 
Bit 2322212019181716 
 KEY[23:16] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 
Bit 15141312111098 
 KEY[15:8] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 
Bit 76543210 
 KEY[7:0] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 

Bits 31:0 – KEY[31:0] NVM SFR Key Bits

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 CTRLA is written.

KEY[31:8] - KEY Code

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

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

KEY[7:0] KEY Value.

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

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.