Documente Academic
Documente Profesional
Documente Cultură
ADC0808 which is an 8-bit resolution ADC has eight analog input pins to take inputs. The circuit uses
a preset for providing the analog input. The clock for driving the ADC0808 is taken from the crystal of the .
The controller AT89C51 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 by
employing 74LS74
. 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 output pins of the ADC are connected to the port P0 of the microcontroller. Pins ALE, OE, SC and
EOC (pins 22, 9, 6 & 7 respectively) are connected to pins P1^0, P1^3, P1^1 & P1^2 of the
microcontroller AT89C51
, respectively. Selector pins A, B and C (pins 25, 24, 23) of the ADC are connected to P2^4,
P2^5 & P2^6 pins of controller.
The output from the ADC comes on port P0 and is stored into the SBUF register. This data is
then transmitted serially to the serial port of the PC using the serial transmitter pin TxD
(pin11) of the controller.
Hyper-terminal shows character corresponding to the ASCII values 0-255. (Refer serial port interfacing
with AT89C51
// Program to read 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
void main()
{
eoc=1;
input_port=0xFF;
ale=0;
oe=0;
sc=0;
TMOD=0x20;