- Attain the SRAM mapping of your desired configuration. The SRAM map is generated in TICS Pro. For the TARGET_ADR_MSB and EEREV mapping, see Five MSBs of the I2C Address and the EEPROM Revision Number.
- Mixed method only: Commit active registers to SRAM by setting REGCOMMIT (R171[6]) to 1.
- Note: REGCOMMIT is auto-cleared to 0 when the transfer is completed.
- Enable EEPROM overlay by setting R20[7] (ROM_PLUS_EE) to 1.
- Configure the SRAM address pointer by setting R173[4:0] (MEMADR_12:8) to the 5 MSBs of the SRAM address.
- Configure the SRAM address pointer by R174 (MEMADR) to the 8 LSBs of the SRAM address.
- Store the desired data at the specified SRAM address by setting R176 (RAMDAT) to the SRAM data from the SRAM map.
- Repeat steps 4-6 for all desired SRAM addresses.
- Unlock EEPROM by setting to R180 (NVMUNLK) to 234.
- In one transaction:
- Erase the contents of the EEPROM by setting NVMERASE (R171[1]) to 1.
- Initiate EEPROM programming to transfer the SRAM contents to EEPROM by setting NVMPROG (R171[0]) to 1.
- Note: Step 5 & 6 must be atomic (back-to-back) writes without any other register transactions in-between. Serial communication interruptions (such as access to other devices on the same bus) is also not allowed for successful EEPROM programming.
- Wait for EEPROM programming to finish by polling R171[2] (NVMBUSY) until cleared or wait about 500ms.
- Note: Do not power down, PD# toggle, or
continue to the next step until NVMBUSY is cleared
to have a successful EEPROM programming.
- Lock the EEPROM by setting NVMUNLK to 0.
- At the next POR, if the EEPROM programming is
successful, the EEPROM program count, R16
(NVMCNT), increments by 1. Also, if the EEPROM
overlay bit is set, the active registers are
loaded from EEPROM.
Hex instruction example for changing the TARGET_ADR_MSB:
R171 0x00AB40 # Set REGCOMMIT (Mixed Method only)
R20 0x001480 # Enable EEPROM OVERLAY
R173 0x00AD00 # Set 5 MSBs of SRAM address
R174 0x00AE0C # Set 8 LSBs of SRAM address
R176 0x00B019 # Set 5 MSBs of desired I2C address
R180 0x00B4EA # UNLOCK EEPROM
R171 0x00AB03 # ERASE and PROGRAM SRAM contents to EEPROM
while(READ_REG(NVMBUSY) != 0) # NVMBUSY is located in 0xAB, bit 2
R180 0x00B400 # Lock EEPROM
Hex instruction example for changing the EEREV: