We have already discuss basic about "single seven segment interface to 8051" in which seven segment is individually drive through 8 pin of microcontroller AT89S52. If we want to display two,three or more seven segment display using single MCU than there is problem that we face is lack of I/O pins in MCU, as one seven segment would take 8 I/O pin and four seven segment would take 28 I/O pins.That's why multiplexing technique is used to drive multiple seven segment display. In this tutorial i'll explain you how to interface multiple seven segment display to 8051.
Here we'll used "persistence of vision" to archive this multiplexing.This technique is used in cinematography to display images so fast that our brain cannot distinguish any lag between two consecutive images. Similarly, when we multiplex more than one seven segments, we display only one Seven segment at a time, and we switch between them so fast that our brain cannot distinguish between them.
In multiplexing all the display are connected in parallel such that if you active any segment than the particular segment of all displays glow up.But we switch on and off the common line of segment very fast.
In multiplexing all the display are connected in parallel such that if you active any segment than the particular segment of all displays glow up.But we switch on and off the common line of segment very fast.
Circuit Diagram:
In the above circuit all the similar segment of seven segment display are connected together and which is connected to the PORT0 of AT89S52 through current limiting resistors(R2 toR9).Particular segment is turn on when the corresponding pin of PORT0 is high(1) because segment is common cathode.But it'll not glow until it's cathode is not connected to ground.But here cathode of the seven segments are not directly connected to ground.Three NPN (BC547) transistor is used as a switch to on and off the particular segment.Therefore, the transistor selects which displays is active at a time.Here base of all three transistor are connected to the P2.0, P2.1, P2.2 through base resistor don't forgot to put base resistor may your transistor stop working.Common line of segment is connected to ground when the logic high(1) is apply to the base of the transistor and disconnected when logic low(0) is apply to the base of transistor.