ign challenge is that I only have about 17 pins available on my SoC.
interface (spi/i2c) and then send over data to toggle the appropriate pins ?
n a second microcontroller.
The simplest sort of multiplexer would only be able to turn one LED on at a ny one time (a opposed to toggling any one of 23) but it would only use 10 lines for a 5x5 matrix. You'd connect the anode pins of groups of five LEDs together to a common current-limiting resistor, and connect each of the fi ve resistors back to five PNP open collectors, any one of which (but only o ne) could be turned on to connect to - say - +5V.
Similarly the cathode pins of groups of five LEDs (one from each of the fiv e different anode groups) would be connected together to one of five common NPN collectors, any one of which (but only one) could be turned on to conn ect to the
0V rail.
The shift register solution is more elegant and more flexible, and might be cheaper - 3 x 74HCT595 plus 23 current-limiting resistors is probably chea per than five discrete PNP transistors, five discrete NPN transistors, five current limiting resistors and ten base drive transistors. Even the part c ount is almost the same
I wonder how John was going to use his 14 multiplexing lines - a 4 x 6 matr ix is still only ten lines, a 3 x 8 matrix is 11 lines, and 2 x 11 is still only 13. I may be missing something here.
esign challenge is that I only have about 17 pins available on my SoC.
al interface (spi/i2c) and then send over data to toggle the appropriate pi ns?
on a second microcontroller.
any one time (a opposed to toggling any one of 23) but it would only use 1
0 lines for a 5x5 matrix. You'd connect the anode pins of groups of five LE Ds together to a common current-limiting resistor, and connect each of the five resistors back to five PNP open collectors, any one of which (but only one) could be turned on to connect to - say - +5V.
ive different anode groups) would be connected together to one of five comm on NPN collectors, any one of which (but only one) could be turned on to co nnect to the
be cheaper - 3 x 74HCT595 plus 23 current-limiting resistors is probably ch eaper than five discrete PNP transistors, five discrete NPN transistors, fi ve current limiting resistors and ten base drive transistors. Even the part count is almost the same
trix is still only ten lines, a 3 x 8 matrix is 11 lines, and 2 x 11 is sti ll only 13. I may be missing something here.
the OP needs 23 so 2x11 won't do, 2x12 = 14 pins, 24 leds
If you can talk I2C, you can use a port expander like the MCP23017; that gives you 16 pins to work with, requiring 2 pins from your SOIC (and a simple matter of the I2C software). The MCP23017 is popular with the Arduino crowd, so you can find plenty of sample code using it. You'd need to do some amount of multiplexing to get 23 LEDs on 16 bits, or use multiple port expander chips as they also come in an 8-bit version.
For a simpler approach take a look at the 74HC595 -- 8 bit serial input shift register with latch and tri-state outputs. Each output will deliver 30mA max, so if your LEDs will run on that, you're in luck. Three of these in a row and you're in business.
Arrange the LEDs as a 4 x 6 matrix. You can use 6 row drivers and 4 column drivers or vice versa. One of the drivers needs to be more powerful, as it could be driving all 4 or 6 LEDs on at the same time. The other driver needs less power, can often be done with the bare micro's I/O pins, and needs a series resistor. This requires a constant updating, but at a pretty low rate, could be done by a keyboard scanning routine. It only takes 10 pins and probably one driver chip and some resistors.
Also if you use NPN emitter followers you can then omit the base resistor.
ditto PNP followers
doesn't that setup allow upto 5 LEDs to be lit simultaneously? and by scanning any combination to appear lit.
If you only want to light one led at a time the microcontroller's outputs are probably strong enough.
23 pins would be a 2x12 matrix: it's easy enough to build an inverter using the column drivers
2x12 gets the most brightness if you need several leds to simultaneously appear to be lit, and if you can drive the rows directly with the microcontroller outputs it saves on parts.
--
Neither the pheasant plucker, nor the pheasant plucker's son.
--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
17 pins are a lot. The simplest solution are 3 8-bit registers like 74HC574. You need 11 pins; 8 for the data and 1 for any clock to the register. Drawback is that you need 23 current limiting resistors. Advantage is that it is static and you dont need a periodical routine for multiplexing.
--
Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de
HTML mails will be forwarded to /dev/null.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.