SN8P1700
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 168
Revision 1.93
ADC CONVERTING TIME
12-bit ADC conversion time = 1/(ADC clock /4)*16 sec
8-bit ADC conversion time = 1/(ADC clock /4)*12 sec
High clock (fosc) is @3.58MHz
ADLEN
ADCKS0
ADC Clock
ADC conversion time
0
fosc/16
1/(3.58MHz/16/4)*12 = 214.5 us
0 (8-bit)
1
fosc
1/(3.58MHz/4)*12 = 13.4 us
0
fosc/16
1/(3.58MHz/16/4)*16 = 286 us
1 (12-bit)
1
fosc
1/(3.58MHz/4)*16 = 17.9 us
Example : To set AIN0 ~ AIN1 for ADC input and executing 12-bit ADC
ADC0:
MOV
A,
#60H
B0MOV
ADR, A
; To set 12-bit ADC and ADC clock = Fosc.
MOV
A,#90H
B0MOV
ADM,A
; To enable ADC and set AIN0 input
B0BSET
FADS
; To start conversion
WADC0:
B0BTS1
FEOC
; To skip, if end of converting =1
JMP
WADC0
; else, jump to WADC0
B0MOV
A,ADB
; To get AIN0 input data
ADC1:
MOV
A,#91H
;
B0MOV
ADM,A
; To enable ADC and set AIN1 input
B0BSET
FADS
; To start conversion
. .
.
QEXADC:
B0BCLR
FGCHS
; To release AINx input channel