Programming (or Clear) Algorithm
PRELIMINARY
3.2 Programming (or Clear) Algorithm
The programming algorithm sequentially writes any number of addresses with a specified bit pattern.This algorithm is used to program application code or data into the flash array. With a slight modification, the same algorithm per- forms the clear portion of the initialization flow (i.e., programs all bits to zero). In this role, the algorithm is called the clear algorithm. For the clear algorithm, the values programmed are always 0000h, while the values for application code can be any combination of 1s and 0s. Figure 3±2 highlights the program- ming and clear algorithms' place in the overall flow.
Figure 3±2. The Programming Algorithm in the Overall Flow
Clear algorithm
Erase algorithm
Start
X = 1
Clear the
array
Erase the
array
Bits in
depletion?
No
Initialization flow
|
|
|
|
|
|
|
|
| |
|
|
|
| |
| Recover using | |||
| algorithm |
| ||
|
| |||
|
|
| ||
|
|
| X = X+1 | |
|
|
|
|
|
Yes |
|
| Yes | |
|
| |||
|
|
| ||
|
|
| X < 10 ? | |
|
|
|
No
Fail
Yes
No
Reprogram?
Done/Stop
Program the array
Programming algorithm
PRELIMINARY |