
μ
PD17016, 17017
102
Figure 11-7. Timing Chart
A
C
<1>
<3>
<3>
<3>
<3>
B
B
B
B
B
<3> <3>
B
B
B
<3> <3>
<3> <3>
B
B
A
<1>
<3> <3>
B
B
B
Updates
watch
Updates
watch
Updates
watch
Updates
watch
CE reset
Program starts
from address 0.
Updates
watch
Watch is updated
because BTM0CY flag
is set (1)
BTM0CY flag detection
Power-ON reset
Program starts from
address 0
Applocation of
supply voltage
Point A
Point B
Point C
Point D
Point E
5 V
0 V
H
L
H
L
H
L
1
0
V
DD
CE
Internal pulse
10 Hz
Timer carry FF
setting pulse
BTM0CY flag
Program processing
Program instruction
As shown in Figure 11-7, the program is started from address 0000H at the rising edge of the internal
10-MHz pulse when supply voltage V
DD
is applied first.
When the BTM0CY flag is detected at point A, the BTM0CY flag is reset to “0” because power has been
just applied, and it is judged that a power failure (power-ON reset) has occurred.
Therefore, “processing C” is executed and the timer carry FF setting pulse is set to 100 ms.
Because the contents of the BTM0CY flag are read once at point A, the BTM0CY flag is set to “1” every
100 ms.
Next, the program counts up the watch while executing “processing B” even if the CE pin goes low at
point B and high at point C, unless the clock stop instruction is executed.
Because the CE pin goes high at point C, CE reset is effected at point D where the pulse for setting
the next timer carry FF rises and the program is started from address 0000H.
Because the BTM0CY flag is set to “1” when it is detected at point E at this time, it is judged that back
up (CE reset) has been performed.
As is evident from the figure, the watch is delayed by 100 ms each time CE reset is effected unless the
watch is updated by 100 ms at point E.
If processing A takes longer than 100 ms when a power failure is detected at point E, setting of the
BTM0CY flag is overlooked two times; therefore, processing A must be completed in less than 100
ms.
The same applies when the timer carry FF setting pulse is set to 250, 5, or 1 ms.
Therefore, the BTM0CY flag must be detected to detect a power failure within the timer carry FF setting
time after the program has started from address 0000H.