xorcise said:
Drive the Display directly from the PIC outputs with no limiting resistors and no BJT or FET. PIC FET outputs are source self-limiting at 25ma. Connect the 8 Sink lines directly to PIC outputs also.
For such a simple single LED Matrix circuit.... throw all the other components away!
I have proven this setup with several demonstrations on YouTube. Here are the
connections I used with an 8x8 LED Matrix:...
xorcise said:
The electrical specs for PIC IO is not so different actually. And, you will not exceed the total PIC package power by driving the display at full IO current. A 16F628A will work fine for your project. Try it.... you'll wonder how it was so easy.
For a 5x7 display, source 5 lines and sink 7/8 lines as needed.... 12 IO total. For best even brightness, scan the sink side and drive data on the source side. The current on a sink IO pin can get a little high in this configuration since you are dumping up to 5 sources running at 25ma. But you have to remember that you have a duty cycle of 12.5% and are not going to cause any damage. Otherwise, you can reverse the process by scanning the source side and driving all the sinks with the data to be displayed. In that case you will never exceed the normal (very safe) limits of the IO.
The latter configuration (driving data on the sink lines) requires the least of amount of PIC memory to store font tables. You only need 5 bytes per character. The first configuration requires 8 bytes per character.
You will find PIC's almost indestructable. They have a lot of protection limits, both inherent and built-in.
For the 628A:
"Maximum output current sunk by any I/O pin..........................................................................................................25 mA
Maximum output current sourced by any I/O pin ....................................................................................................25 mA"
Note that if you set an output low and meter it to the 5V rail, most midrange PICs will do 35 mA, and set high to the low rail will give more like 30 mA. Note both of these are above the max allowable, you're still technically required to limit current to be within specs. I do it all the time myself as well, but you must be aware of the risks. Only thing limiting it to even that is the channel dimensions of the output FETs, and that isn't a guaranteed spec, could get a different PIC tomorrow that sank 2A on an output..
Not likely though, it would upset the apple cart.. Older PICs would do 100 mA on an output, but those aren't common now.
Tons of info on the internet says it like that, but it's wrong, just because the PIC doesn't destroy itself on a short people assume it is self limiting. Simple to set a pin low and check to 5V etc and see that while it doesn't destroy the pin it certainly exceeds the spec. Technically you are running the risk of that and/or latchup or really any other possible problem, but I haven't ever had a problem that I'd attribute to it either..
You won't ever get more than that 35 mA into a pin. Won't matter if you have all 7 on and they would each do 30 mA into ground, using one pin as a sink you'll never get more than the 35 mA it would pass from +V into ground. Since the high side channel resistances will balance the LEDs, 7 on should get full duty for their pin cycle, while down to 1 on should get about 1/7th of it's full duty. But modern LEDs are so bright that it's hard to notice optically for most things, I rarely bother with this for things I direct drive.
And while it won't with just a single scanning item like this, for the newbies it is good to point out that if you get using this a lot (pins to run things with no resistors), it's easy to exceed port or package specs if you start having a lot of things that can all be 'on' at once. Basically you can short everything to hell and they'll stay working, but you're also far outside any notion of guaranteed operation.
Works, use it tons myself. But for sure you are taking all possible problems on yourself any time you use this, the reason it limits to 35 mA isn't a guaranteed spec but is determined by process dimensions, and even that is over what specs say you're ever supposed to allow on a pin. Works great, but if it FUBARs you are just a loser, so you have to keep it in mind..