387
XMEGA B [DATASHEET]
8291B–AVR–01/2013
30.11.3.1 Write Lock Bits
The write lock bits command is used to program the boot lock bits to a more secure settings from software.
1.
Load the NVM DATA0 register with the new lock bit value.
2.
Load the NVM CMD register with the write lock bit command.
3.
Set the CMDEX bit in the NVM CTRLA register. This requires the timed CCP sequence during self-programming.
The BUSY flag in the NVM STATUS register will be set until the command is finished. The CPU is halted during the
complete execution of the command.
This command can be executed from both the boot loader section and the application section. The EEPROM and flash
page buffers are automatically erased when the lock bits are written.
30.11.3.2 Read Fuses
The read fuses command is used to read the fuses from software.
1.
Load the NVM ADDR register with the address of the fuse byte to read.
2.
Load the NVM CMD register with the read fuses command.
3.
Set the CMDEX bit in the NVM CTRLA register. This requires the timed CCP sequence during self-programming.
The result will be available in the NVM DATA0 register. The CPU is halted during the complete execution of the
command.
30.11.4 EEPROM Programming
The EEPROM can be read and written from application code in any part of the flash. Its is both byte and page accessible.
This means that either one byte or one page can be written to the EEPROM at once. One byte is read from the EEPROM
during a read.
30.11.4.1 Addressing the EEPROM
The EEPROM can be accessed through the NVM controller (I/O mapped), similar to accessing the flash program
memory, or it can be memory mapped into the data memory space to be accessed similar to SRAM.
When accessing the EEPROM through the NVM controller, the NVM address (ADDR) register is used to address the
EEPROM, while the NVM data (DATA) register is used to store or load EEPROM data.
For EEPROM page programming, the ADDR register can be treated as having two sections. The least-significant bits
address the bytes within a page, while the most-significant bits address the page within the EEPROM. This is shown in
. The byte address in the page (E2BYTE) is held by the bits [BYTEMSB:0] in the ADDR register.
The remaining bits [PAGEMSB:1] in the ADDR register hold the EEPROM page address (E2PAGE).
Together E2BYTE and E2PAGE hold an absolute address to a byte in the EEPROM. The size of E2WORD and E2PAGE
will depend on the page and flash size in the device. Refer to the device datasheet for details on this.
Содержание XMEGA B
Страница 320: ...320 XMEGA B DATASHEET 8291B AVR 01 2013 Table 25 12 7 segments Character Table...
Страница 321: ...321 XMEGA B DATASHEET 8291B AVR 01 2013 Table 25 13 14 segments Character Table...
Страница 322: ...322 XMEGA B DATASHEET 8291B AVR 01 2013 Table 25 14 16 segments Character Table...
Страница 412: ...412 XMEGA B DATASHEET 8291B AVR 01 2013...
Страница 413: ...413 XMEGA B DATASHEET 8291B AVR 01 2013...
Страница 414: ...414 XMEGA B DATASHEET 8291B AVR 01 2013...