Controlling 7-segments LED displays
Controlling 7-segment LED displays in different ways with an AT90S1200 microcontroller
The 74HC595 datasheet.
Controlling two displays:

There are several possibilities to connect a 7-segments LED display to a microcontroller.
Directly to the i/o's of the microcontroller, or a more economic way, with a shift-register e.g. the 74HC595 and multiplex the displays. With a shift register you only need 3 i/o's and you have 8 outputs. Another possibility is the 74LS247 a BCD -> 7-segments driver IC, this takes 4 i/o's. The diagram shows two 7-segments LED displays controlled by only 5 i/o's. Ofcourse you can add more displays. With a minimum of components you're able to control a maximum of displays. The circuit consumes about 20 mA with TDSL-5160 (Vishay) 7-segments LED displays.

Download: upcounter.hex and upcounter.eep
The many posibilities....

Non Multiplexed:

1. One or two displays directly to the i/o's
2. One display with a 74LS247
3. Two displays with a 74HC595 and two 74LS247

Multiplexed:

1. Two displays with a 74LS247 and 2 i/o's
2. Two displays with a 74HC595 and 2 NPN/PNP *
3. With a special driver IC e.g. MAX7219



The TDSL5160 datasheet.
Controlling one display:

If you look at the diagram, you can immidiatly see that this display isn't multiplexed because the Common Cathode is connected to ground. I made an upcounter, by using the EEPROM of the AVR, this makes the program pretty short. I also did put a so called 'lamp test' piece of code in the routine, easy for testing different kind of Common Cathode LED displays. Simply put the segments data into an EEPROM table, this saves a lot of program lines.

Download upcount.asm.
Components:

1x TDSL5160
1x AT90S1200-12PI
1x 7805
1x 8MHz ceramic resonator
1x 47uF/16V
2x 100n multilayer
1x 100n MKT
1x 10k
7x 1k