SN8P1829
8-Bit MCU build-in 12-bit ADC + PGIA + Charge-pump Reg 128 dots LCD driver
SONiX TECHNOLOGY CO., LTD
Page 118
Version 1.0
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
ADCKS1
ADCKS0
ADC Clock
ADC conversion time
0
0
Fcpu/4
1/((3.58MHz/4)/4/4)*12 = 214.5 us
0
1
Fcpu/2
1/((3.58MHz/4)/2/4)*12 = 107.3 us
1
0
Fhosc
1/(3.58MHz/4)*12 = 13.4 us
0 (8-bit)
1
1
Fhosc/2
1/(3.58MHz/2/4)*12 = 26.8 us
0
0
Fcpu/4
1/((3.58MHz/4)/4/4)*16 = 286 us
0
1
Fcpu/2
1/((3.58MHz/4)/2/4)*16 = 143 us
1
0
Fhosc
1/(3.58MHz/4)*16 = 17.9 us
1 (12-bit)
1
1
Fhosc/2
1/(3.58MHz/2/4)*16 = 35.8 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.
B0SET
FP4CON1
;Isolate AIN1 signal to avoid current leakage
B0CLR
FP4CON0
;Pass AIN0 signal into ADC
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:
B0SET
FP4CON0
;Isolate AIN0 signal to avoid current leakage
B0CLR
FP4CON1
;Pass AIN1 signal into ADC
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