LED Matrix display


Closed Thread
Results 1 to 14 of 14
  1. #1
    Join Date
    Aug 2003
    Posts
    985

    Default LED Matrix display

    Hi Guys,
    This idea might sound silly, but I can't logically disqualify it, or practically check it at the moment,
    but take any old LED matrix for POV display such as this:



    So we get a number of LEDs which is the number of IO pin inputs multiplied by the number of IO pin outputs.
    If we want more LEDs we go and get port multipliers.
    The pic does the logic, but we introduce rows of transistors to source and sink the current as the display
    gets larger (since the pic can sink more current than it can source, sometimes can get away with one row).

    What if we got the above display working in a typical POV display circuit,
    then duplicated the display circuit, but with reverse polarity, and configuration of transistor rows to match,
    and then connected the second display circuit to the same pic IO pins that are driving the first display,
    then just change the tris on every IO pin (inputs change to outputs and vice versa), to address the second display.

    Could we double the LEDs for the same number of pic pins this way?

  2. #2
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: LED Matrix display

    BTW, feel free to tell me if you think I'm nuts.



    You can turn either LED on, or both LEDs off with combination of toggling TRIS for the pin, and the value on the pin.
    You just can't turn both of them on at the same time, because the pin can't source and sink current at the same time.
    We can fail to source or sink current to achieve the state of both LEDs off.

    A matrix display only has to light a line at a time.
    Why can't that be extended out to an entire matrix display?
    Last edited by Art; - 4th October 2013 at 05:28.

  3. #3
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637


    Did you find this post helpful? Yes | No

    Default Re: LED Matrix display

    Quote Originally Posted by Art View Post

    Could we double the LEDs for the same number of pic pins this way?
    I think that it should work. But, I think you would be able to control only one LED at a time out of the 128 total LEDs.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,517


    Did you find this post helpful? Yes | No

    Default Re: LED Matrix display

    Hi Art,
    Look up Charlieplexing, I think that's really what you're suggesting. With that and 16 I/Os you can drive 255 LEDs.

    In your second example, when the pin is tristated wouldn't current be flowing thru both diodes, turning them both on? Obviosuly depending on Vf of the particular diodes but never the less.

    Instead, connect the LEDs in reverse polarity between the I/O-pin and a voltage divider across the rail. Now when the pin is LOW one of the LEDs will be on, when it's high the other LED will be on, when the pin is tristaded neither LED will be on.

    /Henrik.

  5. #5
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637


    Did you find this post helpful? Yes | No

    Default Re: LED Matrix display

    Quote Originally Posted by Art View Post

    You can turn both LEDs off with combination of toggling TRIS for the pin, and the value on the pin.
    How?????? I don't see how.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  6. #6
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: LED Matrix display

    Quote Originally Posted by rsocor01 View Post
    How?????? I don't see how.
    TRIS 0 for the pin, and value 0.
    Does that not mean it won't source or sink current?

    Quote Originally Posted by rsocor01 View Post
    I think you would be able to control only one LED at a time out of the 128 total LEDs.
    Why a single LED rather than a whole row or column?
    Last edited by Art; - 4th October 2013 at 09:50.

  7. #7
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: LED Matrix display

    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.

  8. #8
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,517


    Did you find this post helpful? Yes | No

    Default Re: LED Matrix display

    Hi Art,
    TRIS 0 for the pin, and value 0.
    Does that not mean it won't source or sink current?
    No not really, with TRIS=0 and Port=0 it WILL sink current..... In relation to the schematic in your second post:
    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 10:29.

  9. #9
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: LED Matrix display

    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.

  10. #10
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: LED Matrix display

    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 12:16.

  11. #11
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637


    Did you find this post helpful? Yes | No

    Default Re: LED Matrix display

    Quote Originally Posted by Art View Post


    Why a single LED rather than a whole row or column?
    Yes, you are right. It looks like you can turn on a whole row or column at a time.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  12. #12
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: LED Matrix display

    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.

  13. #13


    Did you find this post helpful? Yes | No

    Default Re: LED Matrix display

    Microchip app note TB029 Complementary LED Drive

  14. #14
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: LED Matrix display

    Quote Originally Posted by AvionicsMaster1 View Post
    If I'm missing something or am all wet, I'm sure someone will tell me.
    It's me who's missing something, or making sure that I'm not missing something for the next display I guess.
    At the very least it still looks like one of my multi seven seg displays could have been easily improved.

Similar Threads

  1. led matrix problem
    By dellpc in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th September 2011, 09:18
  2. SureElectronics LED Dot Matrix Display
    By DanPBP in forum Off Topic
    Replies: 4
    Last Post: - 4th October 2009, 21:10
  3. 5x7 LED Matrix Scrolling Display
    By roycarlson in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 5th August 2008, 00:50
  4. Help led matrix
    By mosbc69 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 14th April 2008, 20:54
  5. 245 Led Matrix Display (as constructed by Magu)
    By magu in forum Code Examples
    Replies: 11
    Last Post: - 29th June 2007, 01:07

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts