Flowcharts and pseudo codes
12 Flowcharts and pseudo codes
M50FW040
Figure 18. Program flowchart and pseudo code
Start
Write 40h or 10h
Write Address
& Data
Program command:
– write 40h or 10h
– write Address & Data
(memory enters read status state after
the Program command)
FWH
Interface
Only
Read Status
Register
NO
Suspend
YES
NO
b7 = 1
YES
Suspend
Loop
NO
b3 = 0
VPP Invalid
Error (1, 2)
YES
NO
b4 = 0
Program
Error (1, 2)
YES
b1 = 0
NO
Program to Protected
Block Error (1, 2)
YES
End
do:
–read Status Register if Program/Erase
Suspend command given execute
suspend program loop
while b7 = 1
If b3 = 1, VPP invalid error:
– error handler
If b4 = 1, Program error:
– error handler
If b1 = 1, Program to protected block error:
– error handler
AI03407
1. A Status check of b1 (Protected Block), b3 (VPP invalid) and b4 (Program Error) can be made after each
Program operation by following the correct command sequence.
2. If an error is found, the Status Register must be cleared before further Program/Erase Controller
operations.
48/53