11.3.2.3 Programming
For page programming, filling the page buffer and writing the page buffer into Flash, User Row, and EEPROM are two separate operations.
Before programming a Flash page with the data in the page buffer, the content of the Flash
page must be erased (read back 0xFF
). Programming a Flash page that has
not been erased will corrupt its content.
Two options are available to make sure that the Flash page content is programmed correctly:
- Make sure the Flash is ready by reading the Flash Busy (FLBUSY) flag in the NVMCTRL.STATUS register.
- Fill the page buffer.
- Write the page buffer to Flash with the Flash Page Erase and Page Write (FLPERW) command.
- Make sure the Flash is ready by reading the Flash Busy (FLBUSY) flag in the NVMCTRL.STATUS register.
- Write to a location on the page to set up the address.
- Perform a Flash Page Erase (FLPER) command.
- Fill the page buffer.
- Perform a Flash Page Write (FLPW) command.
The NVM command set supports both single Page Erase and Write (FLPERW/EEPERW) operations and split Page Erase (FLPER/EEPER) and Page Write (FLPW/EEPW) commands for both Flash and EEPROM. These split commands enable a shorter programming time for each command, and the erase operations can be done during non-time-critical programming execution.
The EEPROM programming is similar to Flash programming, but only the bytes updated in the page buffer will be written or erased in the EEPROM.
Memory Section | Erase Granularity | Write Granularity |
---|---|---|
Flash array | Page | Page |
EEPROM array | Byte | Byte |
User Row | Page(1) | Page(1) |
- User Row page is 64 bytes.