DMD PWM

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
milamber
Posts: 12
Joined: Wed Mar 14, 2012 7:08 am

Re: DMD PWM

Post by milamber » Tue Apr 10, 2012 9:24 pm

Hey jonoxer. I post all this up here for anyone to use so feel free. :)

The display is being feed a video file that has been down converted and then sent serially to the Arduino. And yes they were faces (it was a music video). As I said it works much better in high power mode and at a distance. If you are interested in how I am converting and sending the video I have a post running in the Arduino Forum about it (http://arduino.cc/forum/index.php/topic,72474.0.html).

My goal is to make my own LED video wall/Sign. My goal resolution at the moment is 64x64. So 1 DMD is only an 1/8th of the size I want to be at.

This has been a long running project for me and I hope the DMD will save me significant time because at one stage I was looking at hand making the 64x64 matrix and all the drivers to make it go. If I can get the DMD to perform then I wont need to make all that.....I can just buy the right number of DMD's!

I will try and get the library into shape soon. Its just I don't have lots of time to spend on it and currently its called ShiftMatrixPWM, which is written through out the code. I want to clean it up and evolve the names as I have modified things substantially under the hood to make it work with the DMD. I don't want people to get the version from here thinking its the same as from the Arduino forum so I want to change the names and calls inside the library first.
Last edited by milamber on Wed Apr 11, 2012 3:35 am, edited 1 time in total.

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 298
Joined: Sat Oct 15, 2011 11:31 am
Location: Melbourne, Australia
Contact:

Re: DMD PWM

Post by jonoxer » Wed Apr 11, 2012 1:58 am

Thanks, I'll do a blog post about it soon!

About the link: sure, feel free to cross-link to/from the official Arduino forum. I'd be interested to see that thread.
--
Jon

milamber
Posts: 12
Joined: Wed Mar 14, 2012 7:08 am

Re: DMD PWM

Post by milamber » Wed Apr 11, 2012 4:03 am

I updated it in the post above :)
http://arduino.cc/forum/index.php/topic,72474.0.html
As you can see I have been working on this for a while. And that thread doesn't even cover my really early experiments with a system/design called "Peggy 2.0"

My Concern with the current code is that Elco's implementation of PWM chews up a lot of CPU time. Especially when you are talking about 1 or 2 DMD's. It works very well on smaller matrices (8x8 or 16x16 even) but the DMD starts at 16x32. With 2 side by side that 16x64, that's a large amount of shifting and CPU overhead. Some research I was doing on how to lower the CPU use, lead me to BCM(Bit Code Modulation)/BAM(Bit Angle Modulation). I wasn't able to find an implementation of it through shift registers on the Arduino. I am wondering if it is worth the effort to try and setup BCM/BAM or just get this library working properly? Any suggestions?

If we could get BCM/BAM to work it would significantly lower the shifting and CPU overhead. Currently with 32 brightness levels there is 32 equal time slices, with BCM/BAM there would only be 4 but they are of varying time lengths. If this is confusing let me know and I will try and find a page with a better explanation.

milamber
Posts: 12
Joined: Wed Mar 14, 2012 7:08 am

Re: DMD PWM

Post by milamber » Sun Apr 15, 2012 2:09 pm

Alright. I had some time this weekend to work on this further and I now have PWM working across 2 DMD's side by side. This means I have 16x64 at 50hz with 32 brightness levels. It has taken a lot of squeezing and cursing to make it work but I have got there. And here is a short video of it displaying a fire effect:
http://vimeo.com/40394999

Now all that's left is for me to clean up my test code (there is alot of commented out code that didn't work) and a couple of little tweaks (setup differences between 1 DMD and 2). Once those are sorted I will be able to post the library. As I said before, this library wont do anything other than implement the PWM and have a method of setting a single pixel x,y to a brightness value. In the video you see above all the "Heavy lifting" is being done on a PC. It is streaming a full frame of data down in the "Correct" sequence for this library to display it. For the Arduino to do the x,y pixel setting it is a little slower. Still very usable but I am trying to do video so I need it to be as fast as possible.

As for the BCM/BAM from the last post, I am still interested but decided to get this base library running. Then maybe as a community we can look at changing it. As this would need a significant re write of the library to implement.

As an aside I have made a lot of changes to the processing script I am using to convert the video(original code for it is in the Arduino forum link above). Would anyone be interested in seeing the code used to stream the data to the Arduino? Let me know.

Hopefully I should have something for you in the next week or so. :D

milamber
Posts: 12
Joined: Wed Mar 14, 2012 7:08 am

Re: DMD PWM

Post by milamber » Tue May 08, 2012 12:33 pm

OK, so more than a week has gone by. But the library is almost ready for me to put up for you to try. Just trying to streamline it a little more and make it a little easier to use. Had to change the way I was working out the position in the matrix. I was using a complex formula to work it out but it was just too slow at crunching the numbers. I have ended up using a look up array with all the values pre-calculated and put that into PROGMEM. This has sped up the display dramatically. So much so, that you can do animation across 2 DMD's without any issue. I am just writing an example code that can show off a bit of what it can do. Hopefully people will find the example easy enough to follow and give ideas as to what can be done with the library.

I only have the one machine to test this on. I haven't tested this against the Arduino IDE 1.0, I think it should be fine, I am still running 0022.Any volunteers to test this before I post it? PM me if you want to test.

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 298
Joined: Sat Oct 15, 2011 11:31 am
Location: Melbourne, Australia
Contact:

Re: DMD PWM

Post by jonoxer » Tue May 08, 2012 12:51 pm

Sounds great! I'd be interested in giving it a try. You can ping me at jon@freetronics.com.
--
Jon

milamber
Posts: 12
Joined: Wed Mar 14, 2012 7:08 am

Re: DMD PWM

Post by milamber » Sun May 13, 2012 9:58 am

How did you go? Any luck?

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 298
Joined: Sat Oct 15, 2011 11:31 am
Location: Melbourne, Australia
Contact:

Re: DMD PWM

Post by jonoxer » Sun May 13, 2012 10:13 am

Sorry @milamber, I haven't tried it yet. Marc and I have both been jammed up getting a bunch of new devices into production, so there's been no time for extra things I want to do but don't have a hard deadline on!
--
Jon

VizzTech
Posts: 5
Joined: Fri Jun 22, 2012 12:02 pm

Re: DMD PWM

Post by VizzTech » Fri Jun 22, 2012 12:22 pm

Milamber - did you end up posting this "demo" code? I am very interested in this. Great work! :-)

milamber
Posts: 12
Joined: Wed Mar 14, 2012 7:08 am

Re: DMD PWM

Post by milamber » Mon Jun 25, 2012 7:36 am

Hi Vizztech,

I hadn't got the code up yet. I would have like to do some wider testing. I have only compiled this in the older IDE not version 1+.

I am at work at the moment. When I get home, I will see if I can check the code once more and if everything checks out I will post it up here.

Post Reply