ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 02.06.2025
Просмотров: 3602
Скачиваний: 0
ATmega8(L)
Table 74. Voltage Reference Selections for ADC
REFS1 |
REFS0 |
Voltage Reference Selection |
0 |
0 |
AREF, Internal Vref turned off |
0 |
1 |
AVCC with external capacitor at AREF pin |
1 |
0 |
Reserved |
1 |
1 |
Internal 2.56V Voltage Reference with external capacitor at AREF pin |
•Bit 5 – ADLAR: ADC Left Adjust Result
The ADLAR bit affects the presentation of the ADC conversion result in the ADC Data Register. Write one to ADLAR to left adjust the result. Otherwise, the result is right adjusted. Changing the ADLAR bit will affect the ADC Data Register immediately, regardless of any ongoing conversions. For a complete description of this bit, see “The ADC Data Register – ADCL and ADCH” on page 205.
• Bits 3:0 – MUX3:0: Analog Channel Selection Bits
The value of these bits selects which analog inputs are connected to the ADC. See Table 75 for details. If these bits are changed during a conversion, the change will not go in effect until this conversion is complete (ADIF in ADCSRA is set).
Table 75. Input Channel Selections
MUX3..0 |
Single Ended Input |
0000 |
ADC0 |
0001 |
ADC1 |
0010 |
ADC2 |
0011 |
ADC3 |
0100 |
ADC4 |
0101 |
ADC5 |
0110 |
ADC6 |
0111 |
ADC7 |
1000 |
|
1001 |
|
1010 |
|
1011 |
|
1100 |
|
1101 |
|
1110 |
1.23V (VBG) |
1111 |
0V (GND) |
203
2486O–AVR–10/04
ATmega8(L)
• Bits 2:0 – ADPS2:0: ADC Prescaler Select Bits
These bits determine the division factor between the XTAL frequency and the input clock to the ADC.
Table 76. ADC Prescaler Selections
ADPS2 |
ADPS1 |
ADPS0 |
Division Factor |
0 |
0 |
0 |
2 |
0 |
0 |
1 |
2 |
0 |
1 |
0 |
4 |
0 |
1 |
1 |
8 |
1 |
0 |
0 |
16 |
1 |
0 |
1 |
32 |
1 |
1 |
0 |
64 |
1 |
1 |
1 |
128 |
The ADC Data Register – ADCL and ADCH
ADLAR = 0
ADLAR = 1
Bit |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
|
– |
– |
– |
– |
– |
– |
ADC9 |
ADC8 |
ADCH |
|
ADC7 |
ADC6 |
ADC5 |
ADC4 |
ADC3 |
ADC2 |
ADC1 |
ADC0 |
ADCL |
|
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
||
Read/Write |
R |
R |
R |
R |
R |
R |
R |
R |
|
R |
R |
R |
R |
R |
R |
R |
R |
||
Initial Value |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
||
Bit |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
|
ADCH |
|||||||||
ADC9 |
ADC8 |
ADC7 |
ADC6 |
ADC5 |
ADC4 |
ADC3 |
ADC2 |
||
ADC1 |
ADC0 |
– |
– |
– |
– |
– |
– |
ADCL |
|
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
||
Read/Write |
R |
R |
R |
R |
R |
R |
R |
R |
|
R |
R |
R |
R |
R |
R |
R |
R |
||
Initial Value |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
When an ADC conversion is complete, the result is found in these two registers.
When ADCL is read, the ADC Data Register is not updated until ADCH is read. Consequently, if the result is left adjusted and no more than 8-bit precision is required, it is sufficient to read ADCH. Otherwise, ADCL must be read first, then ADCH.
The ADLAR bit in ADMUX, and the MUXn bits in ADMUX affect the way the result is read from the registers. If ADLAR is set, the result is left adjusted. If ADLAR is cleared (default), the result is right adjusted.
• ADC9:0: ADC Conversion result
These bits represent the result from the conversion, as detailed in “ADC Conversion
Result” on page 202.
205
2486O–AVR–10/04