??? 12/26/08 17:15 Read: times |
#161138 - It's all up to you ... Responding to: ???'s previous message |
The 805x MCU isn't adequate to drive multiplexed LED's at either the cathode or the anode. What you can do with the two n[n transistors, is put the emitter of one on the anode line and the collector of the other on the cathode line. The MCU drives the base of the one on the anode line with one port bit and the base of the other with another port bit, preferably with a resistor in the base of each one, just to protect the base-emitter junction. The one on the anode is connected to a positive supply, not to exceed the Vcc of the MCU. The emitter of the one on the cathode is connected to Vss (gnd). When the Anode driver is turned on then the cathode sink control when the LED segment sees current flow, which lights it up.
The anode driver gets a pullup on its base, that's sufficient to limit the current at the base to what the MCU can sink (see the datasheet and look up Vol). That way you don't hurt the MCU. Be sure that you don't exceed the MCU's total "package" power dissipation limit. These bipolar transistors have a "gain" that's represented in their datasheet. Small transistors like the 2N3904 have a gain on the order of 100. What that suggests is that if you send 2 mA into its base from the MCU, it will conduct on the order of 200 mA from collector to emitter. Somewhere in the circuit you have to limit the current that flows through each segment. You can't rely on the MCU Ioh * transistor gain, so a resistor has to be used, somewhere in the path, to control current flow. The collector of the segment (anode) driver might be a good place for that resistor. If, however, you have more than one anode driver connected to that line, the MCU may not be able to pull down the pullups on the various bases with a single port bit. Further the forward voltage of many LED's exceeds 1.5 volts. If you add up the forward voltages involved, i.e. cathod driver, anode driver, and LED, you don't have much voltage to play with in adjusting your brightness by limiting the current. What's more, you certainly haven't a lot of headroom, and bipolar transistors like to have at least a volt or so. Many of those old PMOS clock chips operated with a total voltage supply greater than 5 volts. At what supply voltage does your now-defunct clock chip operate? Is there more than one supply? There are open-collector drivers, (look up 7416) that will allow you to control greater than Vcc voltages from a 5-volt, or even 3-volt, MCU. If you use those you can use 12 volts or thereabouts to operate your LED's, which will offer you some options you don't have with 5 volts. That 0.68 volts I mentioned is the forward voltage of the collector emitter path when the transistor is ON. Look up the Vce(sat) of your transistor. That's where that forward voltage comes into play, as the transistor dissipates that voltage when it's conducting. That's true for both the anode and the cathode driver. Now, if you're using ,say, 12 volts to drive your anodes, then you can use a darlington to sink the cathode current, and devices such as the ULN2003A claim to handle half an ampere per transistor without stress. A darlington transistor, which is what's in the ULN2003A, has two such forward voltages, but since the voltage is generous if you use 12 volts, you don't need to worry these voltage losses so much. If you have two current-controlled anode drivers driving two segments, with their cathodes driven by a single "common" cathode driver, then whenever that cathode driver is "on," the anode drivers will control which segment is lighted. If each anode driver collector is pulled to V+, whatever that is, by a resistor chosen to source from V+ the correct amount of current, then the MCU, with the aid of one of those open-collector drivers, (e.g. 7406, 7407, 7416, etc.) driving the transistor base, which is connected to the collector through a relatively large resistor, can control which anodes are driven and it can also control which cathodes are driven by a single port bit driving a single input on one of the seven darlingtons on the cathode line. The components I mentioned are not the only ones capable of doing the job. Choosing them and figuring out how to arrange them in order to multiplex the segment drive to make the display look as you wish, is your job. Erik has written quite a number of comments over the years regarding how one can drive displays. He's quite expert in such things, as that's his job. I'd take his advice seriously, were I in your position. RE |