The LEDs in the matrix I'm talking about look more like this:
Where normally, the matrix would only have one LED, and we just decided which pin would
control, or provide the source current, and which pin, the sink current.
I really do need to get my computer sorted out.. I can't put something like this together at
the moment.. It would only take two banks of four LEDs each to test it.
Hi Art,
No not really, with TRIS=0 and Port=0 it WILL sink current..... In relation to the schematic in your second post:TRIS 0 for the pin, and value 0.
Does that not mean it won't source or sink current?
If you set TRIS=0 then pin is an output. If you then set the pin low it will sink current so (only) the upper LED will turn on, if you set the pin high it will source current so (only) the lower LED will turn on - so far so good. But if you set TRIS=1 the pin is made an input and will not source or sink any current but since the LEDs are connected in series across the supply they will both turn ON - not off.
If Charlieplexing isn't what you meant I must confess I don't quite follow.... I'll re-read your initial post a couple of more times to see if I can figure it out.
/Henrik.
EDIT: OK, you squeezed in a post while I was typing. The two LED "matrix" you show in your latest basically IS how Charlieplexing works.
Last edited by HenrikOlsson; - 4th October 2013 at 09:29.
It is really only the two IO pin, two LED schematic that relates to a POV matrix display.
If it really is that easy, I'm kicking myself over previous designs..
like 144 LED display, and various ways I have done multiple 7 segment LED displays.
I even have a personal project where a 16F877 drives 6 LED digits, and another slave pic hanging off it drives another 3 digits.
Again, I can't test, but if you can't prevent a pin sinking current then this should not be possible:
Something I googled looking for "Charlieplexing".
If you didn't need the decimal point, looks like it could happen on an 8 bit port,
unless it's a feature specific to the chip driving this display.
... but if all pins wer sinking current this display wouldn't work.
Last edited by Art; - 4th October 2013 at 11:16.
As the schematic shows in post #1 you'd need a high on a specific pin of Port C and a low on a specific pin on Port B to turn on one LED. To turn on a whole row one pin on Port C would have to go high and all the pins on Port B would have to go low. If the LEDs would turn on they'd be very dim as you're sourcing/sinking through the PIC and you'd probably not have enough current to turn on more than two or three LEDs.
As the schematic shows in post #2 if the PIC Port was set to TRIS =1, high impedance, and the resistors were of the right value you could turn on both LEDs but they'd be dimmer than if the Port was set to TRIS = 0 and the Port set to 0, low = upper LED on, or 1, lower LED turned on.
The seven segment display in post #10 is a different animal than the other two. You'd have to have chip select somewhere or all displays would have the same number. You could do all the output on one Port but you'd probably have to use another port for chip select. I'm not sure what the CC pin does but it that is the chip select, IMHO, it can't be used as shown to do the chip select.
If you want chuckplexing I posted this http://www.picbasic.co.uk/forum/showthread.php?t=14220 post #17 to control 20 individual LEDs with only 5 pins. I have substituted successfully replacing the diodes with optoisolators to control 20 higher current draw devices.
If you are going to do a true LED matrix display I don't see how you can turn on a full row or full column with a high on one pin and only grounding one additional pin. They are designed to work like that.
If you want to use only one port to drive a dot matrix display you could a BCD to decimal, or BCD to seven segment, chip using four pins and then chip select with the other four.
If I'm missing something or am all wet, I'm sure someone will tell me.
Microchip app note TB029 Complementary LED Drive
Bookmarks