7
6320B–ATARM–05-Nov-07
Application Note
4.2
ECC Controller Preliminary Requirements
In order to calculate ECC properly during write/read and read processes, the following con-
straints must be respected:
• at least 1 Hold time must be programmed in the RWHOLD field of the SMC_CSRx register
(only AT91SAM7SE family is concerned)
• read/write sequence must start at a page boundary
• read/write accesses must be done through the whole main area since ECC is calculated on
the main area data
• data accesses must be performed chronologically through the main area
• the appropriate page size must be programmed in the PAGESIZE field of the ECC_MR
register
4.3
ECC Controller Functional Description
4.3.1
Page Write Sequence
The ECC controller is automatically reset as soon as the first write command (80h) is performed
to the NAND Flash or the SmartMedia device.
The ECC calculation starts only once the required address cycles (the number of address cycles
depends on the device type) is performed to NAND Flash or the SmartMedia device.
The ECC is refreshed at each write access of the page until the last byte or half word of the main
area is written.
Once the whole main area has been written, the final ECC result is available in the ECC Parity
Register (ECC_PR) and ECC NParity Register (ECC_NPR) until a new start condition occurs. It
is up to the software application to write the Parity ECC and NParity ECC in the appropriate loca-
tions of the device spare area.
Please note that apart from data accesses (ALE = CLE = 0), the ECC controller ignores any
other command which is performed to the NAND Flash or the SmartMedia device.
below illustrates a full page write sequence with ECC calculation.
Figure 4-3.
ECC Calculation During Page Write Sequence without Random Write Spare Area
I/Ox
Address
Write
Command 1
Write
Command 2
Address cycles
ECC Controller
Reset
Main Area Write Accesses
Accesses Allowing ECC calculation
Start of ECC
Calculation
ECC Result
Ready in and Locked
Accesses Ignored by the ECC Controller
for ECC calculation
Spare Area ECC locations
Write Accesses
80h
10h
1st
2nd
...
n th
ECC
ECC
ECC
ECC
Main Area Size