M16C/62P Group (M16C/62P, M16C/62PT)
18. A/D Converter
Rev.2.41
Jan 10, 2006
Page 239 of 390
REJ09B0185-0241
Figure 18.5
ADCON0 and ADCON1 Registers (One-shot Mode)
A/D Control Register 0
(1)
Symbol
Address
After Reset
ADCON0
03D6h
00000XXXb
Bit Symbol
Bit Name
Function
RW
0 : Softw are trigger
1 : ADTRG
_________
trigger
NOTES :
1.
2.
3.
A/D Operation Mode Select
Bit 0
(3)
b4 b3
0 0 : One-shot mode
CH2
RW
CKS0
RW
RW
TRG
Trigger Select Bit
RW
ADST
RW
CH0
RW
CH1
RW
Analog Input Pin Select Bit
(2, 3)
b2 b1 b0
0 0 0 : AN0 is selected
0 0 1 : AN1 is selected
0 1 0 : AN2 is selected
0 1 1 : AN3 is selected
1 0 0 : AN4 is selected
1 0 1 : AN5 is selected
1 1 0 : AN6 is selected
1 1 1 : AN7 is selected
0
0
b3 b2 b1 b0
b7 b6 b5 b4
If the ADCON0 register is rew ritten during A/D conversion, the conversion result w ill be indeterminate.
After rew riting the MD1 to MD0 bits, set the CH2 to CH0 bits over again using another instruction.
RW
MD1
A/D Conversion Start Flag
MD0
AN0_0 to AN0_7, and AN2_0 to AN2_7 can be used in the same w ay as AN0 to AN7. Use the ADGSEL1 to
ADGSEL0 bits in the ADCON2 register to select the desired pin. How ever, if VCC2 < VCC1, do not use AN0_0 to
AN0_7 and AN2_0 to AN2_7 as analog input pins.
Frequency Select Bit 0
Refer to
NOTE 3 for the ADCON2 Register
0 : A/D conversion disabled
1 : A/D conversion started
A/D Control Register 1
(1)
Symbol
Address
After Reset
ADCON1
03D7h
00h
Symbol
Address
After Reset
RW
NOTES :
1.
2.
OPA1
RW
RW
VCUT
Vref Connect Bit
(2)
RW
OPA0
RW
External Op-Amp Connection
Mode Bit
b7 b6
0 0 : ANEX0 and ANEX1 are not used
0 1 : ANEX0 input is A/D converted
1 0 : ANEX1 input is A/D converted
1 1 : External op-amp connection mode
RW
SCAN1
RW
MD2
RW
A/D Operation Mode Select Bit 1 Set to “0” w hen one-shot mode is selected
A/D Sw eep Pin Select Bit
Invalid in one-shot mode
1
b7 b6 b5 b4
Refer to
NOTE 3 for the ADCON2 Register
b3 b2 b1 b0
0
SCAN0
1 : Vref connected
If the ADCON1 register is rew ritten during A/D conversion, the conversion result w ill be indeterminate.
If the VCUT bit is reset from “0” (Vref unconnected) to “1” (Vref connected), w ait for 1 µs or more before starting
A/D conversion.
RW
CKS1
BITS
8/10-Bit Mode Select Bit
0 : 8-bit mode
1 : 10-bit mode
Frequency Select Bit 1
http://www.xinpian.net
提供单片机解密、IC解密、芯片解密业务
010-62245566 13810019655