EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

100 LED's from a PIC - a different approach

Started by Scott Hooper November 12, 2004
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.

So I'm humbly asking the community again, as a complete novice that
really just has an artistic application in mind, can anybody point me
to some schematic samples that might point me in the right direction
for achieving this LED matrix? With the utmost respect to those that
responded before, I really need a sample diagram and the code that
drives that circuit, because the intellectual discussion only of some
of these concepts are just way over my head. Having said that, I have
a good understanding of basic electronics, circuit construction and
programming. Furthermore I have all the tools, software and hardware,
to make the project happen. I just need an example close to my
requirements and maybe some mentoring.

Cheers & thanks,
Scott Hooper
In article <991ca63c.0411121319.75dad5c@posting.google.com>,
Scott Hooper <sfk.hooper@gmail.com> wrote:
>to some schematic samples that might point me in the right direction >for achieving this LED matrix?
Google for LED scrolling signs. You can easily drive your 100 LEDs as a 10x10 matrix with 20 IOs (10 each row/column). -- Ben Jackson <ben@ben.com> http://www.ben.com/
Scott Hooper <sfk.hooper@gmail.com> wrote in message
news:991ca63c.0411121319.75dad5c@posting.google.com...
> 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. > > So I'm humbly asking the community again, as a complete novice that > really just has an artistic application in mind, can anybody point me > to some schematic samples that might point me in the right direction > for achieving this LED matrix? With the utmost respect to those that > responded before, I really need a sample diagram and the code that > drives that circuit, because the intellectual discussion only of some > of these concepts are just way over my head. Having said that, I have > a good understanding of basic electronics, circuit construction and > programming. Furthermore I have all the tools, software and hardware, > to make the project happen. I just need an example close to my > requirements and maybe some mentoring. > > Cheers & thanks, > Scott Hooper
Hi Scott, have a look at http://www.xcprod.com/titan/XCSB/CONTRIB On this page you will find a circuit for driving an 8x8 LED matrix using 16 PIC I/O pins and a circuit for driving a 32x8 LED matrix using 10 PIC I/O pins and 4 shift registers. Regards Sergio Masci http://www.xcprod.com/titan/XCSB - optimising PIC compiler FREE for personal non-comercial use
"Scott Hooper" <sfk.hooper@gmail.com> wrote in message 
news:991ca63c.0411121319.75dad5c@posting.google.com...
>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.
I did exactly this with a latch (573) and a series of shift registers (595). -->Neil

Scott Hooper wrote:

> 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. > > So I'm humbly asking the community again, as a complete novice that > really just has an artistic application in mind, can anybody point me > to some schematic samples that might point me in the right direction > for achieving this LED matrix? With the utmost respect to those that > responded before, I really need a sample diagram and the code that > drives that circuit, because the intellectual discussion only of some > of these concepts are just way over my head. Having said that, I have > a good understanding of basic electronics, circuit construction and > programming. Furthermore I have all the tools, software and hardware, > to make the project happen. I just need an example close to my > requirements and maybe some mentoring. > > Cheers & thanks, > Scott Hooper
You should be able to find it on the net somewhere. the concept is simple. Assume 8x8 : output row 1 data to the sink drivers. Select row 1 source driver. wait a few ms turn off 1 source driver. output row 2 data to the sink drivers. Select row 2 source driver. keep going Look at the allegro web site. ULN2803 is good for the sink driver. (I am not sure about a source driver). Drive the LEDs at max peak current (50ma?) Do not stop or they will burn out. You have other choices. 8 or 16 bit shift registers 8 or 16 bit latches. philips has a line of I2C led drivers. you can spread them out. You chip might have it built in. Good luck.
On 12 Nov 2004 13:19:02 -0800, sfk.hooper@gmail.com (Scott Hooper)
wrote:

>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.)
Scott Hooper <sfk.hooper@gmail.com> wrote:
> for achieving this LED matrix? With the utmost respect to those that > responded before, I really need a sample diagram and the code that > drives that circuit, because the intellectual discussion only of some > of these concepts are just way over my head. Having said that, I have > a good understanding of basic electronics, circuit construction and
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: www.picbook.com 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

The 2024 Embedded Online Conference