34 STC12C5Axx
Technical Summary
Watch Dog Timer
The watch dog timer in STC12C5Axx consists of an 8-bit pre-scalar timer and a 15-bit timer.
The timer is one-time enabled by setting EN_WDT. Clearing ENW can not stop WDT
counting. When the WDT is enabled, software should always reset the timer by writing 1 to
CLR_WDT bit before the WDT overflows. If STC12C5Axx is out of control by any disturbance,
that means the CPU can not run the software normally, then WDT may miss the “writing 1 to
CLR_WDT” and overflow will come. WDT overflow reset the CPU to restart.
PS2 PS1
PS0
-
EN_
WDT
CLR_
WDT
IDL_
WDT
WDT_
FLAG
1/256
1/128
1/64
1/32
1/16
1/8
1/4
1/2
8-bit prescalar
15-bit timer
IDLE
Fosc/12
WDT_CONTR
To make good use of the watch-dog-timer, the user should take notice on SFR
WDT_CONTR
.
SFR:
WDT_CONTR
(WDT Control Register)
C1H
Read/Write
Address:
0XC1H
Default:
0000-0000
Bit
7
6
5
4
3
2
1
0
Name
WDT_FLAG EN_WDT CLR_WDT IDL_WDT
PS2 PS1 PS0
WDT_FLAG: =
When WDT overflows, this bit is set. It can be cleared by software.
EN_WDT: =
Control bit to enable Watch-Dog-Timer. (One-time enabled, can not be disabled)
0: =
(default)
Disable Watch Dog Timer
1
: =
Enable Watch Dog Timer start counting
CLR_WDT: =
Set this bit to recount WDT. Hardware will automatically clear this bit.
http://www.DataSheet4U.net/
datasheet pdf - http://www.DataSheet4U.net/