
Preliminary W79E225A/227A Data Sheet
Publication Release Date: December 14, 2007
- 174 -
Revision A2.0
20. TIMED ACCESS PROTECTION
The W79E225/227 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 W79E225/227 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
MOV
MOV
TA, #0AAh
TA, #055h
WDCON, #00h
; 3 M/C ; Note: M/C = Machine Cycles
; 3 M/C
; 3 M/C
Example 2: Valid access
MOV
MOV
NOP
SETB EWT
TA, #0AAh
TA, #055h
; 3 M/C
; 3 M/C
; 1 M/C
; 2 M/C
Example 3: Valid access
MOV
MOV
ORL
TA, #0Aah
TA, #055h
WDCON, #00000010B ; 3M/C
; 3 M/C
; 3 M/C
Example 4: Invalid access
MOV
MOV
NOP
NOP
CLR
TA, #0AAh
TA, #055h
POR
; 3 M/C
; 3 M/C
; 1 M/C
; 1 M/C
; 2 M/C