R01UH0092EJ0110 Rev.1.10
Page 623 of 807
Jul 31, 2012
M16C/64C Group
27. A/D Converter
27.2.5
A/D Control Register 0 (ADCON0)
If the ADCON0 register is rewritten during A/D conversion, the conversion result is undefined.
CH2-CH0 (Analog input pin select bit) (b2-b0)
In one-shot and repeat modes, pins AN0_0 to AN0_7 and AN2_0 to AN2_7 can be used in the same
way as pins AN0 to AN7. Use bits ADGSEL1 to ADGSEL0 in the ADCON2 register to select the desired
group. These bits are disabled in single sweep mode, repeat sweep mode 0, and repeat sweep mode
1.
MD1-MD0 (A/D operation mode select bit 0) (b4-b3)
A/D operation mode is selected by a combination of bits MD1 to MD0 and the MD2 bit in the ADCON1
register. Table 27.5 lists A/D Operation Mode.
Table 27.5
A/D Operation Mode
Bit Setting
A/D Operation Mode
ADCON0 register
MD2
MD1
MD0
0
0
0
One-shot mode
0
0
1
Repeat mode
0
1
0
Single sweep mode
0
1
1
Repeat sweep mode 0
1
1
1
Repeat sweep mode 1
Only set the combinations listed above.
b7 b6 b5 b4
b1
b2
b3
Symbol
ADCON0
Address
03D6h
Reset Value
0000 0XXXb
b0
Function
Bit Symbol
Bit Name
RW
A/D Control Register 0
TRG
0 : Software trigger
1 : ADTRG trigger
Trigger select bit
RW
In one-shot mode or repeat mode
b2 b1 b0
0 0 0 : AN0
0 0 1 : AN1
0 1 0 : AN2
0 1 1 : AN3
1 0 0 : AN4
1 0 1 : AN5
1 1 0 : AN6
1 1 1 : AN7
Analog input pin select bit
ADST
0 : A/D conversion stop
1 : A/D conversion start
A/D conversion start flag
RW
CKS0
Refer to the description of the CKS0 bit.
Frequency select bit 0
RW
MD0
RW
RW
b4 b3
0 0 : One-shot mode
0 1 : Repeat mode
1 0 : Single sweep mode
1 1 : Repeat sweep mode 0
A/D operation mode select
bit 0
MD1
CH0
CH1
CH2
RW
RW
RW
or repeat sweep mode 1
Содержание M16C Series
Страница 846: ...M16C 64C Group R01UH0092EJ0110...