PEmicro Blog

How to Configure and Write Microchip/Atmel Emulated EEPROM

by Mika Ichiki-Welches on May 24, 2019

Some Microchip/Atmel's SAM-Series devices allow rows of non-volatile flash memory (NVM) to be configured as EEPROM, so that users can treat NVM pages as EEPROM with Atmel's software, and let Atmel's back-end take care of keeping peripheral data safe.

PEmicro's Cyclone in-system programmers and PROGACMP flash programming software each allow users to set up NVM main flash space as emulated EEPROM by programming the EEPROM FUSE bits in the device's User Row. Our latest Microchip/Atmel algorithms support single-byte writes to the User Row, to preserve adjacent User Row settings.

What is Microchip/Atmel Emulated EEPROM?

On some of Microchip's SAM-Series devices, the upper rows of the NVM main address space can be reconfigured to emulate EEPROM memory.

Figure 1: NVM memory allocation. Reference: Atmel SAMD09 Datasheet

A user can set the number of rows, from 0 to 64, to be used as emulated EEPROM by writing the three EEPROM FUSE bits in the device's User Row. By default, none of flash is allocated as emulated EEPROM (EEPROM FUSE bits = 7).

Figure 2: Guide for allocating NVM flash rows to EEPROM with User Row FUSE bits. Reference: Atmel SAMD09 Datasheet

Configuring and Programming Emulated EEPROM with PEmicro's PROG software:

PEmicro's Cyclone in-system programmers and PROGACMP flash programming software allow desired User Row settings to be included in an object file, and the Program Module (PM) command to be used to program them into the device. With the latest algorithms, Program Module will detect whether the specified addresses are in the User Row address range. If they are, it will perform a read-erase-modify-write to program the new settings, so that all unspecified User Row settings are preserved.

Microchip/Atmel's User Row begins at address 0x804000. Each device's User Row configuration, including the bit positions of the EEPROM FUSE bits, is different, so please consult your device's reference guide or datasheet to prevent from mis-programming any of the User Row settings.

After programming, the device must be reset for any User Row changes to take place. The newly configured emulated EEPROM can be erased and programmed as before, using Erase Module (EM) and Program Module (PM). The difference between main flash and emulated EEPROM when using PROG is that emulated EEPROM cannot be region locked.

Our latest algorithms, dated 02/08/2019 and onward, support single-byte writes to the User Row. This support affects the following Microchip/Atmel SAM-Series devices:

  • SAMC20/21
  • SAMD09/10/11
  • SAMD20/21
  • SAMDA1
  • SAMHA1
  • SAML21/22
  • SAMR21

Tags related to this Blog Post

Cyclone     Cyclone FX     Prog ACMP     ARM     Microchip     Production Programming