Programs data into flash memory using SPI programming


*Mode byte: The mode parameter is essential for how this command works. The bits in the mode byte have the following meanings:


The Word/Page Modebit selects if the device supports page programming or not. The command bytes are different for word and page mode. In word mode, the SPI commands Write Program Memory and Read Program Memory are used. In page mode, Load Page, Write Program Memory Page and Read Program Memory are used. The read instruction is used if Value Polling is specified in the mode bit. The Low/High byte selection bit (3rd bit in the Load Page, Write Program Memory commands) is handled by EDBG automatically, so leave this bit cleared.

According to the mode, different termination methods are selected – Timed delay, Value polling or RDY/BSY polling.

For paged operation, the Write pagebit decides if a Write Program Memory Page command should be issued after the data has been loaded into the page buffer. For devices with page size bigger than what can be transferred to EDBG in one command, several SPI_CMD_PROGRAM_FLASH commands must be issued. In such a case, only the last command should have the Write Page mode bit set.

NOTE: Only bit 0-6 are set in the XML file, because bit 7 is not constant and must be controlled by the PC software.

When value polling is used to determine when a programming operation is complete, poll1 must be supplied. This value indicates which value will be read from the device until the programmed value is read. This indicates end of programming. poll2 is used only for EEPROM programming.

Response: