SN8P275X Series
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 16
Version 0.7
2.1.1.1
RESET VECTOR (0000H)
A one-word vector address area is used to execute system reset.
)
Power On Reset (NT0=1, NPD=0).
)
Watchdog Reset (NT0=0, NPD=0).
)
External Reset (NT0=1, NPD=1).
After power on reset, external reset or watchdog timer overflow reset, then the chip will restart the program from
address 0000h and all system registers will be set as default values. It is easy to know reset status from NT0, NPD
flags of PFLAG register. The following example shows the way to define the reset vector in the program memory.
¾
Example: Defining Reset Vector
ORG 0
;
0000H
JMP
START
; Jump to user program address.
…
ORG 10H
START:
; 0010H, The head of user program.
…
; User program
…
ENDP
; End of program
2.1.1.2
INTERRUPT VECTOR (0008H)
A 1-word vector address area is used to execute interrupt request. If any interrupt service executes, the program
counter (PC) value is stored in stack buffer and jump to 0008h of program memory to execute the vectored interrupt.
Users have to define the interrupt vector. The following example shows the way to define the interrupt vector in the
program memory.
Note: ”PUSH”, “POP” instructions save and load ACC/PFLAG without (NT0, NPD). PUSH/POP buffer is a
unique buffer and only one level.
¾
Example: Defining Interrupt Vector. The interrupt service routine is following ORG 8.
.CODE
ORG 0
;
0000H
JMP
START
; Jump to user program address.
…
ORG
8
; Interrupt vector.
PUSH
; Save ACC and PFLAG register to buffers.
…
…
POP
; Load ACC and PFLAG register from buffers.
RETI
; End of interrupt service routine
…