
7905 Group User’s Manual Rev.1.0
8-24
TIMER B
(2)
Timer Bi overflow flag
s When counter clear type is selected
A timer Bi interrupt request occurs when a measurement pulse’s valid edge is input or when a
counter overflow occurs. The timer Bi overflow flag is used to identify the source of the interrupt
request occurrence, that is, whether it is an overflow occurrence or a valid edge input.
The timer Bi overflow flag is set to “1” at an overflow occurrence. Accordingly, the source of the
interrupt request occurrence is identified by checking the timer Bi overflow flag in the interrupt
routine. When a value is written to the timer Bi mode register after the next count timing of the
count source with the count start bit = “1,” the timer Bi overflow flag will be cleared to “0”.
The timer Bi overflow flag is a read-only bit.
Use the timer Bi interrupt request bit to detect the overflow timing. Do not use the timer Bi overflow
flag for this detection.
s When free-run type is selected
The timer Bi overflow flag is set to “1” at an overflow occurrence. (At this time, no timer Bi interrupt
request is generated.) Accordingly, whether a counter overflow occurs between valid edges is
identified by checking the timer Bi overflow flag in the interrupt routine owing to a valid edge input.
When a value is written to the timer Bi mode register after the next count timing of the count
source with the count start bit = “1,” the timer Bi overflow flag will be cleared to “0”.
The timer Bi overflow flag is a read-only bit.
Figure 8.5.3 shows the processing example of a timer Bi interrupt when a measurement pulse’s valid
edge is detected by the timer Bi interrupt request.
8.5 Pulse period/pulse width measurement mode
Fig. 8.5.3 Processing example of timer Bi interrupt when free-run count type is selected
RTI
0
1
Timer Bi interrupt
(Note 1)
Measured value is read out.
(Note 2)
Timer Bi overflow flag ?
Timer Bi overflow flag is
cleared to “0.” (Note 3)
Processing with overflow
Processing without overflow
Notes 1: The valid edge of the measurement pulse is detected.
2: Be sure to read out the timer Bi register.
3: After the timer Bi overflow flag is set to “1”, be sure to wait for one cycle
of the count source to elapse.
Then, write a value to the timer Bi mode register.