Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

How to interface ADC0808 with 8051 microcontroller (AT89C51) using clock from D-flip flop- (Part 28/45)

By Himanshu Choudhary August 4, 2010

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 with 8051 microcontroller (AT89C51). The output is taken on the LEDs. This is an intermediate circuit, which finds lot of applications. ADC0808 needs an external clock to run. The circuit describes how a D-flip flop can be used to provide the external clock.

 


 

 

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 the 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. In parallel ADC we have 8 or more pins dedicated to bringing out the binary data. ADC0808 is a parallel ADC with 8-bit resolution.
 
ADC0808 has 8 input channels i.e., it can take eight analog signals. To select these input pins three select pins are available. In this circuit the controller sends the control and enabling signal to ADC.
 
The circuit takes only one input pin of ADC, IN1 (pin27). ALE (pin22) of ADC is connected to P1.0 of the microcontroller AT89C51. Selector pins A, B, C (pins 25, 24 & 23) of ADC are connected to P1.4, P1.5, and P1.6 pins of controller, AT89C51 respectively. SC (pin6) of controller is connected to P1.1 of microcontroller. EOC (pin7) of ADC is connected to P1.2 of controller. OE (pin 9) of ADC is connected to P1.3 of controller. Output of ADC goes to port P0 (pins 32-39) of controller. (Also see interfacing ADC0808 using clock from AT89C51).
 
The clock for driving the ADC0808 is taken from the crystal of the microcontroller AT89C51. The controller uses a crystal of frequency 11.0592 MHz. As this frequency is too high for the ADC, it is divided using a D flip-flop and then given to the ADC0808. The circuit uses four D-flip flops to divide the frequency by 16. For D flip-flop, IC 74LS74 is used. It is a 14 pin IC with two internal D flip flops. The circuit uses two ICs to divide the frequency by 16. The circuit diagram shows the connection of the D flip-flop ICs.
 
 
The program continuously reads the input of ADC on the port P0 and outputs the same value on the port P2. LEDs are connected on the port P2 to display the output.

 

Project Source Code

###


// Program to test ADC 0808. The output pins are connected to LED's. external clock is used for driving the ADC 0808.
#include<reg51.h>
sbit ale=P1^0;  //address latch enable
sbit oe=P1^3;  //output enable
sbit sc=P1^1;  //start conversion
sbit eoc=P1^2;  //end of conversion
sbit ADD_A=P1^4;  // Address pins for selecting input channels.
sbit ADD_B=P1^5;
sbit ADD_C=P1^6;
sfr input_port=0x80;
sfr output_port=0xA0;

void delay(unsigned int count)  // Function to provide time delay in msec.
{
int i,j;
for(i=0;i<count;i++)
  for(j=0;j<1275;j++);
}

void main()
{
eoc=1;
input_port=0xFF;
ale=0;
oe=0;
sc=0;
while(1)
{
  ADD_C=0;  // Selecting input channel 2 using address lines
  ADD_B=0;
  ADD_A=1;
  delay(2);
  ale=1;
  delay(2);
  sc=1;
  delay(1);
  ale=0;
  delay(1);
  sc=0;
  while(eoc==1);
  while(eoc==0);
  oe=1;
  output_port=input_port;
  delay(2);
  oe=0;
}
}

###

 


Circuit Diagrams

How-to-interface-ADC0808-with-8051-microcontroller-AT89C51-using-clock-from-D-flip-flop

Project Components

  • AT89C51 Microcontroller
  • IC 74LS47
  • IC ADC0808
  • LED

Project Video


Filed Under: 8051 Microcontroller
Tagged With: 8051, adc, clock, d flip flop, microcontroller
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Thermal modelling of repetitive power pulse
  • Redundant XORs
  • No Output Voltage from Voltage Doubler Circuit in Ansys Nexxim (Harmonic Balance Simulation)
  • Discrete IrDA receiver circuit
  • ISL8117 buck converter blowing up

RSS Electro-Tech-Online.com Discussions

  • using a RTC in SF basic
  • Can I make two inputs from one??
  • Help with finding unique wire lug(s)
  • Simple LED Analog Clock Idea
  • Kawai KDP 80 Electronic Piano Dead

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe