??? 07/13/06 04:16 Modified: 07/13/06 04:17 Read: times |
#120142 - can you say \"duty cycle\"? Responding to: ???'s previous message |
Greetings, Ammar Ahmed,
If you try this a bit, you may find it pretty easy. It can, in fact make things, e.g. hardware simpler rather than more complex. First, of all, you must know the precise specifications of your LED's and your MCU, of course. I'm assuming, not safe, but necessary, as you didn't provide sufficient detail, that these are 7-segment common cathode LED's. If you put a simple resistor to a digit-select-not pin on your MCU to the common cathode, then whenever you drive a segment high, it will be "ON." You can, in fact, if the spec's allow, omit the resistor if you are certain you can control the current in your segment drive by its duty cycle. If, then, you find that it is at least bright enough, then you can reduce the time it is left "ON" until it is barely bright enough, and then increase that by no more than ~10% to allow for variation between LED's. You then are using the inherent resistance of the two MCU pin drivers to control the current. How well this works depends on how thoroughly you've understood the inherent characteristics of your LED and your MCU. The resistors make it safer, but, even then, you have to understand the characteristics of both the MCU and the LED. If you dedicate the same amount of time for each segment, then you can ensure that each segment will be equally bright. Do not attempt to skip omitted segments, BTW, because it will make the digits unequally bright. RE |