Byron A Jeff wrote: >> First common all the three disp-segs data lines and connect to one >> of the ports, > Make sure you have current limiting resistors between the port pins > and the displays. So far, so good. Use Port B for this, include the decimal as the eighth bit. > Also make sure that the displays are common cathode. I beg to differ. You want common anode, drive the segment cathodes LOW. >> then take the 3 commons and connect them to separate >> port pins, > Now this is going to be a problem. You have to balance the fact that > you need sufficient brightness in the LED's, and the limited amount of > current that a port pin can sink. > Simply put a transistor between each common port pin and the display. > Connect the collector to the common cathodes, the emitter to ground, > and the base to the port pin through a 2.2K resistor or so. Then the > transistor can sink sufficient current to brightly light the displays. NPN transistors as implied here are generally more readily available. The *simpler* approach I am suggesting however, using common anode displays, is to use NPN transistors as common emitter drivers, base driven directly from port pin (no resistor), emitter to digit anode and - note this - collector connected to unregulated supply if practical. *Many* advantages here: Waste no current driving bases, notably if no segments are active, transistors do not saturate so minimises ghosting, base resistors not used = fewer components on PCB, and the LED current need not be supplied by the regulator, so a (smaller) low-power regulator can be used. You lose about 0.8V instead of 0.3V in drop across the transistor but this won't matter at 5V. > When I had a lot of displays to do, I'd use a 7445 decade decoder > because each of the 10 pins pin can sink up to 80 ma. OK, but consumes more power than a working PIC, even when idle! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ So, you use eight port B lines for segments (the DPs are quite useful) and three port A lines for digit drive. A fourth port A line gives you your control output and the fifth multiplexes to your eight control buttons using eight diodes (or you can cheat and use resistors if you don't want combination button presses) to the port B lines. Just switch on port B pull-ups, pull the button select line low, and read port B. You don't need shift registers for this application - three transistors, some diodes, eight 150 ohm resistors for the segments and it's done. But when you *do* need expansion, shift registers are the way to go! -- Cheers, Paul B.