358
SAM4CP [DATASHEET]
43051E–ATPL–08/14
When the Programming Page command is given, the EEFC starts the programming sequence and all the bits written at 0
in the latch buffer are cleared in the Flash memory array.
During programming, i.e. until EEFC_FSR.FDRY rises, access to the Flash is not allowed.
Full Page Programming
To program a full page, all the bits of the page must be erased before writing the latch buffer and launching the WP
command. The latch buffer must be written in ascending order, starting from the first address of the page. See
Figure 22-
7, "Full Page Programming"
.
Partial Page Programming
To program only part of a page using the WP command, the following constraints must be respected:
Data to be programmed must be contained in integer multiples of 64-bit address-aligned words.
64-bit words can be programmed only if all the corresponding bits in the Flash array are erased (at logical value 1).
See
Figure 22-8, "Partial Page Programming"
.
Programming Bytes
Individual bytes can be programmed using the partial page programming mode. In this case, an area of 64 bits must be
reserved for each byte, as shown in
Figure 22-9, "Programming Bytes in the Flash"
.
Figure 22-7.
Full Page Programming
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
0xX00
0xX04
0xX08
0xX0C
0xX10
0xX14
0xX18
0xX1C
0xX00
0xX04
0xX08
0xX0C
0xX10
0xX14
0xX18
0xX1C
0xX00
0xX04
0xX08
0xX0C
0xX10
0xX14
0xX18
0xX1C
Before programming: Unerased page in Flash array
CA FE CA FE
CA FE CA FE
CA FE CA FE
CA FE CA FE
CA FE CA FE
CA FE CA FE
CA FE CA FE
CA FE CA FE
Step 1: Flash array after page erase
FF FF FF FF
FF FF FF FF
FF FF FF FF
FF FF FF FF
address space
for
Page N
address space
for
latch buffer
Step 2: Writing a page in the latch buffer
DE CA DE CA
DE CA DE CA
DE CA DE CA
DE CA DE CA
DE CA DE CA
DE CA DE CA
DE CA DE CA
DE CA DE CA
DE CA DE CA
CA FE CA FE
0xX00
0xX04
0xX08
0xX0C
0xX10
0xX14
0xX18
0xX1C
address space
for
Page N
Step 3: Page in Flash array after issuing
WP command and FRDY=1
DE CA DE CA
DE CA DE CA
DE CA DE CA
DE CA DE CA
DE CA DE CA
DE CA DE CA
DE CA DE CA
DE CA DE CA
DE CA DE CA
FF FF FF FF
32 bits wide
32 bits wide