BAT32G1x9 user manual | Chapter 8 Timer B
292 / 1149
Rev.1.02
8.5
Timer B interrupt
Timer B generates timer B interrupt requests from 4 interrupt sources. The associated registers for the timer B
interrupt are shown in Table 8-16, and the block diagram of the timer B interrupt is shown in Figure 8-31.
Table 8-16
Timer B interrupt related registers
Status
register for
timer B
Interrupts of
timer B enable
registers
Interrupt request flag
(Register)
Interrupt mask flag
(Register)
The priority specifies
the flag
(Register)
Timer B
TBSR
TBIER
TBIF (IF2H)
TBMK (MK2H)
TBPR0 (PR02H)
TBPR1 (PR12H)
Figure 8-31
Block diagram of timer B interrupt
Timer B interrupt request
IMFA, IMFB, UDF, OVF: TBSR register Bits
IMIEA, IMIEB, UDIE, OVIE: TBIER register Bits
IMFA bit
IMIEA bit
IMFB bit
IMIEB bit
UDF bit
UDIE bit
OVF bit
OVIE bit
Because timer B generates 1 interrupt request from multiple interrupt request sources (timer B interrupt), in
addition to the timer M interrupt, there are the following differences between other maskable interrupts:
•
Bit0 of the IF1D register when the bit of the TBSR register is "1" and the bit of the corresponding TBIER
register is "1" (interrupt Enable). The bit becomes "1" (with interrupt request).
•
When multiple bits of the TBIER register are "1", the TBSR register must be used to determine which
request source generated the interrupt.
•
Because each of the TBSR registers does not automatically change to "0" even if an interrupt is accepted,
these positions must be "0" in the interrupt program.
•
When you want to set the status flag (hereinafter referred to as the "object status flag") of one of the interrupt
sources of timer B to "0", if the interrupt is interrupted by timer B interrupt enable register (TBIER) to disable
interrupts, you must use any of the following methods (a) ~ (c) to set "0".
a) The object status flag must be written "0" after setting the timer B interrupt enable register (TBIER)
to "00H" (disable all interrupts).
b) When the timer B interrupt enable register (TBIER) has a bit of "1" (Enable) set and the bit Enable
interrupt source status is flagged as "0", you must write "0" to the o bject status flag. (e.g.) clearing
TBIMFB in a state where TBIMIEA and TBOVIE enable interrupts and TBIMIEB prohibits interrupts
• Timer B interrupt enables the state of the register (TBIER).