SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
6.11 MULTI-INTERRUPT OPERATION
Under certain condition, the software designer uses more than one interrupt requests. Processing multi-interrupt
request requires setting the priority of the interrupt requests. The IRQ flags of interrupts are controlled by the interrupt
event. Nevertheless, the IRQ flag “1” doesn‟t mean the system will execute the interrupt vector. In addition, which
means the IRQ flags can be set “1” by the events without enable the interrupt. Once the event occurs, the IRQ will be
logic “1”. The IRQ and its trigger event relationship is as the below table.
Interrupt Name
P00IRQ
Trigger Event Description
P0.0 trigger controlled by PEDGE
T0IRQ
T0C overflow
TC0IRQ
TC0C overflow
ADCIRQ
CM0IRQ
CM1IRQ
CM2IRQ
ADC converting end.
Comparator 0 output level transition.
Comparator 1 output level transition.
Comparator 2 output level transition.
For multi-interrupt conditions, two things need to be taking care of. One is to set the priority for these interrupt requests.
Two is using IEN and IRQ flags to decide which interrupt to be executed. Users have to check interrupt control bit and
interrupt request flag in interrupt routine.
Example: Check the interrupt request under multi-interrupt operation
ORG
JMP
8
; Interrupt vector
INT_SERVICE
INT_SERVICE:
INTP00CHK:
…
; Push routine to save ACC and PFLAG to buffers.
; Check INT0 interrupt request
; Check P00IEN
; Jump check to next interrupt
; Check P00IRQ
B0BTS1
JMP
B0BTS0
JMP
FP00IEN
INTT0CHK
FP00IRQ
INTP00
INTT0CHK:
INTTC0CHK:
INTADCHK:
; Check T0 interrupt request
; Check T0IEN
; Jump check to next interrupt
; Check T0IRQ
; Jump to T0 interrupt service routine
; Check TC0 interrupt request
; Check TC0IEN
; Jump check to next interrupt
; Check TC0IRQ
; Jump to TC0 interrupt service routine
; Check ADC interrupt request
; Check ADCIEN
; Jump check to next interrupt
; Check ADCIRQ
B0BTS1
JMP
B0BTS0
JMP
FT0IEN
INTTC0CHK
FT0IRQ
INTT0
B0BTS1
JMP
B0BTS0
JMP
FTC0IEN
INTADCHK
FTC0IRQ
INTTC0
B0BTS1
JMP
B0BTS0
JMP
FADCIEN
…
FADCIRQ
INTADC
; Jump to ADC interrupt service routine
…
…
INT_EXIT:
…
; Pop routine to load ACC and PFLAG from buffers.
; Exit interrupt vector
RETI
SONiX TECHNOLOGY CO., LTD
Page 67
Version 2.0