English
Language : 

W78ERD2_07 Datasheet, PDF (51/76 Pages) Winbond – 8-BIT MICROCONTROLLER
W78ERD2/W78ERD2A
14. TIMED-ACCESS PROTECTION
The W78ERD2 has features like Timer clock selecting by setting CKCON, software reset and ISP
function that are crucial to the proper operation of the system. Consequently, The SFR CHPCON and
CKCON, which control the functions, have restricted write access to protect CPU from errant
operation. The W78ERD2 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 87h to the register CHPENR. This starts a counter, which expires in three
machine cycles. Then, if the software writes 59h to CHPENR 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
CHPENRREG 0F6h
; Define new register CHPENR, located at 0F6h
MOV CHPENR, #87h
MOV CHPENR, #59h
Five examples, some correct and some incorrect, of using timed-access protection are shown below.
- 51 -
Publication Release Date: February 14, 2007
Revision A10