Figure 11. Program Flowchart and Pseudo Code
M28W320CT, M28W320CB
Start
Write 40h or 10h
Command
Write Address
& Data
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
Program instruction:
– write 40h or 10h command
– write Address & Data
(memory enters read status state after
the Program instruction)
do:
– read status register (E or G must be
toggled) if PES instruction 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
AI03538
Note: 1. Status check of b1 (Protected Block), b3 (VPP Invalid) and b4 (Program Error) can be made after each program operation or after
a sequence.
2. If an error is found, the Status Register must be cleared (CLRS instruction) before further P/E.C. operations.
29/42