Shop OBEX P1 Docs P2 Docs Learn Events
8x8 RGB LED Matrix - Taming the beast? — Parallax Forums

8x8 RGB LED Matrix - Taming the beast?

Ryan SmaglikRyan Smaglik Posts: 19
edited 2007-06-22 14:13 in BASIC Stamp
I've taken on quite a project (for me at least tongue.gif)!

rgb_dot_matrix_detail.jpg

What I have is an 8x8 RGB (192 total LEDs) matrix that I would like to drive (somehow) and then control with a fresh BS24px (which has been ordered).

Problem is... I'm having trouble thinking up a way to control the state and brightness of 192 LEDs and maintain the speed that is necessary to have flicker-free viewing.

I know I could find a way to do it with 3 of the MAX7219, that is if I had the common cathode version of the matrix (which I unfortunately do not). These RGB modules cost around 98.00 each in low quantities so I'm kind of stuck with the one I have.

Any thoughts or suggestions as to how to tackle this beast would be greatly appreciated.

I've attached the datasheet for the RGB matrix. I have the common anode version.

Thanks in advance,
Ryan Smaglik

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--
Ryan Smaglik
Student, Milwaukee School of Engineering

Post Edited (Ryan Smaglik) : 6/13/2005 7:00:23 AM GMT

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-06-13 07:58
    Ryan -

    For starters, take a look at the Maxim MAX7219 LED driver chip. That is probably the most widely used LED driver chip, although there are many others. You may also want to let us know what your eventual goal is.

    Regards,

    Bruce Bates
  • Dave PatonDave Paton Posts: 285
    edited 2005-06-13 14:06
    Like BRuce said, three MAX7219s should do it. If you use one for each color, just use 3 shiftout() statements to send the 3 word variables (one for each color) to the MAX7219s and it should be a piece of cake. Don't forget to set the toggle /CS on each chip as required to get the registers loaded properly. Figure 3 on page 13 of the datasheet should be pretty self explanatory.

    http://pdfserv.maxim-ic.com/en/ds/MAX7219-MAX7221.pdf

    Now determining what each word should be....that's a different story [noparse];)[/noparse]

    -dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    This is not a sig. This is a duck. Quack.
  • Ryan SmaglikRyan Smaglik Posts: 19
    edited 2005-06-13 20:44
    The MAX7219 will work the same for my common anode matrix? It says it works for the common cathode variety.

    What I am trying to do is stream simple pictures/animations from my laptop to it. I'm writing a program that will take 8x8 pixel images and get the rgb values for each pixel and then I need to find a way to send that data to be displayed. This is the part I need help with. How would you recommend connecting the 32 pins to the 3 MAX7219s? Which pins on the matrix to which pins on the chip? How would I need to format the image data to be sent to the drivers?

    For example, say I want the dot located 4 from the top and 5 from the left to show the RGB color (255, 50, 100)?

    Does the MAX IC allow me to control the brightness of each individual LED? What I'm trying to achieve is basicly an 8x8 pixel full color display.

    Thanks!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --
    Ryan Smaglik
    Student, Milwaukee School of Engineering

    Post Edited (Ryan Smaglik) : 6/13/2005 8:53:25 PM GMT
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-13 23:42
    The MAX7219 is a common-cathode driver -- and brightness affects all LEDs.

    You might consider a custom solution using a multi-channel PWM chip; this would give you individual brightness control over each LED. That said, you'd also now need a current limter for each LED ... but 24 resistors is not a lot of cash. Here's a link to a 16-channel PWM controller using the SX chip and programmed with our SX/B compiler:

    http://forums.parallax.com/showthread.php?p=536244

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Ryan SmaglikRyan Smaglik Posts: 19
    edited 2005-06-14 06:10
    So I probably should have not just spent $38 on 2 additional MAX7219? Drat!

    Arent there any existing ICs made for lots of PWM outputs?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --
    Ryan Smaglik
    Student, Milwaukee School of Engineering
  • BeanBean Posts: 8,129
    edited 2005-06-14 11:01
    Since you will need 32 outputs, this would be a perfect project for SX52.
    If you want to get started right away you could use the SX52 ConCarne ($59)
    http://www.parallax.com/detail.asp?product_id=45207

    Or you could wait until the SX52 proto boards are released (they are much less expensive).
    Of course you will need the SX programming tools.

    The SX28 PWM program could be modified to provide the outputs you need.
    Let me know if you need assistance. Maybe we could colaborate on the project.
    Bean.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "If you keep doing what you always did, you'll keep getting what you always got."


    Post Edited (Bean (Hitt Consulting)) : 6/14/2005 11:05:27 AM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-14 14:28
    Ryan Smaglik said...
    So I probably should have not just spent $38 on 2 additional MAX7219? Drat!
    Arent there any existing ICs made for lots of PWM outputs?
    Ryan,

    ·· Don't despair about the MAX7219's...I have found them quite useful for several projects, including two clock projects I have going.· Each MAX7219 can drive up to eight 7-Segment Displays (CC).· They're very easy to interface and save you from having to install tons of resistors.· I'll be posting a project based on one soon!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Ryan SmaglikRyan Smaglik Posts: 19
    edited 2005-06-14 20:29
    I'm going to go with bean's suggestion. My only question for the Parallax employees is:

    Should I go with the con carne or are you expecting to release the proto boards pretty soon?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --
    Ryan Smaglik
    Student, Milwaukee School of Engineering
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-06-14 21:12
    The protoboard should be availible at the end of this month.
  • ForrestForrest Posts: 1,341
    edited 2005-06-14 21:14
    The SX proto board should be out on June 28 according to http://forums.parallax.com/showthread.php?p=536038
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-06-16 15:44
    The attached document shows the wiring for a bar graph (12 leds with just 4 pins).

    The technique used is called charlieplexing.

    see

    http://www.maxim-ic.com/appnotes.cfm/appnote_number/1880

    I have no program for the bar graph, but maybe the technique is

    applicable to your project.

    regards peter
  • Ryan SmaglikRyan Smaglik Posts: 19
    edited 2005-06-16 23:00
    From what bean has explained to me, the SX is too slow to do what I need it to do.

    I found a chip made by TI, called the TLC5940NT. I've ordered 12 of them.
    Now what I need assistance with is how to interface and control them with my BSpx.
    I plan on using the cascading example circuit on page 16 of the data sheet (attached).
    I'm hoping someone can look at the timing diagrams and explain what I need to do to send the 12-IC-cascade data (and also how this data needs to be formatted) to set the brightness of each led on my common anode matrix.
    Each output on the 12 ICs will be connected to light a single led on the matrix when triggered.

    The datasheet is kinda "over-my-head" so I'd really appreciate instruction from anyone with a technical background.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --
    Ryan Smaglik
    Student, Milwaukee School of Engineering

    Post Edited (Ryan Smaglik) : 6/16/2005 11:12:24 PM GMT
  • CPUMANCPUMAN Posts: 55
    edited 2005-06-17 01:14
    Actually the SX is more then fast enough, here's a little comparison of the SX's speed.

    The basic stamp 2SX can execute about 10,000 instructions a second clocked at 50MHz.· Now a SX clocked at 50MHz can execute about 50,000,000 instructions per second.· The limiting factor in the SX is memory.

    Also looking at the datasheet of the LED display you want to control, it's not designed to allow control of LEDs one by one.· It's meant for use with a control method such as what the MAX7219 employs.· On page 8-4 of the datasheet there is the schematics of the display.· You'll notice that the LEDs are tide together in rows of 8.· So you have 8 rows by 24 columns (8 columns for each color).· Which is 32 connections, as Bean said.

    To multiplex the display you turn on and off each row in sequence, turning on the associated column in that row that you want the LED to be lit.· But the key is you do this very rapidly to trick our rather slow eyes into believing the LEDs are always on.· I know my explanation was kind of short but maybe someone who is better at explaining could put up a much more detailed explanation of multiplexing.

    Chris

    Post Edited (CPUMAN) : 6/17/2005 1:19:04 AM GMT
  • Ryan SmaglikRyan Smaglik Posts: 19
    edited 2005-06-17 04:30
    CPUMAN,

    I'm aware they need to be multiplexed, which is what I'm essentially doing.

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --
    Ryan Smaglik
    Student, Milwaukee School of Engineering
  • CPUMANCPUMAN Posts: 55
    edited 2005-06-17 17:20
    I guess I misread your earlier post as what I got from it is you ordered 12 of those TI chips with the intention of control the LEDs individualy which as you know you can't do.

    Chris
  • Ryan SmaglikRyan Smaglik Posts: 19
    edited 2005-06-17 21:56
    CPUMAN,

    Let me try to explain,

    I can light up any individual one of the 192 LEDs by hand, having only 1 on at a time...
    What the TI chip does is allow 16 individual LEDs to be controlled one at a time so fast that they could (if you wanted them to) all appear to be on at the same time.

    Since I have 192 LEDs instead of just 16, I need 12 of the chips to control them all.

    Basic stamp outputs a constant stream of serial data to the first chip, with instructions for all 12 chips (in order)
    Chip one controls LEDs 1-16 (one at a time),
    then the additional serial data cascades to the next chip...
    Chip two controls LEDs 17-32 (one at a time),
    then the additional serial data cascades to the next chip...
    Chip three controls LEDs 33-48 (one at a time),
    then the additional serial data cascades to the next chip...
    Chip four controls LEDs 49-64 (one at a time),
    then the additional serial data cascades to the next chip...
    ... and so on ...

    So only one of the 192 LEDs is on at any given instant, but its going so fast that your mind blurs them together and they appear to all be on at the same time.

    At least thats how I think the TI chips will work, maybe someone with more technical knowledge can confirm this?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --
    Ryan Smaglik
    Student, Milwaukee School of Engineering
  • CPUMANCPUMAN Posts: 55
    edited 2005-06-19 20:56
    Well, the TI chips strobe their outputs, but that's to controll the brightness, not to multiplex the display, which I·know you get that part.· The point I was trying to make is while yes you can make a single LED light up at a time on your own, you can't wire the TI chips·as you suggested with this display (without some complex and ugly multiplexing of outputs of the TI chips).· You don't have direct access to every LED, which would be needed to wire it as you just specified.· Not to mention we're talking 192 connections when it can be done in 32.· Also you can scan the LED's one at a time as you suggested, but·it would mean you'd have to scan very very fast to get through the entire 192 LEDs.· Which is why typicaly you scan a row at a time, so you only have to get through 8 rows per scan cycle.· I would also like to mention based on my own·expirence using a 8x8 (Red & Green) display, the stamp is generaly not fast enough to handle this task.· Thats not to say the stamp couldn't do it but it depends largely on how fast it can pump data out.· The TI chips·use a SPI serial interface which I was using 3x 595's which you control the same way and with the stamp doing nothing but draw a static image on the display there was noticable flicker as it wasn't able to draw the display fast enough.

    Chris
  • Ryan SmaglikRyan Smaglik Posts: 19
    edited 2005-06-20 20:12
    CPUMAN,

    Do you have any suggestions as to how I could drive this then?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --
    Ryan Smaglik
    Student, Milwaukee School of Engineering
  • Vern GranerVern Graner Posts: 337
    edited 2005-06-20 21:40
    Seems these guys did something similar, but on a much larger scale. The site is a little short on details, but maybe you could email them and ask for more tech info?

    http://web.mit.edu/storborg/ddf/

    from the page:

    CLIP
    The First East Disco Dance Floor

    During IAP 2005 First East created a disco dance floor for the concluding Disco
    Ball of the East Campus Bad Ideas competition. The construction was a
    week-long effort involving dozens of people.

    We are working to make hardware and documentation available cheaply
    for experimenters. If you are interested in staying informed about such
    things, you can contact us or keep checking the website. Thanks!

    * 1,536 LEDs
    * 128 square feet
    * 4,096 colors
    * 30 frames/second
    * 20,000 hand-soldered connections
    * ...best parties ever!

    /CLIP

    Hope this helps [noparse]:)[/noparse]

    Vern

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Vern Graner CNE/CNA/SSE    | "If the network is down, then you're
    Senior Systems Engineer    | obviously incompetent so why are we
    Texas Information Services | paying you? Of course,if the network
    http://www.txis.com        | is up, then we obviously don't need
    Austin Office 512 328-8947 | you, so why are we paying you?" ©VLG
    
    
  • CPUMANCPUMAN Posts: 55
    edited 2005-06-20 22:31
    I off hand don't know a·IC that'll completely do the dirty work.· Max makes a chip that'll controll a 8x8 dual color (8x16) display but not a 8x8 tri color (8x24) display. I took apart an old Real Color Displays RC880 to try and fix (still working on that, but thats for another post lol) and they employ a simple method·for controling all 560 LEDs on that display.· The display is in a 7 rows by 80 columns configuration.· What they did is they strobe the 7 rows and then had 10 octal shift registers controlling each column.· But as I've mention before I've done that with not so great result.· The thing is they used a Z80 to run the display which is significantly faster then the stamp, as it takes a bit of time to shift out 80 bits.· I'm planning to get one of these RGB LED diplays as well (I just got to quit being cheap and buy it already) and when I do I, despite my love of the stamp, am going to use a diffrent controller, something with more memory and that is faster.

    So the short answer is off hand I'm not aware of a chip that'll do this, unless someone wants to code one in VHDL, would be an interesting challenge.· Best bet is to prototype with a stamp using shift registers or latches and then move the prototype onto a faster and higher memory MCU.

    Chris
  • FriscoZRFriscoZR Posts: 4
    edited 2007-06-21 17:01
    Ryan,

    There are a lot of people doing what you want to do. I do this stuff for a living.
    I'd recommend using TI tlc5941 it's a little cheaper than the 40 and you won't need the eeprom if you're scanning multiple rows - it's a waste of money. The '41·should be available in small quantities from Digikey. They also have some new parts you should look at before deciding.
    Anyway, you need a multiplexer for each row. This will be a 74xxx138 (or 238) or equivalent for 8 rows you can also parallel them to drive more rows and use the selection bits to address them properly. The outputs of the 3-to-8 will drive a transistor/fet circuit that will provide power to the common anodes of each row in sequence. Then you can drive each led suedo individually - it will appear that way anyway. You just have to sequence and shift the data out with the proper timing. The '41 will also allow you do do dot correction to get better color balance/matching between the die that was used to create the module. This can be a task to accomplish but being an eng student (hope your an ee), you should be up for the task and would probably get ex credit if you can pull that off. You may contact me directly if desired - I won't hand this to you on a silver platter since it looks like a project.

    You may contact me at· mpope· at· ipdisplays dot com should you want to discuss this further.
    ·
  • FriscoZRFriscoZR Posts: 4
    edited 2007-06-21 17:16
    CPUMAN,
    What is the 595 chip you are talking about. Is that a partial part number? Who's the mfg? I'm not familiar with that general reference.
  • CPUMANCPUMAN Posts: 55
    edited 2007-06-22 06:25
    The 595 is an octal shift register. It's probably the simpliest method of I/O expansion since all you have to do to use it is shift out the bit pattern you want. For a much better explination on what the 595 does take a look at the Stamp Works manual (http://www.parallax.com/dl/docs/books/sw/Web-SW-v2.1.pdf) experiment #23 explains it pretty well.

    As for a mfg, the 595 model number just specifies the chip, many mfg's make this chip so it's pretty easy to come by and I know parallax sells them as well, or at least the last time I checked anyway.

    I've picked up one of these RGB 8x8 units but haven't had time to expirement with it yet due to I've just started a new job.

    Post Edited (CPUMAN) : 6/22/2007 6:30:38 AM GMT
  • FriscoZRFriscoZR Posts: 4
    edited 2007-06-22 13:55
    OK, Thanks.

    I was expecting a little more complicated part for driving LEDs, since I mainly deal with matrix style displays.
    The part is a 74xxx595 and is a great part for connecting to I/O on a microcontroller. ST also has a driver part that ends in 595.
    Most people prefer to use the same part with constant current source outputs for driving groups of LEDs to get better color and intensity matching. And there are quite a few companies that make those sytle of parts. TI, Silicon Touch, Toshiba, ST, Macroblock, Sanyo, Maxim and many more... They're just not as cost effective as a '595 if you don't care about the constant current.

    Who is selling the Cotco/Lite Engine parts in the US? $95 for 1 seems a bit high. If it's Marktech, I didn't find it on their website. Of course I didn't look very hard to find it either so it wasn't an obvious catch/find on the site.

    Post Edited (FriscoZR) : 6/22/2007 2:17:07 PM GMT
  • FriscoZRFriscoZR Posts: 4
    edited 2007-06-22 14:13
    Ryan,

    I looked at the datasheet you posted. Since your green is ~574nm instead of what's called a pure green ~525nm you will have an interesting task of getting a decent white. It will not be 255,255.255. This will give you a purple-pink color - refer to a CIE color chart. You will have to play with intensity of the LEDs and possibly the rgb value to get a good white. I'd eventually use a conversion table in sw to do this. Hopefully your processor has some good table lookup instructions. But your display is small so this may not matter.

    Good luck on your project - let us know how it turns out.
Sign In or Register to comment.