Arduino Projects    |   Raspberry Pi  |     Electronic Circuits   |   Electronics Reference Design Library  |   AVR    |    PIC    |    8051    |    Electronic Projects

How to interface ADC0808 using clock from 8051 microcontroller (AT89C51)

Summary

Developed By: 
Himanshu Choudhary

An analog-to-digital converter is a device which converts continuous signals to discrete digital numbers. Typically, an ADC is an electronic device that converts an input analog voltage (or current) to a digital number proportional to the magnitude of the voltage or current. This circuit demonstrates the interfacing of ADC0808 using 8051 microcontroller (AT89C51). The digital output is taken on a set of LEDs. This is an intermediate circuit which finds several applications. This circuit depicts a way to provide the external clock, required for ADC, from the microcontroller.

 

 

Interfacing ADC0808 using clock from 8051 Microcontroller (AT89C51)

Description

Analog-to-digital converters are among the most widely used devices for data acquisition. Digital computers use binary values, but in physical world everything is analog. Therefore, we need an analog-to-digital converter to translate these analog signals to digital signals.

 

An ADC has n-bit resolution where n can be 8,10,12,16 etc. The ADC chips are either parallel or serial. Parallel ADC has 8 or more pins dedicated to bring out the binary data. ADC0808 is such a parallel ADC with 8-bit resolution.
 
ADC0808 has 8 input channels, i.e., it can take eight analog signals. To select these input channels, three select pins are to be configured. In this circuit the microcontroller AT89C51 is used to send the control and enabling signals to ADC.
 
In ADC Vref (+) (pin12) and Vref (-) (pin16) are used to set the reference voltage. If Vref (-) is GND and Vref (+) = 5V, the step size is 5V/256=19.53mV. ADC0808 has 8 input pins IN0-IN7 (pins 1-5 & 26-28). To select an input pin, there are three selector pins A, B and C (pin 25, 24 & 23, respectively). ALE (Address latch enable, pin22) is given a low to high pulse to latch in the address. SC (Start conversion, pin6) instructs the ADC to start the conversion. When a low to high pulse is given to this pin ADC starts converting the data. EOC (end of conversion, pin7) is an output pin and goes low when the conversion is complete and ready to be picked up, and OE(output enable, pin9) is given a low to high pulse to bring the converted data from the internal register of ADC to the output pins. Pin11 is Vcc and pin13 is GND. Here we are using external clock for clock input (pin 10).
 
The connection of the ADC with the microcontroller can be seen on the circuit diagram. ALE (pin22) of ADC is connected to P1.0 of controller AT89C51. Selector pins A, B, C (pins 25, 24 & 23) of ADC are connected to P1.4, P1.5 & P1.6 pins of microcontroller, respectively. SC (pin6) of ADC is connected to P1.1 of controller. EOC (pin7) of ADC is connected to P1.2 of microcontroller and OE (pin9) of ADC is connected to P1.3 of microcontroller. Output of ADC goes to port P0 (pins 32-39) of controller. AT89C51 The output is sent to the port P2 (pins 21-28) of controller which is connected to eight LEDs.
 
The program continuously scans the input of ADC and displays the output on the output port P2. By varying the input of ADC, output of ADC changes and the change is reflected in the glowing pattern of LEDs connected to the port.
 
To provide clock input to the ADC, Timer0 is used in interrupt enabled mode to generate a clock of frequency 500 KHz.  To enable the Timer0 in interrupt enable mode, the register IE is loaded with the value 0x82. (Refer Timer programming with 8051) Every time the Timer completes the counting, pin P1.7 toggles its state.
 

 

 

Circuit Diagram

Video

Code

This Code is only visible to Registered users. Please Login/Register

 

Components

LEDs | Light Emitting Diode
LED
 
Light emitting diodes (LEDs) are semiconductor light sources. The light emitted...
AT89C51 Microcontroller, Atmel 89C51 Controller Image
AT89C51 Microcontroller

AT89C51 is an 8-bit microcontroller and belongs to Atmel's 8051 family. ATMEL 89C51 has 4KB of Flash programmable and erasable read only memory (...

ADC0808 Image
IC ADC0808

ADC0808 is an 8 bit analog to digital converter with eight input analog channels, i.e., it can take eight different analog inputs. The input which is to be converted to digital form can be selected by using three address lines. The voltage reference can be set using the Vref+ and Vr...

Browse 4m+ Electronic Products


 
Pick the right product for your next design project with "Mouser Store". Mouser Electronics brings broadest range of semiconductors and electronic components from over 500 industry leading suppliers. 
 
Mouser specializes in the rapid introduction of new products and technologies for design engineers and buyers that includes semiconductors, interconnects, passives, and electro-mechanical components. Providing the best possible service with the flexibility of not requiring a minimum order and same-day shipping, Mouser has it all.
 
 
 
 
When you need the right part right now, think of Mouser
 
Thank you
Team EG

 

You are here