142
µ
PD17062
12.4.1 Timer Update Time and BTM0CY Flag Check Time Interval
As described in Section 12.3.1, the time interval tSET at which the BTM0CY flag is checked must be less than
the time interval at which the timer carry FF is set.
Even when the above requirement is satisfied, if the timer update process takes long, the timer process
may not be performed correctly when a CE reset occurs.
To solve this problem, it is necessary to satisfy the following condition.
tCHECK + tTIMER < tSET
where tCHECK : Time interval at which the BTM0CY flag is checked
tTIMER : Timer update process time
tSET : Time interval at which the timer carry FF is set
An example follows:
Example Timer update process and BTM0CY flag check time interval
START: ; Program address 0000H
INITFLG NOT BTM0ZX, NOT BTM0CK2, NOT BTM0CK1, NOT BTM0CK0
; Built-in macro
; Specifies the timer carry FF setting time interval as 100 ms.
TIMER:
;
SKT1 BTM0CY flag ; Built-in macro
; Tests the BTM0CY flag.
BR AAA ; Branches to AAA, if 0.
Timer update
BR TIMER
AAA:
Process A
BR TIMER
The timing chart for the processing by the above program is shown below.
SKT1
BTM0CY
SKT1
BTM0CY
CE pin
Timer carry FF set pulse
BTM0CY flag
BTM0CY flag check
time interval
tCHECK
Timer update processing
tTIMER If this processing takes long,
a CE reset occurs before the
processing is completed.
CE reset