
17. A/D Converter
Figure 17.2
AD0CON0 Register
b7 b6 b5 b4
b1
b2
b3
Symbol
AD0CON0
Address
0396h
After Reset
00h
b0
Function
Bit Symbol
Bit Name
RW
TRG
CKS0
A/D operating mode
select bits 0(2, 6)
Frequency select bit
RW
MD1
RW
MD0
Trigger select bit
A/D conversion start flag
ADST
A/D0 Control Register 0(1)
CH1
RW
CH2
b2 b1 b0
0 0 0: ANi_0
0 0 1: ANi_1
0 1 0: ANi_2
0 1 1: ANi_3
1 0 0: ANi_4
1 0 1: ANi_5
1 1 0: ANi_6
1 1 1: ANi_7 (i = none, 0, 2, 15)
Analog input pin
select bits(2, 3)
CH0
RW
b4 b3
0 0: One-shot mode
0 1: Repeat mode
1 0: Single sweep mode
1 1: Repeat sweep mode 0, repeat sweep mode 1
0: Software trigger
1: External trigger, hardware trigger(4)
0: A/D conversion stops
1: A/D conversion starts(4)
(Note 5)
NOTES:
1. If the AD0CON0 register is rewritten during A/D conversion, the conversion result will be incorrect.
2. Analog input pins must be configured again after an A/D operating mode is changed.
3. Bits CH2 to CH0 are enabled in one-shot mode and repeat mode.
4. When external trigger or hardware trigger is used, select a trigger source first by setting the TRG0 bit in the AD0CON2 register,
set the TRG bit to 1, and then set the ADST bit to 1.
5.
φAD frequency must be 16 MHz or lower when VCC = 4.2 to 5.5 V.
φAD frequency must be 10 MHz or lower when VCC = 3.0 to 5.5 V.
φAD is selected by the combination of the CKS0 bit, the CKS1 in the AD0CON1 register, and the CKS2 bit in the AD0CON3
register.
CKS2 bit
in AD0CON3 register
CKS0 bit
in AD0CON0 register
φAD
CKS1 bit
in AD0CON1 register
0
fAD divided by 4
0
1
0
1
0
1
0
fAD divided by 3
fAD divided by 2
fAD
fAD divided by 8
fAD divided by 6
6. When the MSS bit in the AD0CON3 register is set to 1 (multi-port sweep mode enabled), set bits MD1 and MD0 to 10b (multi-
port single sweep mode) or 11b (multi-port repeat sweep mode 0).