Skip to main content
Topic: Controller Board for Adafruit's Large RGB Matrix Displays (Read 170274 times) previous topic - next topic

Controller Board for Adafruit's Large RGB Matrix Displays

Update May 17 2014:
The SmartMatrix Shield is available for purchase, and is shipping now.  Click on the "shop" link in the header of SmartMatrix Docs (ships from China) or visit Adafruit to purchase.

All source and the hardware design is up on GitHub, view the link at SmartMatrix Docs.  The board file for the shield is up as an OSH Park shared project, use google to find it.

-----------------

I’m working on a controller board for the 16x32 and 32x32 RGB LED Matrix Displays you may have seen at Adafruit and Sparkfun. 
http://www.adafruit.com/products/420
https://www.sparkfun.com/products/12583
http://www.adafruit.com/products/1484
https://www.sparkfun.com/products/12584

After seeing Paul’s post on driving WS2811 LED strips with DMA on the Teensy 3.0 (http://www.pjrc.com/teensy/td_libs_OctoWS2811.html), I looked into driving the Matrix displays with DMA and now have the basics of a driver working.  The Arduino really struggles to drive these displays, but the Teensy 3.0 with DMA is able to update them at a high frame rate with CPU left over to do other stuff.  I’m working on releasing an open source library for driving the displays, and want to release a open source breakout board as well.

The breakout board design is pretty simple.  It’s physically similar to the nootropic design Arduino-based kit http://nootropicdesign.com/matrixbackpack/index.html.  It will connect a Teensy 3.0 or 3.1 to either a 16x32 or 32x32 Matrix, supply power, and bring the unused pins of the Teensy out to headers.  I tried to leave enough useful IO free so the Teensy can connect to most external components.

Here’s what the board looks like so far:
[attachment=3]

Here’s a picture of the 10 free GPIO on the Teensy showing what they can be used for:
[attachment=2](picture from http://www.pjrc.com/teensy/pinout.html)

Here’s crude pictures of how the board will mount to the displays:
[attachment=0][attachment=1](Matrix pictures from Sparkfun)

The board can also be connected to the display using male headers and a ribbon cable if that makes more sense for a particular project.  I didn’t add any mounting holes to the board as they are not practical when the board is installed directly on the display.  Let me know if you think mounting holes are a good idea for the ribbon cable connection option, and I can increase the board size a bit and add some.

Edit - Power supply options are explained clearly in a followup message below

Please let me know if you have any feedback on the board design before I route the board and order the first prototypes.  I’m hoping to have the library and tested board design ready to publish within a month, hopefully sooner.

Re: Controller Board for Adafruit's Large RGB Matrix Display

Reply #1
I think I found a mistake in the Teensy schematic, and if Paul confirms I'm right, there's at least an option to connect up both power sources to the Teensy without losing the USB fuse.  I'll post back after I find out more.

Re: Controller Board for Adafruit's Large RGB Matrix Display

Reply #2
Posted on the blog, didn't realise this was in the forum.  The Teensy3.1 is out now, which I would think would be handy here.

Re: Controller Board for Adafruit's Large RGB Matrix Display

Reply #3
[quote author="Sleepwalker3"]Posted on the blog, didn't realise this was in the forum.  The Teensy3.1 is out now, which I would think would be handy here.[/quote]

Yes, I started the project just before the Teensy 3.1 came out.  I'll make sure the library and breakout board works with both Teensy 3.0 and 3.1.

Re: Controller Board for Adafruit's Large RGB Matrix Display

Reply #4
Reset Pin is different, but most other things are compatible.

Re: Controller Board for Adafruit's Large RGB Matrix Display

Reply #5
Nice work.
I created an implementation that extends the Teensy DMA method and does not use any software/interrupts beyond setting it up initially. 100% of the work is handled in the hardware by timers and DMA, outputting a buffer to the ports. This saves you from the timing critical aspects of the Teensy implementation and allows you to simply write to a framebuffer and have the framebuffer flush to DMA in the background.

I have a demo of the library on an STM32F3-Discovery board with ChibiOS on github - http://https://github.com/omriiluz/WS2812B-LED-Driver-ChibiOS
take a look at LEDDriver.c, should be easy to port to other architectures than the stm32.

I hope to find time and post on my blog a detailed description of how it works, you can look at the code, it's pretty self explanatory.
I'm happy to answer any questions.

Re: Controller Board for Adafruit's Large RGB Matrix Display

Reply #6
[quote author="MrOI"]I created an implementation that extends the Teensy DMA method and does not use any software/interrupts beyond setting it up initially.[/quote]

I see you're using the STM32 processors.  I'd like to use them in a future project.  They have some inexpensive models with USB, and DMA is fairly common on the lower variants as well.  I'll bookmark your project for reference when I pick up my STM32 dev board again.

Re: Controller Board for Adafruit's Large RGB Matrix Display

Reply #7
After thinking about the power supply options some more, I thought I should just simplify it:
1. Default: Teensy is powered from USB
2. Option: Teensy powered from External Power.  Requires cutting a trace on the Teensy to disconnect USB power.

I did some brief testing today, switching the display between driving no LEDs, and all LEDs on a row at full white.  I’m powering my display with a 5V 4A power supply, and the voltage was dropping by up to 700mV when driving white.  I don’t want that dramatic ripple going to the microcontroller's regulator, so I'm adding a cap to Vin, and a diode to separate Vin from the external 5V supply.

Here's what the board looks like after adding those items.  I'm going to route and order prototypes from OSH Park tomorrow hopefully.

[attachment=0]

Re: Controller Board for Adafruit's Large RGB Matrix Display

Reply #8
It's been a week, I should probably post an update. 

I ordered boards from OSH Park last Saturday and they are due to arrive at the end of the month.

I've been working on the firmware, mostly behind the scenes stuff like tweaking how DMA is used to refresh the display so I can store data in a more efficient way.  Most of my work has been spending hours to get all the settings right across 4 DMA channels with the result of no visible change on the display, so not the most exciting work.

Tonight I finished a milestone which was updating the buffers and refreshing the display completely automatically using ISRs, without the user's loop() code needing to call anything.  Updating the buffers is done inside a software interrupt at the lowest priority so it won't interfere with any other interrupts.  With that done, I can finally spend all my time in the user loop drawing something to the display.  Here's a quick demo of drawing random rectangles to the screen, with a scrolling text overlay (scrolling text is handled in the background by the library).

https://www.dropbox.com/s/11bm3jpgcdrel ... .01.04.mov

As usual with these things, it looks much better in real life than on camera.

Re: Controller Board for Adafruit's Large RGB Matrix Display

Reply #9
Hi EmbeddedCreations

I was planning on doing this exact thing for a gift, do you have a git hub of your library? I am still waiting on my matrix to arrive but wanted to sink my teeth into some code before they show up.

Re: Controller Board for Adafruit's Large RGB Matrix Display

Reply #10
Quick update for now, and I'll post more later.  I received boards from OSH Park last week, and they were quite functional, but I made a few tweaks, and just ordered what I expect will be the final version.

@Mika571: I don't have any code ready to share right now, and probably won't put anything on github until my kit is ready for ordering.  I'm looking for a limited number of people willing to beta test early code, email me (you can figure out my email address from my signature) if you're interested.

Re: Controller Board for Adafruit's Large RGB Matrix Display

Reply #11
Here are some pictures of the first prototypes, showing different connector options:
Female header vs polarized male header and IDC cable
4-pin molex vs terminal block for power
Teensy plugged directly into board, vs adding female headers so the Teensy can be removed

[attachment=4]
[attachment=3]
[attachment=2]
[attachment=1]
I’m not the biggest fan of using the female header to attach directly to the display.  The board sticks out about 1.5cm above the display frame, and the female connector is significantly smaller than the polarized connector housing on the display.  It’s quite easy to misalign the connectors and plug the board in wrong.  There’s no easy way to secure the board to the display, though the connector does grip quite well.

[attachment=0]
The board looks significantly better with the Teensy soldered directly, instead of with the female headers, but I want to keep the option for people who want to remove their $20 Teensy board to use with another project.  I plan to ship the kit with connectors for all the above options.

I made some revisions to the board, significant ones are listed below:
- Replaced 3.5mm terminal block with 5.0mm terminal block that can accept larger gauge wire that may be required depending on the display power cable
- Adjusted shrouded header to fit properly on the board
- Added 3.0mm mounting hole to corner of board
- Removed capacitor - testing showed it wasn’t necessary to provide a clean power supply to the Teensy

This hopefully final version is due back from OSH Park the week of the 17th, but they might be early again.  I’m going to finish up the library functionality in the meantime, and will post more on that in a week.

Re: Controller Board for Adafruit's Large RGB Matrix Display

Reply #12
The firmware is still far from done, though I made good progress in the last week.  I rewrote the code that does the scrolling text layer above the graphics layer to be much more readable and more efficient.  I wrote graphics functions that have a similar interface and feature set to the Adafruit Graphics library, doing everything except for the the setCursor() and print() support which I'll come back to later.  I tried running code on the Teensy 3.1 vs the 3.0 I've been developing on, and it worked without any issues.  I received a 32x32 display, and while my code does work after changing a couple definitions, there's an occasional flicker I need to track down.

The boards from OSH Park haven't shipped early like I was hoping they might.  If they don't ship tomorrow it will be a longer wait than I thought as Monday is a holiday in the US.  I have plenty to do on the firmware in the meantime.

Re: Controller Board for Adafruit's Large RGB Matrix Display

Reply #13
Great work! Do you achieve 24bit color on the 32*32 panel?

My 32*32 panel is on its way, and I am really looking forward to trying your library.

Re: Controller Board for Adafruit's Large RGB Matrix Display

Reply #14
Yes, my code was doing 24-bit color at 60Hz on the 32x32, with the occasional flicker.  I'm sure it's something I can fix.  I'm far from maxing out the RAM and CPU.