Professional Documents
Culture Documents
Attachment
Attachment
• 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
2. Activate the ALE pin. It needs a L-to- H pulse to latch the address
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