RGB 16x23 matrix with arduino wire.h library

by jsissom on Sat Mar 23, 2013 2:26 pm

There seems to be a conflict between the Arduino RGB Matrix library and the wire.h library. Just including the wire.h file in the sketch will cause the RGB panel to stop working.

Has anyone found this and come up with a work-around to it?

Thanks
Jay
jsissom
 
Posts: 20
Joined: Thu Aug 18, 2011 8:19 pm

Re: RGB 16x23 matrix with arduino wire.h library

by adafruit_support_mike on Sun Mar 24, 2013 2:11 pm

That's a known issue. The Wire library blocks while it waits for the microprocessor to handle the I2C communication, and that would play havoc with the matrix controller's timing.

Your best bet is to use the softI2C libraries instead of Wire: http://code.google.com/p/rtoslibs/downloads/list
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 8599
Joined: Thu Feb 11, 2010 1:51 pm

Re: RGB 16x23 matrix with arduino wire.h library

by jsissom on Mon Mar 25, 2013 9:51 pm

Thanks. This library does pretty much the same thing. As soon as I declare a variable that uses the I2C class, the display stops working.

Before your post, I was starting to write my own I2C library. I was hopeful this would solve it, but it doesn't look like it. :( Back to debugging.
jsissom
 
Posts: 20
Joined: Thu Aug 18, 2011 8:19 pm

Re: RGB 16x23 matrix with arduino wire.h library

by pburgess on Mon Mar 25, 2013 10:40 pm

It's RAM-related, actually. The RGB matrix uses nearly all available memory (little over 200 bytes free, if using double-buffered mode), and the Wire library is HUNGRY.

One solution is to use single-buffered mode, though the display will flicker as it's redrawn.

Another is much more involved. When I needed to interface a realtime clock chip, I wrote a much, MUCH stripped-down library to handle the I2C communications without the big RAM overhead of the standard library for that.
User avatar
pburgess
 
Posts: 2435
Joined: Sun Oct 26, 2008 1:29 am

Re: RGB 16x23 matrix with arduino wire.h library

by jsissom on Tue Mar 26, 2013 10:13 am

I tried the one posted by mstone@yawp.com which seems much smaller than wire.h with no success. I'm still working on my own but I'll try to modify the other one (since it works) to see if I can make it take less RAM.

But if RAM is the issue this probably won't help because I would like to drive 2 cascaded displays. Maybe I could strip down the matrix library to handle exactly what I need. Or it might be time for a different CPU.

Thanks
jsissom
 
Posts: 20
Joined: Thu Aug 18, 2011 8:19 pm

Re: RGB 16x23 matrix with arduino wire.h library

by Jerware on Sun Feb 23, 2014 2:27 am

pburgess wrote:When I needed to interface a realtime clock chip, I wrote a much, MUCH stripped-down library to handle the I2C communications without the big RAM overhead of the standard library for that.


I'm trying to do this exact thing. Any chance of you sharing your stripped down library? :)
User avatar
Jerware
 
Posts: 16
Joined: Fri Aug 31, 2012 6:13 pm
Location: San Francisco, CA

Re: RGB 16x23 matrix with arduino wire.h library

by jmcclaire on Thu May 08, 2014 1:25 pm

I successfully got 3 Uno's talking to each other through I2C. One master and two slave. The two slaves are driving a 16x32 LED matrix each. Def has flickering. I'm going to switch my slaves from Uno's to Mega 2560's and see if that helps. I'll let ya'll know how it goes!

- John
jmcclaire
 
Posts: 33
Joined: Mon Nov 14, 2011 1:39 pm

Re: RGB 16x23 matrix with arduino wire.h library

by jmcclaire on Thu May 08, 2014 1:49 pm

It is MUCH better using the Mega 2560. Barely can notice the flicker. I'm going to be animating images on the panel so won't even notice it :)

- John
jmcclaire
 
Posts: 33
Joined: Mon Nov 14, 2011 1:39 pm

Re: RGB 16x23 matrix with arduino wire.h library

by jmcclaire on Thu May 08, 2014 3:19 pm

Also, I had to use this library instead of the standard Wire library because it's too heavy and doesn't do well with the matrix library on top of it: https://github.com/todbot/SoftI2CMaster

I'll post my code once the project is finished. It's going to be epic when I'm done!

- John
jmcclaire
 
Posts: 33
Joined: Mon Nov 14, 2011 1:39 pm