English
Language : 

AVR401 Datasheet, PDF (1/12 Pages) ATMEL Corporation – 8-bit Precision A/D Converter
AVR401: 8-bit Precision A/D Converter
Features
• Very Low Cost
• High Precision
• Auto-calibration Eliminates Component Inaccuracy
• Measures Voltages for 0 to VCC
• Maximum Conversion Time: 1.1 ms
Introduction
This application note describes how to perform a kind of dual slope A/D conversion
with an AVR microcontroller. The converter is very low cost, requiring only six discrete
components in addition to the AVR. Five of the controller pins are used (see Figure 1).
This example is based on the AT90S1200 device, but any AVR device with a compar-
ator can be used.
Figure 1. A/D Converter
VCC
T
C
RB
PB7
(AIN0) PB0
(AIN1) PB1
PB2
AT90S1200
Vin
Rin
Rref 1
(Vref)
Rref 2
PB3
8-bit
Microcontroller
Application
Note
Theory of Operation
The capacitor is charged with a constant current supplied by the transistor. The
capacitor voltage will rise linearly. To discharge the capacitor, the AIN0-pin is set to
output with a “0” applied. A reference voltage at VCC/2 is supplied by the resistor net-
work Rref1 and Rref2. When the PB1 and PB2-pins are configured as inputs, the
reference is turned off, and the voltage level at the AIN1-pin will be the input voltage
Vin. By setting the pins as outputs and applying a “0” and a “1”, the level at the AIN1-
pin will be VCC/2 (if the resistors are of equal size). The input resistor Rin have to be at
least 100 times higher than the reference resistors Rref1 and Rref2 to avoid measure-
ment errors.
Rev. 0953C–AVR–02/03
1