335
A-D Converter
M
i
t
s
u
M
S
b
i
s
3
M
h
0
I
C
i
m
2
R
i
1
O
c
r
8
C
o
c
o
G
M
m
p
r
P
u
t
u
T
e
r
p
R
s
o
U
S
I
N
G
L
E
-
C
H
I
P
1
6
-
B
I
T
C
M
O
O
E
Figure 2.8.8. Set-up procedure of repeat mode
b7
b0
1
Setting A-D conversion start flag
A-D control register 0 [Address 03D6
16
]
ADCON0
A-D conversion start flag
1 : A-D conversion started
Transmitting conversion result to A-D register i
Eight low-order bits of A-D conversion result
b7
b0
(b15)
(b8)
b7
b0
A-D register 0
A-D register 1
A-D register 2
A-D register 3
A-D register 4
A-D register 5
A-D register 6
A-D register 7
[Address 03C1
16
, 03C0
16
]
[Address 03C3
16
, 03C2
16
]
[Address 03C5
16
, 03C4
16
]
[Address 03C7
16
, 03C6
16
]
[Address 03C9
16
, 03C8
16
]
[Address 03CB
16
, 03CA
16
] AD5
[Address 03CD
16
, 03CC
16
] AD6
[Address 03CF
16
, 03CE
16
] AD7
AD0
AD1
AD2
AD3
AD4
During 10-bit mode
Two high-order bits of A-D conversion result
During 8-bit mode
When read, the content is indeterminate
b7
b0
Setting A-D control register 0 and A-D control register 1
A-D control register 0 [Address 03D6
16
]
ADCON0
Analog input pin select bit (Note)
b2 b1 b0
0 0 0 : AN
0
is selected
0 0 1 : AN
1
is selected
0 1 0 : AN
2
is selected
0 1 1 : AN
3
is selected
1 0 0 : AN
4
is selected
1 0 1 : AN
5
is selected
1 1 0 : AN
6
is selected
1 1 1 : AN
7
is selected
b7
0
b0
A-D control register 1 [Address 03D7
16
]
ADCON1
A-D operation mode select bit 1 (Note)
0 (Must always be “0” in repeat mode)
8/10-bit mode select bit
0 : 8-bit mode
1 : 10-bit mode
Frequency select bit 1
0 : f
AD
/2 or f
AD
/4 is selected
1 : f
AD
is selected
Repeat mode is selected (Note)
A-D conversion start flag
0 : A-D conversion disabled
Frequency select bit 0
0 : f
AD
/4 is selected
1 : f
AD
/2 is selected
0
0
0
1
Invalid in Repeat mode
Vref connect bit
1 : Vref connected
Nothing is arranged for these bits.
Fix “0” to these bits
0
0
1
Nothing is arranged for this bit.
Fix “0” to this bit.
Start A-D conversion
b7
b0
0
Setting A-D conversion start flag
A-D control register 0 [Address 03D6
16
]
ADCON0
A-D conversion start flag
0 : A-D conversion disabled
Stop A-D conversion
b7
b0
1
Selecting Sample and hold
A-D control register 2 [Address 03D4
16
]
ADCON2
A-D conversion method select bit
1 : With sample and hold
Note: Rewrite to analog input pin select bit after changing A-D operation mode.