Interfacing LED's To Microcontroller: Common Cathode

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

7 Seg displays are are basically 7 LED's. It will be much easier to understand if you first readInterfacing LED's to Microcontroller.

Basically there are two types of 7-Seg display's: Common Cathode where all the segments share the same Cathode. Common Anode where all Segments share the same Anode.

Here we will be only discussing the Common Anode type.In common Anode in order to turn ON a segment the corresponding pin must be set to 0. And to turn it OFF it is set to 1.

Controller P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 P2.6

Figure 2 7-seg display A B C D E F G

Figure 1 shows how to interface 7-seg display to a microcontroller. Now we create a lookup table containing the seven segment pattern to

display the corresponding hex digits. e.g. consider we have to display '1' from the above figure we come to know that turning ON segment B & C will show '1' on the 7-seg display so P2.1 & P2.2 should be LOGIC 0 whereas rest of the pins should be LOGIC 1. FIGURE 2 shows the lookup table for CA display.

Figure 3

We can now interface a single 7-Seg to the microcontroller but for interfacing multiple 7-seg's we use Scanning Principle where One 7-seg is displayed after another but this process is very fast hence the flickering cannot be seen by human eye. Figure 3 shows the circuit for interfacing two 7 seg displays.

When interfacing more than one 7-seg display the segment's (A-G) of all displays are connected together whereas their ANODE (Cathode in case of CC displays) are switched ON one after another. Consider we have to display '31' on the above 7-seg display so we TURN ON the first transistor by setting its corresponding pin to 1 & then give the 7seg equivalent code for '3' which is 4fh. Then we TURN OFF the first transistor & TURN ON the second & output its corresponding 7-seg

equivalent code of '1' i.e. 06h.Then we again go back to display '3' this is a never ending loop.

You might also like