English
Language : 

W79E225A_08 Datasheet, PDF (177/203 Pages) Winbond – 8-bit Microcontroller
Preliminary W79E225A/226A/227A Data Sheet
20. TIMED ACCESS PROTECTION
The W79E22X SERIES has features like the Watchdog Timer, wait-state control signal and power-
on/fail reset flag that are crucial to the proper operation of the system. If these features are
unprotected, errant code may write critical control bits, resulting in incorrect operation and loss of
control. To prevent this, the W79E22X SERIES provides has a timed-access protection scheme that
controls write access to critical bits.
In this scheme, protected bits have a timed write-enable window. A write is successful only if this
window is active; otherwise, the write is discarded. The write-enable window is opened in two steps.
First, the software writes AAh to the Timed Access (TA) register. This starts a counter, which expires
in three machine cycles. Then, if the software writes 55h to the TA register before the counter expires,
the write-enable window is opened for three machine cycles. After three machine cycles, the window
automatically closes, and the procedure must be repeated again to access protected bits.
The suggested code for opening the write-enable window is;
TA REG 0C7h
; Define new register TA, located at 0C7h
MOV TA, #0AAh
MOV TA, #055h
Five examples, some correct and some incorrect, of using timed-access protection are shown below.
Example 1: Valid access
MOV TA, #0AAh
MOV TA, #055h
MOV WDCON, #00h
; 3 M/C ; Note: M/C = Machine Cycles
; 3 M/C
; 3 M/C
Example 2: Valid access
MOV TA, #0AAh
MOV TA, #055h
NOP
SETB EWT
; 3 M/C
; 3 M/C
; 1 M/C
; 2 M/C
Example 3: Valid access
MOV TA, #0Aah
; 3 M/C
MOV TA, #055h
; 3 M/C
ORL WDCON, #00000010B ; 3M/C
Example 4: Invalid access
MOV TA, #0AAh
MOV TA, #055h
NOP
NOP
CLR POR
; 3 M/C
; 3 M/C
; 1 M/C
; 1 M/C
; 2 M/C
- 177 -
Publication Release Date: April 15, 2008
Revision A4.0