M50FLW040A, M50FLW040B
APPENDIX B. FLOWCHARTS AND PSEUDO CODES
Figure 22. Program Flowchart and Pseudo Code
Start
Write 40h or 10h
Write Address
and Data
Program command:
– Write 40h or 10h
– Write Address and Data
(memory enters read status state after
the Program command)
Read Status
Register
NO
Suspend
NO
SR7 = 1
YES
YES
Suspend
Loop
do:
– Read Status Register
– If SR7=0 and a Program/Erase Suspend
command has been executed
– SR7 is set to 1
– Enter suspend program loop
NO
SR3 = 0
YES
VPP Invalid
Error (1, 2)
If SR3 = 1,
– Enter the "VPP invalid" error handler
FWH/LPC
Interface
Only
NO
SR4 = 0
YES
NO
SR1 = 0
YES
End
Program
Error (1, 2)
Program to Protected
Block Error (1, 2)
If SR4 = 1,
– Enter the "Program error" error handler
If SR1 = 1,
– Enter the "Program to protected
block" error handler
AI08425B
Note: 1. A Status check of SR1 (Protected Block), SR3 (VPP invalid) and SR4 (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.
44/52