AN-0973: Erasing and Programming the Super Sequencer EEPROM
This application note describes how to erase the Super Sequencer EEPROM space and how to write to the space, byte by byte.
Block Erasing The EEPROM
Follow these steps to block erase the EEPROM space:
- Write 0x01 to the UPDCFG register at 0x90. This register is the memory update control register. Writing 0x01 to Register 0x90 enables the configuration register to update continuously. It is recommended that this bit be set during the entire read/write in-circuit testing (ICT) process.
- When erasing or accessing the EEPROM in the 0xFA00 to 0xFBFF address range, the sequence engine must be first be halted. Write 0x01 to the SECTRL register at 0x93, to halt the sequencing engine. The sequence engine must be halted every time there is a read or write transaction to the sequencing engine EEPROM space.
- When erasing or accessing the EEPROM in the 0xF800 to 0xF89F or the 0xF900 to 0xF9FF address range on the ADM1166/ADM1168/ADM1169, write 0x01 to the BBCTRL register at 0x9C. This write halts black box operation and enables access to the 0xF800 to 0xF89F and the 0xF900 to 0xF9FF address ranges of the EEPROM.
- Write 0x05 to the UPDCFG register at 0x90. This write enables the EEPROM block erase functions.
- Use the routine outlined in the following bullet points to
erase pages in any EEPROM space. This routine breaks
down the system management bus (SMBus) transactions
for single page erase functions.
- Send slave address.
- Receive acknowledge.
- Send EEPROM upper address (for example, 0xFA).
- Receive acknowledge.
- Send EEPROM lower address (for example, 0x00).
- Receive acknowledge.
- Send stop.
- Send slave address.
- Receive acknowledge.
- Send command code for a page erase (0xFE).
- Receive acknowledge.
- Send stop.
- For each page to be erased, repeat the routine outlined in Step 4, incrementing the lower address by 32 bytes, that is, 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0, and 0xE0.
- When all the pages are erased, repeat the routine outlined in Step 4, changing the upper address to 0xF9, 0xFA, or 0xFB, as required, and setting the lower page address as outlined in Step 6.
- Write 0x01 to Register 0x90. This write disables the EEPROM block erase function.
Note: The EEPROM 0xF8 address range (0xF8A0 to 0xF8FF) is reserved; any attempt to access this range results in a no acknowledge (NACK).
Writing To The EEPROM Space One Byte At A Time
Byte Write
- To write to the EEPROM space one byte at a time, follow
these steps:
- Send slave address.
- Receive acknowledge.
- Send EEPROM upper address (for example, 0xF8).
- Receive acknowledge.
- Send EEPROM lower address (for example, 0x00).
- Receive acknowledge.
- Send data.
- Slave acknowledge.
- Send stop.
- Repeat the routine outlined in Step 1 for all the 0xF8 EEPROM space. However, increment the lower address for each byte of data written.
- When all the EEPROM in the 0xF8 address range (0xFA00 to 0xFBFF) is written to, change the upper address to 0xF9, 0xFA, or 0xFB and repeat Step 1 and Step 2.
- When programming in the 0xFA00 to 0xFBFF range, write 0x00 to the SECTRL register at 0x93, to activate the sequencing engine for normal operation.
- When programing the EEPROM in the 0xF800 to 0xF89F or the 0xF900 to 0xF9FF address range on the ADM1166/ADM1168/ADM1169, write 0x00 to the BBCTRL register at 0x9C, to enable the black box.
ADM1166/ADM1168/ADM1169 Considerations
The black box uses the 0xF980 to 0xF9FF address range to store black box fault records. When one or more black box triggers are enabled to write into the EEPROM, an access lock is activated on the EEPROM, in the 0xF800 to 0xF9FF address range.
Therefore, before reading from, writing to, or attempting to erase any EEPROM address in the 0xF800 to 0xF89F or the 0xF900 to 0xF9FF address ranges, the black box function must be disabled to ensure that access is allowed. To disable the black box function, write 0x01 to the BBCTRL register at 0x9C. When access to the EEPROM is no longer required, write 0x00 to the BBCTRL register at 0x9C to reenable the black box function.
If the memory region 0xF980 to 0xF9FF is erased to clear any existing black box fault records, the next free location that the black box writes to also needs to be reset, by writing 0x01 to the BBSEARCH register at 0xD9.