Shinobi wrote:thank you for the quick and very useful reply! in our project, we want to make a big LED display with 4x4 of these modules (128x64px).
do you have any suggestions, how we can realize that without making too many trial and errors? what kind of microcontroller board would you suggest? we were thinking about an ardunio. is the arduino one powerful enough?
HUGE warning... This is going to be a L-O-N-G post. Go grab a cup of something now... (Make it a strong one... LOL)
It's difficult to state categorically whether an Arduino is 'powerful' enough to do what you want as the answer depends upon variables that you haven't included in your post.
Technically, it IS possible to daisy chain quite a large number of DMD panels and send data to ALL of them with an Arduino. Something you haven't mentioned though is WHICH Arduino you're considering using. You need to keep in mind that there are many different variants of Arduino and each has it's own unique constraints.
So let's start by considering some basics...
DMD Panels are not 'static' displays. They can only 'statically' display 1/4 of their pixels at any given instant. Therefore, the controller (Arduino) needs to continually refresh each and every DMD panel all the time. If the display isn't refreshed often enough, the panels will appear to 'flicker'. In all the DMD examples, 1/4 of the display is 'refreshed' on every TimerOne tick which occurs every 5000 microseconds (5 milliseconds). Since it requires four successive refreshes to refresh the entire panel, this means a full refresh occurs every 5mS * 4 = 20mS. In other words, the panels are fully refreshed at a rate of 50Hz.
Let's now compare a DMD panel with an old analog television set...
With a TV, each 'field' is sent at either 50Hz or 60Hz (depending upon which country you're in). While the DMD panel is a 1/4 scan device (every fourth row of pixels is sent with each update), the old TV is a 1/2 scan device (every second row is sent with each update). Therefore, the REAL refresh rate on a TV is either 25Hz or 30Hz (country dependent) since only 1/2 of the full frame is sent at a time. A big difference between a DMD and a TV is that the TV screen uses 'phosphor' which has a certain amount of 'persistence'. When the phosphor is 'turned off', it doesn't immediately stop emitting light... It gradually dims down over a short period. With the LEDs on a DMD, they immediately turn off when they are not being driven. (OK, that's probably not 100% accurate, but the true 'persistence' of an LED is several orders of magnitude less than the phosphor on a CRT. Even the PCB tracks to each LED act as tiny 'storage capacitors' that will delay the actual turn off by a femto second or two... LOL)
Anyway, getting back to the point... Let's simply assume that we must COMPLETELY refresh each and every DMD panel at a minimum rate of 50Hz to avoid flicker... (It's quite a 'reasonable' assumption... Just trust me on that!!!)
In your case, you have 16 DMD panels (arranged 4 x 4) each containing 512 LEDs. That's a total of 8192 LEDs that must be refreshed at our 50Hz minimum refresh rate. If all 16 panels are 'daisy chained', this will require all 8192 pixels are sent out on a single data pin which tells us that our minimum 'average clock frequency' must be 8192 * 50 Hz = 409.6kHz.
In the default DMD library, the refresh clock is set at 125kHz. (Look inside DMD.cpp for the line containing SPI_CLOCK_DIV128. While the comment to the right states a 8MHz frequency, it also states a 'divide by 2' whereas the REAL divisor chosen is 128 which makes it 16Mhz / 128 = 125kHz!!!). There is nothing to stop you using a much smaller SPI clock divisor to increase the clock frequency (providing you keep all your data cables SHORT and you don't mind creating a whole bunch more RFI!). For example, if you were to use SPI_CLOCK_DIV16, you'd end up with a 1MHz pixel clock (assuming your Arduino is using a standard 16Mhz clock). Since your 4 x 4 display needs a 409.6kHz clock to achieve a 50Hz refresh, then 1MHz clock implies that you'll still have just over 50% of your CPU 'free' to do other tasks. (For example, doing any 'processing' to decide what is actually going to be displayed!)
OK, time for next step...
With 16 panels you will need to have a screen buffer large enough to hold all the pixels in the Arduino memory. (Looking at the library code, this is the bDMDScreenRAM byte array). This equates to 16 * 512 bits = 8192 bits or 1024 bytes. I don't know WHICH Arduino you're considering using. Some have more RAM than others. My Mega2560 beasts each have 8kB of RAM so this would leave 7kB free for all the other aspects. By comparison, an Arduino UNO only has 2kB of RAM so you'd be left with only 1kB available. It's up to YOU to decide how much you'd need for 'other stuff'!!! An issue that you might need to consider is that the current library code is totally reliant on using the SPI bus. On the lower end Arduinos, the SPI bus is on outputs D10 thru D13 but on my MEGA2560 Arduino boards it's on D50 thru D53! If I tried to use the DMD library code without connecting the wires to the right places, it simply would not work!!!
Anyway, I hope that helps a bit to answer your questions... (Perhaps you're now more confused than ever? I hope not!)
The remainder of this post details an entirely different path that I am looking into for my project. It's up to you whether you think this is 'applicable'...
In my project, I'll have a somewhat larger display - initially 8(H) x6(V) panels (yep, 48 of them, but even that might increase) and there will be TWO completely independent displays thus giving 96 panels!!!. The 2 * DMD panels I've grabbed from Jaycar are intended only as a 'proof of concept'. They'll not be part of the final product. The two reasons for that are:
[Edit: I obviously cannot count!!! I MEANT four of course!!!]
1: The Jaycar price is a orders of magnitude above the price I can directly import units from China
2: The Jaycar DMDs are definitely NOT suitable for installation in a fairly humid environment.
3: The 'cheap chinese' panels I am looking at have all the LEDs 'potted' in a silicon compound
4: The 'cheap chinese' panels I am looking at have a far better mounting arrangement
I don't want to undermine the fine efforts of Jaycar by informing people whom I intend importing panels from (although I'd seriously doubt many others would be considering purchasing 100 odd panels from Jaycar which is one reason why I can import them for a great price... LOL)
The next aspect is that I definitely will NOT be 'daisy chaining' all 48 panels of each display together in a single string! (Keep in mind that equates to 24576 LEDs!!!). In order to keep the refresh rate 50Hz, that would require a MINIMUM pixel clock of 1.228800MHz!
Instead, I'll be grouping the panels into 6 'strings' of 8 panels each. In other words, I will be needing several 'pixel streams' (i.e. the 'R' pin) each carrying 1/6th of the overall pixel traffic! (Actually, I am allowing for 8 independent pixel streams, but I am only going to be using 6 of them to begin with).
This raises a small issue... The underlying Arduino only has a SINGLE SPI bus that I am aware of and I'm basically needing at least 6 of them (and allowing for up to 8)! I'm achieving this by effectively implementing the SPI bus requirements in software instead of hardware. All the 'control' signals (SCLK, CLK, A, B, and nOE are 'common' to all the strings, but each string has its own unique 'R' pin).
I've quickly thrown together a PCB design for a (Arduino MEGA 2560 style) shield that supports 8 HUB12 outputs. (If anyone is interested, I might throw the eagle files online).
Since there's a good possibility that I might want to have a substantially faster refresh rate in future (to allow for individual pixel PWM brightness control), I wanted the shield to be usable on both a MEGA 2560 style Arduino as well as an the Arduino Due style. The only significant difference being that the Due uses the ARM CPU which is significantly faster, has more Flash / RAM etc. The primary concern was that the Due is a 3.3V Arduino while the Mega 2560 is a 5V Arduino. Therefore, the shield contains a pair of 74LVC4245 chips that act both as buffer amplifiers as well as 3.3V -> 5V level translators if the 'brain' happens to be a Due!
(I've intentionally selected the biggest 'footprint' for these 2 chips with the largest 'pin pitch' just in case someone wants to hand solder these two SMD parts). Furthermore, if anyone is CERTAIN that the 5 volt Mega2560 style Arduino will do, they can install the cheaper 74LVC245 onto the pads leaving out the 2 pads on each end of each chip.
OK, that's (more than?) enough from me...
Anyone who has made it down this far deserves a medal (and / or a frontal lobotomy!)
Good luck to ya Shinobi!