6 inTeRRuPT COnTROlleR (iTC)
S1C17624/604/622/602/621 TeChniCal Manual
Seiko epson Corporation
6-5
3.2.1 Interrupt Level Setting Bits
Table 6.
hardware interrupt
interrupt level setting bits
Register address
P0 port interrupt
ILV0[2:0] (D[2:0]/ITC_LV0 register)
0x4306
P1 port interrupt
ILV1[2:0] (D[10:8]/ITC_LV0 register)
0x4306
Stopwatch timer (SWT) interrupt
ILV2[2:0] (D[2:0]/ITC_LV1 register)
0x4308
Clock timer (CT) interrupt /
Real-time clock (RTC) interrupt (S1C17624/604)
ILV3[2:0] (D[10:8]/ITC_LV1 register)
0x4308
8-bit OSC1 timer (T8OSC1) interrupt
ILV4[2:0] (D[2:0]/ITC_LV2 register)
0x430a
Supply voltage detector (SVD) interrupt
ILV5[2:0] (D[10:8]/ITC_LV2 register)
0x430a
LCD driver (LCD) interrupt /
16-bit PWM timer (T16A2) Ch.0 interrupt (S1C17624/604)
ILV6[2:0] (D[2:0]/ITC_LV3 register)
0x430c
16-bit PWM timer (T16E) Ch.0 interrupt
ILV7[2:0] (D[10:8]/ITC_LV3 register)
0x430c
8-bit timer (T8F) Ch.0 & Ch.1 interrupt
ILV8[2:0] (D[2:0]/ITC_LV4 register)
0x430e
16-bit timer (T16) Ch.0 interrupt
ILV9[2:0] (D[10:8]/ITC_LV4 register)
0x430e
16-bit timer (T16) Ch.1 interrupt
ILV10[2:0] (D[2:0]/ITC_LV5 register)
0x4310
16-bit timer (T16) Ch.2 interrupt
ILV11[2:0] (D[10:8]/ITC_LV5 register)
0x4310
UART Ch.0 interrupt
ILV12[2:0] (D[2:0]/ITC_LV6 register)
0x4312
I
2
C slave (I2CS) interrupt /
UART Ch.1 interrupt
ILV13[2:0] (D[10:8]/ITC_LV6 register)
0x4312
SPI Ch.0 interrupt
ILV14[2:0] (D[2:0]/ITC_LV7 register)
0x4314
I
2
C master (I2CM) interrupt
ILV15[2:0] (D[10:8]/ITC_LV7 register)
0x4314
IR remote controller (REMC) interrupt
ILV16[2:0] (D[2:0]/ITC_LV8 register)
0x4316
16-bit PWM timer (T16A2) Ch.1 interrupt (S1C17624/604) ILV17[2:0] (D[10:8]/ITC_LV8 register)
0x4316
A/D converter (ADC10) interrupt
ILV18[2:0] (D[2:0]/ITC_LV9 register)
0x4318
R/F converter (RFC) interrupt
ILV19[2:0] (D[10:8]/ITC_LV9 register)
0x4318
interrupt Processing by the S1C17 Core
6.3.3
A maskable interrupt to the S1C17 Core occurs when all of the following conditions are met:
• The interrupt is enabled by the interrupt control bit inside the peripheral module.
• The IE (Interrupt Enable) bit of the PSR (Processor Status Register) in the S1C17 Core has been set to 1.
• The cause of interrupt that has occurred has a higher interrupt level than the value set in the IL field of the PSR.
• No other cause of interrupt having higher priority, such as NMI, has occurred.
If an interrupt cause that has been enabled in the peripheral module occurs, the corresponding interrupt flag is set to 1,
and this state is maintained until it is reset by the program. This means that the interrupt cause is not cleared even if
the conditions listed above are not met when the interrupt cause occurs. An interrupt occurs if the above conditions
are met.
If multiple maskable interrupt causes occurs simultaneously, the interrupt cause with the highest interrupt level and
lowest vector number becomes the subject of the interrupt request to the S1C17 Core. Interrupts with lower levels
are held until the above conditions are subsequently met.
The S1C17 Core samples interrupt requests for each cycle. On accepting an interrupt request, the S1C17 Core
switches to interrupt processing immediately after execution of the current instruction has been completed.
Interrupt processing involves the following steps:
(1) The PSR and current program counter (PC) values are saved to the stack.
(2) The PSR IE bit is reset to 0 (disabling subsequent maskable interrupts).
(3) The PSR IL bits are set to the received interrupt level. (The NMI does not affect the IL bits.)
(4) The vector for the interrupt occurred is loaded to the PC to execute the interrupt handler routine.
When an interrupt is accepted, (2) prevents subsequent maskable interrupts. Setting the IE bit to 1 in the interrupt
handler routine allows handling of multiple interrupts. In this case, since IL is changed by (3), only an interrupt
with a higher level than that of the currently processed interrupt will be accepted.
Ending interrupt handler routines using the
reti
instruction returns the PSR to the state before the interrupt has
occurred. The program resumes processing following the instruction being executed at the time the interrupt oc-
curred.