CHAPTER 1 OVERVIEW
Either of the following operations is performed at a 50% chance of occurrence (see the figure below), depending on
the switch input timing.
<1> If an overflow is not caused by the watchdog timer during interrupt servicing
Due to the execution of interrupt servicing, LED1 blinks about every 60 ms during switch input. When INTP1
goes to high level (switch is turned off), LED1 blinks about every 120 ms.
<2> If an overflow is caused by the watchdog timer during interrupt servicing
A reset signal is generated by the watchdog timer. After reset release, LED2 lights and LED1 blinks about
every 120 ms.
Remark
LED2 is turned off by a reset signal generated by other than the watchdog timer.
SW
On (turned on for at least 10 ms)
<Input>
LED2
LED1
<Output>
Blinks about
every 120 ms.
Lights.
LED2
LED1
<Output>
Blinks about
every 60 ms.
<1>
<2>
<During interrupt servicing execution>
<After WDT reset generation>
Main processing
Interrupt
servicing
WDT clear
WDT clear
WDT clear
WDT clear
WDT clear
WDT clear
About 120 ms
X ms
About
10 ms
(Chattering
removal)
About 60 ms
About 60 ms
Switch: on
Switch: off
<1> X ms + 10 ms + 60 ms
≤
131 ms
→
No overflow occurs.
→
Interrupt servicing continues.
WDT overflow time = 2
20
/f
X
= About 131 ms (f
X
= 8 MHz)
<2> X ms + 10 ms + 60 ms > 131 ms
→
An overflow occurs.
→
A WDT reset is generated during interrupt
servicing.
The probability that an overflow occurs is 61 ms/120 ms,
which is about 50%, because an overflow occurs when X ms > 61 ms.
Interrupt
servicing
starts
About 120 ms
• • •
Set in the initial
settings.
Main loop
operation
Cautions 1. In this sample program, the watchdog timer is not cleared at the beginning of interrupt servicing
to generate a reset signal at a 50% chance of occurrence by the watchdog timer during interrupt
servicing. In general use, the watchdog timer is cleared at the beginning and end of interrupt
servicing so that no overflow occurs.
2. For cautions when using the device, refer to the user’s manual of each product (
).
Application Note U18847EJ1V0AN
5