SN8P2714X_2715
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 99
V1.4
11.6 ADC CONVERTING TIME
12-bit ADC conversion time = 1/(ADC clock / 4 )*16 sec
High Clock (Fosc) =
4MHz
Fcpu
ADCKS1 ADCKS0 ADC Clock
ADC Converting Time
0 0
Fcpu/16
1/( ( 4MHz /
1
) / 16 /4
)
x16=
256
us
0 1
Fcpu/8
1/( ( 4MHz /
1
) /
8
/4
)
x16=
128
us
1 0
Fcpu
1/( ( 4MHz /
1
) /
1
/4
)
x16=
16
us
Fosc/ 1
1 1
Fcpu/2
1/( ( 4MHz /
1
) /
2
/4
)
x16=
32
us
0 0
Fcpu/16
1/( ( 4MHz /
2
) / 16 /4
)
x16=
512
us
0 1
Fcpu/8
1/( ( 4MHz /
2
) /
8
/4
)
x16=
256
us
1 0
Fcpu
1/( ( 4MHz /
2
) /
1
/4
)
x16=
32
us
Fosc/ 2
1 1
Fcpu/2
1/( ( 4MHz /
2
) /
2
/4
)
x16=
64
us
0 0
Fcpu/16
1/( ( 4MHz /
4
) / 16 /4
)
x16=
1024 us
0 1
Fcpu/8
1/( ( 4MHz /
4
) /
8
/4
)
x16=
512
us
1 0
Fcpu
1/( ( 4MHz /
4
) /
1
/4
)
x16=
64
us
Fosc/ 4
1 1
Fcpu/2
1/( ( 4MHz /
4
) /
2
/4
)
x16=
128
us
0 0
Fcpu/16
1/( ( 4MHz /
8
) / 16 /4
)
x16=
2048 us
0 1
Fcpu/8
1/( ( 4MHz /
8
) /
8
/4
)
x16=
1024 us
1 0
Fcpu
1/( ( 4MHz /
8
) /
1
/4
)
x16=
128
us
Fosc/ 8
1 1
Fcpu/2
1/( ( 4MHz /
8
) /
2
/4
)
x16=
256
us
¾
Note: ADC function can work in slow mode also. In slow mode, the Fcpu = LXOSC / 4 (LXOSC is internal
low RC oscillator).
¾
Note: Because the frequency of LXOSC (internal low RC oscillator) will vary with different temperature
and VDD, so ADC converting time will be effected.
Â
Example : Configure AIN0 as 12-bit ADC input and start ADC conversion then enter power down mode.
ADC0:
B0BSET
FADENB
; Enable ADC circuit
CALL
Delay100uS
; Delay 100uS to wait ADC circuit ready for conversion
MOV
A,
#0FEh
B0MOV
P4UR, A
; Disable P4.0 pull-up resistor
B0BCLR
FP40M
; Set P4.0 as input pin
MOV
A,
#01h
B0MOV
P4CON, A
; Set P4.0 as pure analog input
MOV
A,
#40H
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 bit11 ~ bit4
B0MOV
Adc_Buf_Hi,
A
B0MOV
A,ADR
; To get AIN0 input data bit3 ~ bit0
AND
A,
0Fh
B0MOV
Adc_Buf_Low,
A
Power_Down .
.
B0BCLR
FADENB
; Disable ADC circuit
B0BSET
FCPUM0
; Enter sleep mode