SN8P2501D
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 59 Version 1.5
6.8 TC0 INTERRUPT OPERATION
When the TC0C counter overflows, the TC0IRQ will be set to “1” no matter the TC0IEN is enable or disable. If the
TC0IEN and the trigger event TC0IRQ is set to be “1”. As the result, the system will execute the interrupt vector. If the
TC0IEN = 0, the trigger event TC0IRQ is still set to be “1”. Moreover, the system won’t execute interrupt vector even
when the TC0IEN is set to be “1”. Users need to be cautious with the operation under multi-interrupt situation.
Example: TC0 interrupt request setup. Fcpu = 16MHz / 16.
; Disable TC0 interrupt service
; Set TC0 clock = Fcpu / 64
; Set TC0C initial value = 64H
; Set TC0 interval = 10 ms
; Enable TC0 interrupt service
; Clear TC0 interrupt request flag
Example: TC0 interrupt service routine.
; Push routine to save ACC and PFLAG to buffers.
; TC0IRQ = 0, exit interrupt vector
; TC0 interrupt service routine
; Pop routine to load ACC and PFLAG from buffers.
Note: We strongly recommend to clear TC0IRQ must be used b0bclr or bclr instructions.