SN8P2501D
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 56 Version 1.5
6.6 EXTERNAL INTERRUPT OPERATION (INT0)
INT0 is external interrupt trigger source and builds in edge trigger configuration function. When the external edge
trigger occurs, the external interrupt request flag will be set to “1” no matter the external interrupt control bit enabled or
disable. When external interrupt control bit is enabled and external interrupt edge trigger is occurring, the program
counter will jump to the interrupt vector (ORG 8) and execute interrupt service routine.
The external interrupt builds in wake-up latch function. That means when the system is triggered wake-up from power
down mode, the wake-up source is external interrupt source (P0.0), and the trigger edge direction matches interrupt
edge configuration, the trigger edge will be latched, and the system executes interrupt service routine fist after
wake-up.
Bit[4:3] P00G[1:0]: P0.0 interrupt trigger edge control bits.
00 = reserved.
01 = rising edge.
10 = falling edge.
11 = rising/falling bi-direction (Level change trigger).
Example: Setup INT0 interrupt request and bi-direction edge trigger.
; Set INT0 interrupt trigger as bi-direction edge.
; Enable INT0 interrupt service
; Clear INT0 interrupt request flag
Example: INT0 interrupt service routine.
; Push routine to save ACC and PFLAG to buffers.
; P00IRQ = 0, exit interrupt vector
; INT0 interrupt service routine
; Pop routine to load ACC and PFLAG from buffers.