MB89190/190A series
Chapter 7 8-/16-bit Timer/Counter
7-15
7.
5 InterruptCausedby8-/16-bitTimer/Counter
The interrupt factor for the 8/16-bit timer/counter is the match between the data
register setting and the counter value when the interval timer or the counter is
working.
T Interrupt caused by 8-/16-bit timer/counter
Table 7-5a shows the interrupt request flag bit, interrupt request output enable bit, and interrupt factor of
the 8-/16-bit timer/counter.
Table 7-5a Interrupt Control Bits and Interrupt Factor for 8-/16-bit Timer/Counter
8-bit mode
16-bit mode
Timer 1
Timer 2
Timer 1 + Timer 2
Interrupt request flag bit
T1CR : T1IF
T2CR : T2IF
T1CR : T1IF
Interrupt request enable bit
T1CR : T1IE
TCR0 : T2IE
T1CR : T1IE
Interrupt factor
T1DR setting and 8-bit
counter value match
T2DR setting and 8-bit
counter value match
Setting of T1DR + T2DR and
16-bit counter value match
interrupt request
IRQ3
IRQ4
IRQ3
The interrupt request for the 8-/16-bit timer/counter is caused independently by timer 1 and timer 2 when
the 8-bit mode is working, and is caused by timer 1 when the 16-bit mode is working. However, the basic
operation is all the same for both the 8-bit mode and the 16-bit mode.
Only the interrupt operation
caused by timer 1 when the 8-bit mode is working is explained here.
Interrupt operation caused by 8-bit mode timer 1
When the counter value increments starting with 00H using the selected count clock, and matches the
setting of the comparate data latch associated with the timer data register (T1DR), the interrupt
request flag bit (T1CR: T1IF) is set to 1. At this point, when the interrupt request flag bit is enabled
(T1CR: T1IF = 1), an interrupt request (IRQ3) to the CPU occurs. Write 0 to the T1IF bit using the
interrupt-processing routine to clear the interrupt request. The T1IF bit is set to 1 irrespective of the
value of the T1IE bit when the counter value and the setting match. In the 8-bit mode, timer 1 and
timer 2 operate independently, and they generate the corresponding interrupt requests (IRQ3, IRQ4),
respectively.
Remarks:
The T1IF bit is not set when the match between the counter value and the T1DR register occurs
simultaneously with the counter stop (T1CR: T1STR = 0).
When the T1IF bit is 1, an interrupt request occurs immediately when the T1IE bit is changed from
Disable to Enable (0
→ 1).