9.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 Flash page must be erased. The page buffer is also erased when the device enters a Sleep mode. Programming an unerased Flash page will corrupt its content.

The Flash can either be written with the erase and write separately, or one command handling both:

Alternative 1:
  1. Fill the page buffer.
  2. Write the page buffer to Flash with the Erase and Write Page (ERWP) command.
Alternative 2:
  1. Write to a location in the page to set up the address.
  2. Perform an Erase Page (ER) command.
  3. Fill the page buffer.
  4. Perform a Write Page (WP) command.

The NVM command set supports both a single erase and write operation, and split Erase Page (ER) and Write Page (WP) commands. This split commands enable shorter programming time for each command, and the erase operations can be done during non-time-critical programming execution.

The EEPROM programming is similar, but only the bytes updated in the page buffer will be written or erased in the EEPROM.