IV PERIPHERAL MODULES 2 (TIMERS): 16-BIT TIMERS (T16)
S1C33E07 TECHNICAL MANUAL
EPSON
IV-1-13
IV
T16
IV.1.7 16-bit Timer Interrupts and DMA
The 16-bit timer has a function for generating an interrupt using the comparison match A and B states.
The timing at which an interrupt is generated is shown in Figure IV.1.5.2 in the preceding section.
Control registers of the interrupt controller
Table IV.1.7.1 shows the control registers of the interrupt controller provided for each timer.
Table IV.1.7.1 Control Registers of Interrupt Controller
Cause of interrupt
Timer 0 comparison A
Timer 0 comparison B
Timer 1 comparison A
Timer 1 comparison B
Timer 2 comparison A
Timer 2 comparison B
Timer 3 comparison A
Timer 3 comparison B
Timer 4 comparison A
Timer 4 comparison B
Timer 5 comparison A
Timer 5 comparison B
Cause-of-interrupt flag
F16TC0 (D3/0x300282)
F16TU0 (D2/0x300282)
F16TC1 (D7/0x300282)
F16TU1 (D6/0x300282)
F16TC2 (D3/0x300283)
F16TU2 (D2/0x300283)
F16TC3 (D7/0x300283)
F16TU3 (D6/0x300283)
F16TC4 (D3/0x300284)
F16TU4 (D2/0x300284)
F16TC5 (D7/0x300284)
F16TU5 (D6/0x300284)
Interrupt priority register
P16T0[2:0] (D[2:0]/0x300266)
P16T1[2:0] (D[6:4]/0x300266)
P16T2[2:0] (D[2:0]/0x300267)
P16T3[2:0] (D[6:4]/0x300267)
P16T4[2:0] (D[2:0]/0x300268)
P16T5[2:0] (D[6:4]/0x300268)
Interrupt enable register
E16TC0 (D3/0x300272)
E16TU0 (D2/0x300272)
E16TC1 (D7/0x300272)
E16TU1 (D6/0x300272)
E16TC2 (D3/0x300273)
E16TU2 (D2/0x300273)
E16TC3 (D7/0x300273)
E16TU3 (D6/0x300273)
E16TC4 (D3/0x300274)
E16TU4 (D2/0x300274)
E16TC5 (D7/0x300274)
E16TU5 (D6/0x300274)
When a comparison match state occurs in the timer, the corresponding cause-of-interrupt flag is set to 1.
If the interrupt enable register bit corresponding to that cause-of-interrupt flag has been set to 1, an interrupt
request is generated.
An interrupt caused by a timer can be disabled by leaving the interrupt enable register bit for that timer set to
0. The cause-of-interrupt flag is always set to 1 by the timer's comparison match state, regardless of how the
interrupt enable register is set (even when set to 0).
The interrupt priority register sets an interrupt priority level (0 to 7) for each timer. Priorities within a timer
block are such that timers of smaller numbers have a higher priority. Priorities between interrupt types are such
that the comparison B interrupt has priority over the comparison A interrupt. An interrupt request to the CPU is
accepted only when no other interrupt request of a higher priority has been generated.
It is only when the PSR's IE bit = 1 (interrupts enabled) and the set value of the IL is smaller than the timer
interrupt level set by the interrupt priority register, that a timer interrupt request is actually accepted by the
CPU.
For details on these interrupt control registers, as well as the device operation when an interrupt has occurred,
refer to Section III.2, “Interrupt Controller (ITC).”