SN8P1829
8-Bit MCU build-in 12-bit ADC + PGIA + Charge-pump Reg 128 dots LCD driver
SONiX TECHNOLOGY CO., LTD
Page 74
Version 1.0
Example: TC1 interrupt service routine without auto-reload function. (TC1_Counter=8-bit, TC1X8=0)
ORG
8
; Interrupt vector
JMP
INT_SERVICE
INT_SERVICE:
B0XCH
A, ACCBUF
; Store ACC value.
B0MOV
A,
PFLAG
B0MOV
PFLAGBUF,
A
B0BTS1
FTC1IRQ
; Check TC1IRQ
JMP
EXIT_INT
; TC1IRQ = 0, exit interrupt vector
B0BCLR
FTC1IRQ
; Reset TC1IRQ
MOV
A,#74H
; Reload TC1C
B0MOV
TC1C,A
.
.
; TC1 interrupt service routine
. .
JMP
EXIT_INT
; End of TC1 interrupt service routine and exit interrupt
vector
. .
. .
EXIT_INT:
B0MOV
A,
PFLAGBUF
B0MOV
PFLAG,
A
B0XCH
A, ACCBUF
; Restore ACC value.
RETI
; Exit interrupt vector
Example: TC1 interrupt service routine with auto-reload. (TC1_Counter=8-bit, TC1X8=0)
ORG
8
; Interrupt vector
JMP
INT_SERVICE
INT_SERVICE:
B0XCH
A, ACCBUF
; Store ACC value.
B0MOV
A,
PFLAG
B0MOV
PFLAGBUF,
A
B0BTS1
FTC1IRQ
; Check TC1IRQ
JMP
EXIT_INT
; TC1IRQ = 0, exit interrupt vector
B0BCLR
FTC1IRQ
; Reset TC1IRQ
.
.
; TC1 interrupt service routine
. .
JMP
EXIT_INT
; End of TC1 interrupt service routine and exit interrupt
vector
. .
. .
EXIT_INT:
B0MOV
A,
PFLAGBUF
B0MOV
PFLAG,
A
B0XCH
A, ACCBUF
; Restore ACC value.
RETI
; Exit interrupt vector