CHAPTER 5 OPERATION CHECK USING THE DEIVCE
(2) Operation after pressing the switch (operation after interrupt servicing)
If the switch is pressed for less than 10 ms, the switch input is identified as chattering and operation is returned
to that described in (1).
If the switch is pressed for longer than 10 ms, either of the following operations is performed at a 50% chance
of occurrence (see the figure below), depending on the timing at which the switch is pressed.
<1> If an overflow is not caused by the watchdog timer after the switch is pressed
When the switch is turned on (switch is kept pressed), LED1 blinks about every 60 ms. When the switch
is turned off, LED1 blinks about every 120 ms.
<2> If an overflow is caused by the watchdog timer after the switch is pressed
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
Application Note U18847EJ1V0AN
22