SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 114
Version 2.0
ADC CONVERTING OPERATION:
; ADC Interrupt disable mode.
@@:
B0BTS1
FEOC
; Check ADC processing flag.
JMP
@B
; EOC=0: ADC is processing.
B0MOV
A, ADB
; EOC=1: End of ADC processing. Process ADC result.
B0MOV
BUF1,A
MOV
A, #00001111b
AND
A, ADR
B0MOV
BUF2,A
…
; End of processing ADC result.
CLR
FEOC
; Clear ADC processing flag for next ADC converting.
; ADC Interrupt enable mode.
ORG 8
; Interrupt vector.
INT_SR:
; Interrupt service routine.
PUSH
B0BTS1
FADCIRQ
; Check ADC interrupt flag.
JMP
EXIT_INT
; ADCIRQ=0: Not ADC interrupt request.
B0MOV
A, ADB
; ADCIRQ=1: End of ADC processing. Process ADC result.
B0MOV
BUF1,A
MOV
A, #00001111b
AND
A, ADR
B0MOV
BUF2,A
…
; End of processing ADC result.
CLR
FEOC
; Clear ADC processing flag for next ADC converting.
JMP
INT_EXIT
INT_EXIT:
POP
RETI
; Exit interrupt service routine.
Note: ADS is cleared when the end of ADC converting automatically. EOC bit indicates ADC processing
status immediately and is cleared when ADS = 1. Users needn
’t to clear ADS bit by program.