Interfacing seven segment display to 8085

Azodo izuchukwu
3 min readAug 28, 2021

--

This article is all about how to interface(connect) a seven segment display to 8085 to display alphabet, number, signs or symbols e.t.c .Even the programming aspect of it which is done with assembly language will also be shown. But before we continue what is a microcontroller ? microcontroller is a small computer on a single metal-oxide-semiconductor (MOS) integrated circuit (IC) chip or A microcontroller is an integrated circuit (IC) device used for controlling other portions of an electronic system, usually via a microprocessor unit (MPU), memory, and some peripherals. It has 40 pinout the name or functions of the pins are labeled on the picture below.

A seven segment display is the most basic electronic display device that can display digits from 0–9. The most common configuration has an array of eight LEDs arranged in a special pattern to display these digits. They are laid out as a squared-off figure. Seven segment displays are of two types, common cathode and common anode. In common cathode type , the cathode of all LEDs are tied together to a single terminal and the anode of all LEDs are left alone as individual pins labeled as a, b, c, d, e, f, g & h (for dot) . In common anode type, the anode of all LEDs are tied together as a single terminal and cathodes are left alone as individual pins. It will take a high (1) to turn a LED ON in common cathode and will take a low (0) to turn a LED ON in a common anode seven segment display. The pin out scheme and picture of a typical 7 segment LED display is shown in the image below.

Digit drive pattern for common cathode

# a b c d e f g

0 1 1 1 1 1 1 0

1 0 1 1 0 0 0 0

2 1 1 0 1 1 0 1

3 1 1 1 1 0 0 1

4 0 1 1 0 0 1 1

5 1 0 1 1 0 1 1

6 1 0 1 1 1 1 1

7 1 1 1 0 0 0 0

8 1 1 1 1 1 1 1

9 1 1 1 1 0 1 1

The circuit diagram shown below is of an AT89S51 microcontroller based 0 to 9 counter which has a 7 segment LED display interfaced to it in order to display the count. This simple circuit illustrates two things. How to setup simple 0 to 9 up counter using 8051 and more importantly how to interface a seven segment LED display to 8051 in order to display a particular result. The common cathode seven segment display D1 is connected to the Port 1 of the microcontroller (AT89S51) as shown in the circuit diagram. R3 to R10 are current limiting resistors. S3 is the reset switch and R2,C3 forms a debouncing circuitry. C1, C2 and X1 are related to the clock circuit. The software part of the project has to do the following tasks.

Form a 0 to 9 counter with a predetermined delay (around 1/2 second here).

Convert the current count into digit drive pattern.

Put the current digit drive pattern into a port for displaying.

All the above said tasks are accomplished by the program given below.

Program.

ORG 000H //initial starting address

START: MOV A,#00001001B // initial value of accumulator

MOV B,A

MOV R0,#0AH //Register R0 initialized as counter which counts from 10 to 0

LABEL: MOV A,B

INC A

MOV B,A

MOVC A,@A+PC // adds the byte in A to the program counters address

MOV P1,A

ACALL DELAY // calls the delay of the timer

DEC R0//Counter R0 decremented by 1

MOV A,R0 // R0 moved to accumulator to check if it is zero in next instruction.

JZ START //Checks accu

--

--