Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

8051

Interfacing of ADC 0808


Introduction
• Analog to Digital Converters(ADC) are used to translate analog signals
to digital numbers so that the microcontroller can read and process
them.
• An ADC has n-bit resolution, where n can be 8, 10, 12, 16, up to 24bits.
Higher the resolution ADC provides a smaller step size, where step size
is the smallest change that can be detected by an ADC
• Conversion time is the major factor in judging an ADC. Conversion time
is defined as the time it takes the ADC to convert an analog input to a
digital(binary) number.
• ADC chips mainly two types
1. Parallel (0808) – 8 or more pins dedicated to bringing out the binary
data
2. Serial – Only one pin for data out.
2
ADC 0808 chip

• ADC 0808 consist of 8 analog channels, allows to monitor up to 8


different analog inputs.
• 8 analog inputs are multiplexed and selected by using three address
pins, A, B, and C.
• It has 8-bit data outputs.
3
Pin Configuration
• Vref (+) & Vref (-)
– Set the reference voltage, If the Vref (+) = 5V and Vref (-) = Gnd,
the step size is 5V/256 = 19.53mV

• IN0 – IN7
– 8 input channels

4
Pin Configuration
• ALE & A, B, C address lines
– A, B, and C address lines used to select IN0 to IN7 channels, and
activate ALE to latch
Analog Channel Selection

• SC (WR) --- Start Conversion


• EOC --- End-of-Conversion
• OE (RD) --- Output Enable 5
Steps to program the ADC 0808
1. Select the analog channel by providing bits to A, B, and C

2. Activate the ALE pin. It needs a L-to- H pulse to latch the address

3. Activate SC (Start Conversion) by L-to-H pulse to initiate conversion

4. Monitor EOC (end of conversion) to see whether conversion is finished.


H-to-L output indicates that the data is converted and ready to pickup.

5. Activate OE (output enable) to read data out of the ADC chip. A L-to-H
pulse to the OE pin will bring digital data out of the chip

Note: - In ADC 0808, there is no self clocking and clock must be provided from
an external source. Also the conversion frequency is less compared to 8051
clock frequency
6
Timing Diagram

7
Interfacing of ADC 0808

8
Program:
ORG 0000H Connections:-
MOV P1, #0FFH ; make P1 as input port Address A  pin p2.0
SETB P2.7 ; make EOC as input port
CLR P2.4 ; clear ALE
Address B  pin p2.1
CLR P2.5 ; clear OE Address C  pin p2.2
CLR P2.6 ; clear SC ALE  pin p2.4
Back: SETB P2.0 ;A=1 OE  pin p2.5
CLR P2.1 ;B=0
CLR P2.2 ; C = 0 (select channel 1)
SC  pin p2.6
ACALL delay ; make sure the address is stable EOC  pin p2.7
SETB P2.4 ; Latch address D0 – D7  Port 1 (P1)
ACALL delay ; delay for fast ALE
SETB P2.6 ; Start conversion
ACALL delay
CLR P2.4
CLR SC
Here: JB P2.7, Here ; wait until done
Here1: JNB P2.7, Here1 ; wait until done
SETB P2.5 ; enable OE (RD)
ACALL delay ; wait
MOV A, P1 ; read data
CLR P2.5 ; clear OE for next data
ACALL Data_display ; display the data
SJMP Back
9

You might also like