Re: 100 LED's from a PIC - a different approach

I recently posted a question here asking if anybody had thoughts on

>getting 100 LED's (not segmented displays) independently controlled by >a PIC16F84. As a complete novice, the responses confused the heck out >of me. But I did glean enough to realise that maybe I could start with >a better PIC. So I'm trying a different approach today. I've gone out >and bought myself a PIC16F872 instead. Now this sucker has 22 I/O >ports so I'm figuring a matrix of some sort should be achievable. I >only need at most 10 LED's to be lit up at any one time.

The problem with all matrix implementations is that they rely on time multiplexing. That means in your case that any LED that is "on" can only be truly "on" 10% of the time. If you use the same current that the LED is rated for continuously, you will get a much dimmer appearance than if the LED were on continuously. Maybe this is OK for you, but if you want maximum brilliance, use a static method like the ones using shift registers with a separate output and a separate current-limiting resistor for each LED. To be fair to the matrix/multiplex method, it is possible to design for a pulse current that is somewhat higher than the rated static current for the LED, and thus somewhat overcome the fact that the LED is only on 10% of the time. Visual persistence is sort of like a peak detector which allows you to ignore the 90% of the time when the LED is off. But this can only be pushed so far. In no case can you get equal brilliance from a

10% pulsed system as from a static system. You said that you only need to have 10 LEDs on at a time. That does not help simplify the matrix design any. You still need to treat the matrix as if any combination of 100 LEDs could be on. The only thing your limitation can do is reduce overall power dissipation and power supply requirements.

If you are still set on doing a matrix implementation, then you need to switch rows to the plus rail and columns to ground. At each intersection of a row and a column place a LED from the row conductor to the column conductor. Put current-limiting resistors in one or the other - let's say the columns. Your CMOS outputs from the PIC16F84 have enough current drive capability to drive the rows and columns directly. From there on it's just a software problem. Cycle through the rows at a fast enough rate to avoid the visual appearance of blinking. (100 complete cycles per second would be fast enough.) For each row, select that row by setting it high and all the other rows low. For each row, set the column drivers low for those LEDs you want to be on, and high for all the others. The software must be involved full-time in maintaining the scanning, unlike the static shift register method where you can set it and forget it.

-Robert Scott Ypsilanti, Michigan (Reply through this forum, not by direct e-mail to me, as automatic reply address is fake.)

Reply to
Robert Scott
Loading thread data ...

Honestly I would recommend that you spend some money on a good book. If you're keen on pics, John Peatman's book is an excellent resource:

formatting link

It will teach you some of the basics that you're having trouble with, and has some sample code and even an unstuffed (build it yourself) PCB...

ttyl,

--buddy

Reply to
Buddy Smith

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.