76
ATmega103(L)
0945G–09/01
• Bit 4 – ADIF: ADC Interrupt Flag
This bit is set (one) when an ADC conversion is complete and the result is written to the
ADC Data registers are updated. The ADC Conversion Complete interrupt is executed if
the ADIE bit and the I-bit in SREG are set (one). ADIF is cleared by hardware when exe-
cuting the corresponding interrupt handling vector. Alternatively, ADIF is cleared by
writing a logical “1” to the flag. Beware that if doing a read-modify-write on ADCSR, a
pending interrupt can be disabled. This also applies if the SBI and CBI instructions are
used.
• Bit 3 – ADIE: ADC Interrupt Enable
When this bit is set (one) and the I-bit in SREG is set (one), the ADC Conversion Com-
plete interrupt is activated.
• Bits 2..0 – ADPS2..ADPS0: ADC Prescaler Select Bits
These bits determine the division factor between the XTAL frequency and the input
clock to the ADC.
ADC Data Register – ADCL
and ADCH
When an ADC conversion is complete, the result is found in these two registers. It is
essential that both registers are read and that ADCL is read before ADCH.
Table 27.
ADC Prescaler Selections
ADPS2
ADPS1
ADPS0
Division Factor
0
0
0
Invalid
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
Bit
15
14
13
12
11
10
9
8
$05 ($25)
–
–
–
–
–
–
ADC9
ADC8
ADCH
$04 ($24)
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