TC1796
System Units (Vol. 1 of 2)
Program Memory Unit
User’s Manual
7-35
V2.0, 2007-07
PMU, V2.0
7.2.8.2
Margin Check Control
The margin control feature of the TC1796 Flash module makes it possible to change the
sensing levels of the sense amplifiers of the Flash array bit lines for read operations. With
this feature, problematic Flash array bits can be found in advance, before they convert
to stable erratic bits. Margin control is supported separately for PFLASH and DFLASH.
Two Margin Control Registers, MARP for PFLASH and MARD for DFLASH, are provided
to adapt the margin levels. Two margin levels, standard or high margin level, are
selectable for 0 or 1 level detection. Standard margin levels are selected as default after
reset.
Since problematic Flash array bits always change their value from a valid 1 to an invalid
0 level, these bits can be identified and corrected in advance by executing the following
steps:
1. Checking the high-level margin by setting bit field MARGIN1 in the MARP or MARD
register to 01
B
(high margin selected) and MARGIN0 to 00
B
(standard margin
selected).
2. Reading related Flash memory locations while observing the single-bit and double-
bit Flash interrupts; if an error occurs, executing an erase and reprogramming of the
corresponding sector.
A zero check (analogous procedure as shown in steps 1 and 2 for programmed cells) is
normally not necessary, because the energetically stabilized state of Flash cells is close
to the zero-state.
Only one high margin level (high or standard level, either for PFLASH or DFLASH) is
allowed at a time. During erase or programming operations only the standard margin
selections are allowed.
Attention: To increase the security and to inhibit unintended write accesses to the
MARP register, the standard “ENDINIT” protection feature (including
watchdog password access control) should be used for write accesses
to the MARP register (for PFLASH). Using this mechanism, it is
possible to change the read margins of the PFLASH only before End-
of-initialization or after ENDINIT with valid password access to register
WDT_CON0. The MARD register for Data Flash is not especially
protected.
Note: After changing a margin level in the MARP or MARD registers, a wait time of 10
µ
s
must elapse before Flash read operations with the modified margin can be
executed.