English
Language : 

UPSD33XX Datasheet, PDF (152/231 Pages) STMicroelectronics – Fast 8032 MCU with Programmable Logic
uPSD33xx
Data Toggle. Checking the Toggle Flag Bit
(DQ6) is another method of determining whether a
program or erase operation is in progress or has
completed. Figure 62 shows the Data Toggle algo-
rithm.
When the 8032 issues a program instruction se-
quence, the embedded algorithm within the Flash
memory array begins. The 8032 then reads the lo-
cation of the byte to be programmed in Flash
memory to check status. The Toggle Flag Bit
(DQ6) of this location toggles each time the 8032
reads this location until the embedded algorithm is
complete. The 8032 continues to read this loca-
tion, checking the Toggle Flag Bit (DQ6) and mon-
itoring the Error Flag Bit (DQ5). When the Toggle
Flag Bit (DQ6) stops toggling (two consecutive
reads yield the same value), then the embedded
algorithm is complete. If the Error Flag Bit (DQ5) is
'1,' the 8032 should test the Toggle Flag Bit (DQ6)
again, since the Toggle Flag Bit (DQ6) may have
changed simultaneously with the Error Flag Bit
(DQ5) (see Figure 62).
The Error Flag Bit (DQ5) is set if either an internal
time-out occurred while the embedded algorithm
attempted to program the byte, or if the 8032 at-
tempted to program bit to logic ’1’ when that bit
was already programmed to logic ’0’ (must erase
to achieve logic ’1’).
It is suggested (as with all Flash memories) to read
the location again after the embedded program-
ming algorithm has completed, to compare the
byte that was written to Flash memory with the
byte that was intended to be written.
When using the Data Toggle method during an
erase operation, Figure 62 still applies. the Toggle
Flag Bit (DQ6) toggles until the erase operation is
complete. A ’1’ on the Error Flag Bit (DQ5) indi-
cates a time-out condition on the Erase cycle, a ’0’
indicates no error. The 8032 can read any location
within the sector being erased to get the Toggle
Flag Bit (DQ6) and the Error Flag Bit (DQ5).
PSDsoft Express generates ANSI C code func-
tions for implementation of these Data Toggling al-
gorithms.
Figure 62. Data Toggle Flowchart
START
READ
DQ5 & DQ6
DQ= 6
NO
TOGGLE
YES
NO DQ5
=1
YES
READ DQ6
DQ= 6
NO
TOGGLE
YES
FAIL
PASS
AI01370B
152/231