Skip to main content

ADC at 80H with 8255A: display on port B LEDs

Short answer

8255 I/O mapped at 80H: PA=80H, PB=81H, PC=82H, control=83H. Control word 91H sets PA input, PB output, PC upper out, PC lower in. PC4 starts ADC via WR', PC5 reads data via RD', PC0 senses EOC. Program loops: pulse start, wait for EOC low, read ADC to PA, output to PB LEDs.

A/D converter requires signal to start the conversion and indicates with the end of conversion signal. 8255A PPI is interfaced with 8085 microprocessors at 80H. Microprocessor reads 8-bits O/P data of the ADC at port A and display the same data to eight LED's connected at port B of 8255A. State any assumptions made. (a) Identify the address captured by the card (b) Determine the necessary control words (c) Draw the schematic interfacing circuit (d) Write a program to perform the operation

Assumptions

ADC0804 (8-bit): start conversion with a low-to-high edge at WR' (CS' grounded), end of conversion indicated by INTR' going low, data read by making RD' low. 8255 I/O mapped at 80H. Port A reads the ADC, port B drives 8 LEDs through a buffer, port C handles control: PC4 -> WR' (start), PC5 -> RD' (output enable), PC0 <- INTR' (EOC).

(a) Addresses

Base 80H: Port A = 80H, Port B = 81H, Port C = 82H, Control = 83H.

(b) Control word

Port A input (D4 = 1), Port B output (D1 = 0), Port C upper output (D3 = 0), lower input (D0 = 1), mode 0, D7 = 1: 1001 0001 = 91H.

(c) Schematic

 8085 -- AD0-AD7, IOR', IOW', RESET, A0,A1, CS' (A7=1 decode) -- 8255
 8255 PA0-PA7 <---------- D0-D7 of ADC0804
 8255 PC4 ---------------> WR'  (start)
 8255 PC5 ---------------> RD'  (output enable)
 8255 PC0 <--------------- INTR' (end of conversion)
 8255 PB0-PB7 ----> 74LS244 ----[330 ohm]---> 8 LEDs ---> GND (bit = 1 lights the LED)
 ADC0804: VIN+ <- analog input, CS' = GND, CLK R and C network

(d) Program

        MVI A,91H
        OUT 83H         ; initialise 8255
        MVI A,30H       ; WR' = 1, RD' = 1 (idle)
        OUT 82H
LOOP:   MVI A,20H       ; WR' = 0
        OUT 82H
        MVI A,30H       ; WR' = 1 (rising edge starts conversion)
        OUT 82H
WAIT:   IN 82H
        ANI 01H         ; INTR' (EOC) low when finished
        JNZ WAIT
        MVI A,10H       ; RD' = 0 (enable ADC output)
        OUT 82H
        IN 80H          ; read digital value
        OUT 81H         ; display on LEDs
        MVI A,30H
        OUT 82H         ; RD' = 1
        JMP LOOP

The LEDs show the digital output continuously. The 74LS244 buffer supplies the LED current, because an 8255 pin can supply only a very small current.

✓ Answer checked by Claude Sonnet 5.5

All Instrumentation II chapter 2 questions →