
μ
PD17016, 17017
103
(c) If BTM0CY flag is detected at same time as CE reset
As explained in (b), CE reset is effected if the BTM0CY flag is set to “1”.
If an instruction that reads the BTM0CY flag happens to be executed at the same time as CE reset,
execution of the instruction that reads the BTM0CY flag takes precedence.
Therefore, if the next setting of the BTM0CY flag (rising of the timer carry FF setting pulse) after the CE
pin has gone high is performed at the same time as the instruction that reads the
BTM0CY flag, CE reset is effected “when the BTM0CY flag is set next”.
This operation is illustrated in Figure 11-8.
Figure 11-8. Operation When CE Reset Is Executed At Same Time As Instruction
That Reads BTM0CY Flag
H
L
H
L
1
0
CE pin
Timer carry FF
setting pulse
BTM0CY flag
SKT1
BTM0CY
CE reset
SKT1
BTM0CY
H
L
1
0
Timer carry FF
setting pulse
BTM0CY flag
Instruction
Embedded macro
PEEK WR,. MF. BTM0CY SHR4
SKT WR, #. DF. BTM0CY AND 000 FH
If BTM0CY flag is read during this period, CE
reset is delayed once.
Program is supposed to start from address 0000H at this time,
but CE reset is not effected because program that reads
BTM0CY takes precedence.
SKT 1 BTM0CY
(PEEK ··· )
(SKT ··· )
4.44 s
Therefore, a program that periodically detects the BTM0CY flag never executes a CE reset if the
detection interval of the BTM0CY flag is the same as the setting time of the TMCY flag.
This must be prevented as follows.
Because one instruction cycle is 4.44
μ
s (1/225 kHz), a program, for example, that detects the BTM0CY
flag once every 255 instructions reads the BTM0CY flag every 1 ms = 4.44
μ
s
×
225.
Once detection and setting of the BTM0CY flag coincide, CE reset is never effected no matter which
of 1, 5, 100, or 250 ms of the timer time setting pulse is selected.
Therefore,
do not develop a program that has a cycle satisfying the following condition
.
t
SET
×
225
X
= n (n: natural number)
where,
t
SET
X
: setting time of BTM0CY flag
: period x number of steps of instruction that reads BTM0CY flag
An example of a program that satisfies this condition is shown below. Do not develop such a program.