
Rev. 1.00
��
��ne 1�� �01�
Rev. 1.00
�5
��ne 1�� �01�
HT46R003B
Cost-Effective A/D 8-bit OTP MCU
HT46R003B
Cost-Effective A/D 8-bit OTP MCU
Watchdog Timer Operation
The Watchdog Timer operates by providing a device reset when its timer overflows. This means
that in the application program and during normal operation the user has to strategically clear the
Watchdog Timer before it overflows to prevent the Watchdog Timer from executing a reset. This is
done using the clear watchdog instruction. Note that if the Watchdog Timer function is not enabled,
then any instruction related to the Watchdog Timer will result in no operation.
Setting the various Watchdog Timer options are controlled via the internal registers WDTC and
WDTS. Enabling the Watchdog Timer can be controlled by the WDTEN
n
bits in the internal WDTC
register in the Data Memory. The Watchdog Timer will be disabled if bits WDTEN5~WDTEN0 in
the WDTC register are written with the binary value 101101B while the WDT Timer will be enabled
if these bits are written with the binary value 000000B. If these bits are written with the other values
except 000000B and 101101B, the MCU will be reset.
The Watchdog Timer clock can emanate from three different sources, selected by the
WDTCLS1~WDTCLS0 bits in the WDTC register. These sources are f
SYS
, f
SYS
/4 or LIRC. It is
important to note that when the system enters the Sleep Mode the system clock is stopped, therefore
if it has selected f
SYS
or f
SYS
/4 as the Watchdog Timer clock source, the Watchdog Timer will stop.
For systems that operate in noisy environments, it’s recommended to use the LIRC as the clock
source. The division ratio of the prescaler is determined by bits 0, 1 and 2 of the WDTS register,
known as WS0, WS1 and WS2. If the Watchdog Timer internal clock source is selected and with
the WS0, WS1 and WS2 bits of the WDTS register all set high, the prescaler division ratio will be
1:32768, which will give a maximum time-out period.
Under normal program operation, a Watchdog Timer time-out will initialize a device reset and set
the status bit TO. However, if the system is in the Sleep Mode, when a Watchdog Timer time-out
occurs, the device will be woken up, the TO bit in the status register will be set and only the Program
Counter and Stack Pointer will be reset. Four methods can be adopted to clear the contents of the
Watchdog Timer. The first is a WDT software reset, which means a certain value except 000000B
and 101101B written into the WDTEN5~WDTEN0 bit filed, the second is an external hardware
reset, which means a low level on the external reset pin, the third is using the Clear Watchdog Timer
software instructions and the fourth is via a “HALT” instruction.
There is only one method of using software instruction to clear the Watchdog Timer. That is to use
the “CLR WDT” instruction to clear the WDT.
“
CLR WDT
”
Instruction
8-stage Divider
WDT Prescaler
WDTEN5~WDTEN0 bits
WDTC
Register
Reset MCU
S/W
Control
f
S
f
S
/2
8
8-to-1 MUX
CLR
WS2~WS0
(f
S
/2
8
~ f
S
/2
15
)
WDT Time-out
(2
8
/f
S
~ 2
15
/f
S
)
f
SYS
/4
f
SYS
f
LIRC
WDTCLS1~WDTCLS0
RES pin reset
“
HALT
”
Instruction
Watchdog Timer