English
Language : 

DS80C320-MCG Datasheet, PDF (155/175 Pages) Dallas Semiconductor – High-Speed Microcontroller User Guide
High-Speed Microcontroller User’s Guide
SECTION 13: TIMED ACCESS PROTECTION
The High-Speed Microcontroller uses a protection feature called Timed Access to prevent accidental
writes to critical SFR bits. These bits could cause a system failure or prevent the Watchdog Timer from
doing its job if improperly written. The Timed Access involves opening a timing window during which
the protected bit can be modified. If the window is opened correctly, it remains open long enough to alter
one protected bit. This section explains which bits are protected, why, and how to use the Timed Access
feature.
PROTECTED BITS
Bits which are protected by the Timed Access feature are shown below. Only critical function bits which
are unique to the High-Speed Microcontroller family are protected, assuring code compatibility with the
original 80C51 or 80C52. A full description of the function of each bit is provided in Section 4.
EXIF.0
WDCON.6
WDCON.1
WDCON.0
WDCON.3
TRIM.7
TRIM.6
TRIM.5
TRIM.4
TRIM.3
TRIM.2
TRIM.1
TRIM.0
ROMSIZE.2
ROMSIZE.1
ROMSIZE.0
RTCC.2
RTCC.0
BGS
POR
EWT
RWT
WDIF
E4K
X12/ 6
TRM2
TRM2
TRM1
TRM1
TRM0
TRM0
RMS2
RMS1
RMS0
RTCWE
RTCE
Band-gap Select
Power-on Reset Flag
Watchdog Reset Enable
Reset Watchdog Timer
Watchdog Interrupt Flag
4096 Hz RTC Output
12pF/6pF Crystal Select
Capacitance Trim Bit 2
Inverse Capacitance Trim Bit 2
Capacitance Trim Bit 1
Inverse Capacitance Trim Bit 1
Capacitance Trim Bit 0
Inverse Capacitance Trim Bit 0
ROM Size Select Bit 2
ROM Size Select Bit 1
ROM Size Select Bit 0
RTC Write Enable
RTC Enable
PROTECTION SCHEME
Each bit mentioned above is protected against an accidental write by requiring the software to perform a
procedure before writing the bit. Timed Access requires the software to write two specific values to the
Timed Access register during two consecutive instruction cycles. The values AAh, then 55h, must be
written in consecutive instructions to the TA register at SFR location C7h. If the writes are performed
correctly, the write access window will open for three machine cycles. During this window, the software
may modify a protected bit. The suggested code to open a Timed Access window is:
MOV 0C7h, #0AAh
MOV 0C7h, #55h
The procedure to modify a Timed Access protected bit begins by writing the value AAh to the Time
Access register (TA;C7h). The value 55h must then be written to the Timed Access register within three
machine cycles of writing AAh. This opens a three machine cycle window, after the write of 55h, during
which any Timed Access protected bits may be modified. Failure to complete any of the required steps
will also require the procedure to begin again, starting with the write of AAh to the Timed Access
register. Attempts to modify Timed Access protected bits after the window has closed will be ignored.
155 of 175