7 segment display interfacing 89s52
u have to use two ports for interfacing seven segment display with m.controller.In the case of common cathode display,8 pins from port0 is connected to the 7 segments of the c.c display. For a two digit counter two c.c display is used.so the two common cathod pins of the display is connected to the m.controller through a transistor.Collector of bc547(two numbers) is connected to c.c pin Emiter is grounded.base is connected to the m.controller through 10k resister.
Now write down the pattern for display.Ie a low on c.c pin and high on a segment
lightsup the led.A low on c.c pin requires high logic to send to the base of tran
sistor.Now mov the patternn to port0,make c.c pin low,call a small delay of 1ms.
Now mov second pattern to port0 ,make c.c pin low,call a small delay of 1ms,repeat this process
Hope that helps