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

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

Reply #195
Thanks, Louis.  I just ordered a Bluefruit LE from Adafruit, and a MSGEQ7 Spectrum Shield from Sparkfun.  Can't wait to try them out on my current board.  :)

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

Reply #196
By the time you add up a Teensy, A CC3000, and the SmartMatrix Shield shield - seems like might as well
use a CC3200 Launchpad (sorry, forum software won't let me post a link to it.)
Gives you the WiFi, an 80 MHz ARM processor, and a boosterpack connector.
Of course it might not be as compact, and have to arrange a connector for the RGB matrix.

I haven't looked at the CC3200 library, but it shouldn't be too hard to adapt drivers for it,
either from the Teensy SmartMatrix driver, or from the RGB matrix drivers for TI's Tiva Launchpad which I have been working on
(based on Adafruits RGBmatrix driver).

Had a couple of questions about the SmartMatrix driver:
How many refreshes/second can it do with 24 bit color?  I realize it is set for 120 refreshes, but is that about the limit?  Can it go faster on 73MHz Teensy 3.1?

About what percent of processor time is used by the display refresh (or conversely, what percent of time is available)?

Doesn't doing all the bit-rearrangement in loadMatrixBuffers take a lot of time?  Seems like might be more efficient to store the
pixels in a sliced up form (similar to what RGBmatrix driver does).  Takes more time to read/write a pixel, but refreshes
are more frequent than pixel read/writes.  I would be curious for your perspective.

Pretty neat figuring out how to do so much of it with DMA.

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

Reply #197
Quote
By the time you add up a Teensy, A CC3000, and the SmartMatrix Shield shield - seems like might as well
use a CC3200 Launchpad

True, but the advantage of using the Teensy is Arduino compatibility, so people can easily use the library to create something with it. 

The CC3200 looks pretty good, I knew it existed but didn't take a closer look until now.  The DMA engine seems capable of driving the matrix display.

I have briefly considered porting the library to the Spark Core, which contains a STM32 with DMA and the CC3000.  Figuring out the idiosyncrasies of another DMA engine isn't trivial though, and Spark's IDE is much further behind Arduino at least right now. 

I haven't benchmarked the driver in a while, but it was using roughly 10% of the CPU at 70Hz refresh I believe.  I've run it much higher than 120 Hz, but don't see a reason why that is necessary.

Storing pixels in a sliced up form takes more than double the amount of memory as storing it as a normal bitmap, as each 6-bit word on the bus is stored as two full bytes, with a pair of clock pulses high and low to get the GPIO to toggle the clock line using sequential DMA writes.

Thanks for your comments/questions!

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

Reply #198
[quote author="EmbeddedCreations"]
Quote
By the time you add up a Teensy, A CC3000, and the SmartMatrix Shield shield - seems like might as well
use a CC3200 Launchpad

True, but the advantage of using the Teensy is Arduino compatibility, so people can easily use the library to create something with it. 
[/quote]

Energia is the port of the Arduino environment and library for TI Launchpads.  The version for the CC3200 is in beta testing, so Arduino compatability should be available presently.

[quote author="EmbeddedCreations"]
I haven't benchmarked the driver in a while, but it was using roughly 10% of the CPU at 70Hz refresh I believe.  I've run it much higher than 120 Hz, but don't see a reason why that is necessary.
[/quote]

Thanks.  I was curious to see how it compared to the driver I have been working on.
I took the approach of directly adapting Adafruits RGBmatrix driver to work on other platforms -
i.e. adapt the Timer and PIO calls. 
I suspect this makes porting it a bit less tricky than using DMA (in addition to the TI Tiva,
which was my main/initial target, I have mostly done an adaptation for the Atmel SAM (Arduino Due)).

Can't do a really fair comparison at this point, since the AdafruitGFX interface limits my
driver to 5 bits per color.  But at 4/4/4 color the Tiva driver takes a bit over 3% CPU time at 70 Hz on an 80 MHz Stellaris processor.  I estimate it would be about 8% with 24 bit color.  (Assuming can keep the refresh reasonable. With 4/4/4 color can do 900 Hz refresh.)  So the CPU use looks at least roughly comparable.

If you can do much higher refresh rates you might be able to do more bits of color
(e.g. have you tried 9/9/9 color).

Another use for higher refresh rates - one can do fades between two immages by switching which immage is
displayed (gradually show more of the new and less of the old) and let the eye do the averaging.
(Only works with a prety high refresh rate.)

Since you extended the AdafruitGFX interface to handle higher color, figured I would adapt the
SmartMatrix to separate the interface from the processor specific implementation, and use it
as a high color interface for the Tiva RGBmatrix driver.


[quote author="EmbeddedCreations"]
Storing pixels in a sliced up form takes more than double the amount of memory as storing it as a normal bitmap, as each 6-bit word on the bus is stored as two full bytes, with a pair of clock pulses high and low to get the GPIO to toggle the clock line using sequential DMA writes.
[/quote]

I was thinking of storing them sliced, but without the doubling to handle the clock bits.
That way the space increase would be more modest.  (6 bytes for two pixels becomes 8 bytes for two pixels)
Then all you have to do to prepare for DMA is copy the byte to the DMA buffer, then combine the byte with a mask (to set or clear the clock bit) and save the combined byte in the DMA buffer.  Should be much faster than
all the bit slicing and combining.

Thanks.

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

Reply #199
New SmartMatrix Application

Hello all,

I've created another wild, crazy and colorful application for the SmartMatrix, unrelated (at this time) to the Light Appliance. I call it Randomness and it is available at: https://github.com/CraigLindley/Randomness. This application doesn't require any hardware modifications or additions. It runs on the stock SmartMatrix display.

It uses the alpha mixing changes I made to the SmartMatrix library, all of which are documented in the comments in the sketch. As I said in the repository readme:

"One might consider this an art piece; others might consider this junk. You choose (;>)"

This looks very abstract when used with diffusion on the SmartMatrix.

Have fun!

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

Reply #200
Just wanted to let people know that the October issue of Nuts and Volts magazine will have the Light Appliance article I wrote. Unfortunately, the Light Appliance did not make the cover of the magazine.

Craig Lindley

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

Reply #201
I'm working on a major update to the SmartMatrix Library, and the code is available from the master branch in GitHub now.  The draft release notes are below, but here's the major features:

36/48-bit color support - A lot of LED displays are limited to 24-bit color but I found a way to drive the displays with higher color depth.  This makes for better subtle color changes, and fades to and from black look really nice when using the default color (gamma) correction settings and 36-bit color.  48-bit color may be overkill, it's supported, but the difference from 36-bit color is minimal.

FastLED support - The FastLED library is a great library for working with LED strips, and there's a great community around the library and lots of examples of how to make cool looking LED effects.  FastLED's authors were very receptive to a user's request about adding support for SmartMatrix, and even made some efficiency improvements to SmartMatrix.  There are two examples of FastLED integration included in the SmartMatrix library showing how easy it is to make some cool effects.

Animated GIFs example - I added Craig Lindley's Animated GIFs sketch and added it as an example in SmartMatrix. 

Background Dimming - this is made possible by the 36/48-bit color support.  You can now set the background layer brightness so that it is dimmer than the foreground.  This is good for a clock display for example, so the time would be readable even with a bright background.  The dimming is done with a gamma correction lookup table stored in RAM with very little effect on performance.

Lots more in the release notes.  I'm hoping to push out an official release by the end of the week, please let me know if you try the code and see any issues.

Release Notes:
http://https://gist.github.com/pixelmatix/2f42350dae7841ef94c3

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

Reply #202
Louis,

I completely deleted my old version of your library and downloaded your new version along with the FastLED library.
My Light Appliance sketch runs perfect. I don't see any differences at all. However when I try to use the examples included in your library I get weird results.

1. The AnimatedGIFs example doesn't show up at all in the IDE and therefore cannot be selected
2. The FeatureDemo runs for a rather long time and then hangs completely. This happened 3 times in a row.
3. Neither of the FastLED demos will compile.

FastLED_Controller.ino Example
===========================

FastLED_Controller.ino: In function 'void setup()':
FastLED_Controller:74: error: 'SMART_MATRIX' was not declared in this scope
FastLED_Controller:74: error: no matching function for call to 'CFastLED::addLeds(CRGB [1024], int)'
FastLED_Controller.ino:74:43: note: candidates are:
In file included from FastLED_Controller.ino:10:0:
/Users/craiglindley/Documents/Arduino/libraries/FastLED/FastLED.h:52:88: note: template<ESPIChipsets CHIPSET, unsigned char DATA_PIN, unsigned char CLOCK_PIN> CLEDController* CFastLED::addLeds(const CRGB*, int, int)
/Users/craiglindley/Documents/Arduino/libraries/FastLED/FastLED.h:52:88: note:  template argument deduction/substitution failed:
FastLED_Controller:74: error: template argument 1 is invalid
In file included from FastLED_Controller.ino:10:0:
/Users/craiglindley/Documents/Arduino/libraries/FastLED/FastLED.h:60:106: note: template<ESPIChipsets CHIPSET, unsigned char DATA_PIN, unsigned char CLOCK_PIN, EOrder RGB_ORDER> CLEDController* CFastLED::addLeds(const CRGB*, int, int)
/Users/craiglindley/Documents/Arduino/libraries/FastLED/FastLED.h:60:106: note:  template argument deduction/substitution failed:
FastLED_Controller:74: error: template argument 1 is invalid
In file included from FastLED_Controller.ino:10:0:
/Users/craiglindley/Documents/Arduino/libraries/FastLED/FastLED.h:68:129: note: template<ESPIChipsets CHIPSET, unsigned char DATA_PIN, unsigned char CLOCK_PIN, EOrder RGB_ORDER, unsigned char SPI_DATA_RATE> CLEDController* CFastLED::addLeds(const CRGB*, int, int)
/Users/craiglindley/Documents/Arduino/libraries/FastLED/FastLED.h:68:129: note:  template argument deduction/substitution failed:
FastLED_Controller:74: error: template argument 1 is invalid
In file included from FastLED_Controller.ino:10:0:
/Users/craiglindley/Documents/Arduino/libraries/FastLED/FastLED.h:92:18: note: template<EClocklessChipsets CHIPSET, unsigned char DATA_PIN> CLEDController* CFastLED::addLeds(const CRGB*, int, int)
/Users/craiglindley/Documents/Arduino/libraries/FastLED/FastLED.h:92:18: note:  template argument deduction/substitution failed:
FastLED_Controller:74: error: template argument 1 is invalid
In file included from FastLED_Controller.ino:10:0:
/Users/craiglindley/Documents/Arduino/libraries/FastLED/FastLED.h:109:18: note: template<EClocklessChipsets CHIPSET, unsigned char DATA_PIN, EOrder RGB_ORDER> CLEDController* CFastLED::addLeds(const CRGB*, int, int)
/Users/craiglindley/Documents/Arduino/libraries/FastLED/FastLED.h:109:18: note:  template argument deduction/substitution failed:
FastLED_Controller:74: error: template argument 1 is invalid
FastLED_Controller:83: error: 'pSmartMatrix' was not declared in this scope
FastLED_Controller.ino: In function 'void fillnoise8()':
FastLED_Controller:105: error: 'inoise8' was not declared in this scope
FastLED_Controller.ino: In function 'void loop()':
FastLED_Controller:132: error: 'pSmartMatrix' was not declared in this scope
FastLED_Controller:136: error: 'class CFastLED' has no member named 'countFPS'

FastLED_Functions.ino Example
===========================

Arduino: 1.0.5 (Mac OS X), Board: "Teensy 3.1"
FastLED_Functions.ino: In function 'void fillnoise8()':
FastLED_Functions:72: error: 'inoise8' was not declared in this scope
FastLED_Functions.ino: In function 'void loop()':
FastLED_Functions:93: error: no match for 'operator=' in '*(buffer + ((sizetype)(((unsigned int)((j * 32) + i)) * 3u))) = CRGB((*(const CHSV*)(& CHSV(noise[j], 255u, noise[j]))))'
FastLED_Functions.ino:93:75: note: candidates are:
In file included from FastLED_Functions.ino:8:0:
/Users/craiglindley/Documents/Arduino/libraries/SmartMatrix/SmartMatrix.h:68:16: note: rgb24& rgb24::operator=(const rgb24&)
/Users/craiglindley/Documents/Arduino/libraries/SmartMatrix/SmartMatrix.h:68:16: note:  no known conversion for argument 1 from 'CRGB' to 'const rgb24&'
/Users/craiglindley/Documents/Arduino/libraries/SmartMatrix/SmartMatrix.h:68:16: note: rgb24& rgb24::operator=(rgb24&&)
/Users/craiglindley/Documents/Arduino/libraries/SmartMatrix/SmartMatrix.h:68:16: note:  no known conversion for argument 1 from 'CRGB' to 'rgb24&&'
FastLED_Functions:101: error: no matching function for call to 'SmartMatrix::fillCircle(int, int, int, CRGB)'
FastLED_Functions.ino:101:77: note: candidates are:
In file included from FastLED_Functions.ino:8:0:
/Users/craiglindley/Documents/Arduino/libraries/SmartMatrix/SmartMatrix.h:119:10: note: void SmartMatrix::fillCircle(int16_t, int16_t, uint16_t, const rgb24&, const rgb24&)
/Users/craiglindley/Documents/Arduino/libraries/SmartMatrix/SmartMatrix.h:119:10: note:  candidate expects 5 arguments, 4 provided
/Users/craiglindley/Documents/Arduino/libraries/SmartMatrix/SmartMatrix.h:120:10: note: void SmartMatrix::fillCircle(int16_t, int16_t, uint16_t, const rgb24&)
/Users/craiglindley/Documents/Arduino/libraries/SmartMatrix/SmartMatrix.h:120:10: note:  no known conversion for argument 4 from 'CRGB' to 'const rgb24&'
FastLED_Functions:105: error: 'class CFastLED' has no member named 'countFPS'

Maybe this has something to do with the version of FastLED I downloaded or is just something I am doing wrong.

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

Reply #203
Looks like you might need to checkout the FastLED2.1 branch and make sure to pull Daniel's latest changes.  He renamed an enum from SmartMatrix to SMART_MATRIX to fix a name collision.

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

Reply #204
Hi Craig,

Make sure you have the FastLED2.1 branch.  It's not the default branch for FastLED.

AnimatedGIFs has it's own repo on GitHub, and is added to SmartMatrix as a submodule.  If you check out SmartMatrix using a git tool, it will include the files for AnimatedGIFs.  Downloading as a zip from the repo overview doesn't include it though.  It will be included in the release zip.
Just download it separately here:
https://github.com/pixelmatix/AnimatedGIFs

Thanks for pointing out the issue with FeatureDemo.  It worked a few commits ago, I'll trace down why it's not working now.

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

Reply #205
Quote
The FeatureDemo runs for a rather long time and then hangs completely. This happened 3 times in a row.

Can you be more specific on "rather long time"?  Did it run through a loop and start repeating?  Where did it hang?

I just ran FeatureDemo again and I saw no issues and it continued past one loop.

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

Reply #206
Hi Louis,

Yes things are working better now. I initially followed the link in your release note for FastLED but didn't select the 2.1 release. Can you specify a link that goes directly to the 2.1 release? If not you might want to make a comment about selecting the 2.1 release in the github gui.

I downloaded AnimatedGIFs and it works fine.

The two FastLED demos now work. The FastLED stuff is rather amazing. I'll have to look into this.

The FeatureDemo still hangs every time at the Brightness demo. I don't see any message in the Serial Monitor. My display just goes dark and they two horizontal line are drawn in gold and that is all she wrote.

Craig

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

Reply #207
Hi Craig,

The 100% white of the brightness demo draws the most current from the power supply, around 3.5A max.  If you're using a 2A supply, maybe that's what is causing issues.  If you have a 4A supply, give that a try.  I've been running FeatureDemo on two of my displays for over an hour with no issues.

Take a look at the FastLED Google Plus community, there are people sharing a lot of cool stuff:
https://plus.google.com/communities/109 ... 4227823508

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

Reply #208
That is probably what the problem is. I actually back down the brightness on the Light Appliance to allow my 2Amp power supply to work.

Sorry for the noise

Craig

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

Reply #209
It's useful noise. :-)  This is the first report I've heard of the how the 2A supply can cause a sketch to fail, I'll keep it in mind for troubleshooting later.