The ADC0831 is an 8 pin, single channel serial ADC which gives 8-bit data output. The input can be either single ended or differential type. Using the differential input option, A/D conversion can be performed for two different voltage levels. The function of each pin is described in the following table:
Fig. 2: Pin Name and Fuctions of serialADC0831
1. (Chip Select) – In order to initiate conversion a high-to-low is provided on.
2. Vin (+) (Positive Analog Input) – Positive voltage is applied at this pin. The input range for this is 0 to 5votls.
3. Vin (-) (Negative Analog input) – Negative voltage is applied at this pin.
4. GND (Ground) – This pin is connected to the ground of circuit.
5. Vref (Reference Voltage) – This pin is used to set the input voltage range of ADC.
6. CLK (Clock) – Clock pulse is provided on CLK pin for synchronization.
7. DO (Data Output) – This pin is an output pin of ADC, serial output data is available on this pin.
8. Vcc (Power Supply) – This is connected to +5 volt power supply.
How serial ADC works:
Fig. 3: Block Diagram of Serial ADC Working with AVR
The above diagram shows a system in which the ADC device receives analog data from transducer. The controller is used to control ADC IC and to process the converted digital data. The analog signal is given at pin Vin(+). In differential mode, voltage at pin Vin(+) must be greater than Vin(-) otherwise output data will not be generated by the ADC. The data conversion is started by giving high to low pulse at the CS pin. At the first clock cycle, the ADC sends ‘0’ bit to the controller which shows the following bits are the data bits. The MSB of converted data is sent first. The timing diagram of ADC0831 is shown below.
Fig. 4: Timing Diagram of ADC0831 for serial communication in AVR
Objective: To convert analog output voltage of variable resistor into digital signals using ADC0831 and display it on LCD.
The connection of ADC0831 with ATmega16 is shown in the circuit diagram. The output of variable resistor is connected to Vin(+) and Vin(-) pin is grounded. The Pins CS, CLK and DO of ADC are connected to microcontroller.
1. Send a high to low pulse to CS pin to initialize conversion.
2. Monitor the status of D0 bit until it goes low.
3. Send a clock pulse.
4. Receive the data bits from DO pin of ADC 0831.
5. Store the data bits in a variable by using bitwise operation.
6. When the data byte is received from serial ADC, display it on LCD.