LIMIT DISPLAY ACROSS P10

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
Post Reply
DJOPY
Posts: 1
Joined: Wed Aug 05, 2015 3:17 pm

LIMIT DISPLAY ACROSS P10

Post by DJOPY » Wed Aug 05, 2015 3:29 pm

Hello;

I am using the DMD and TimerOne libraries to write into a 16x32 p10 red panel.
But, I need this code to run into 29 display_across (16x928) and the limit i get is 24 modules.

Does anyone knows how to help me ?!!!? :shock:

Thank you very much!!!


The code is above:

/*--------------------------------------------------------------------------------------

dmd_test.cpp
Demo and example project for the Freetronics DMD, a 512 LED matrix display
panel arranged in a 32 x 16 layout.

Copyright (C) 2011 Marc Alexander (info <at> freetronics <dot> com)

See http://www.freetronics.com/dmd for resources and a getting started guide.

Note that the DMD library uses the SPI port for the fastest, low overhead writing to the
display. Keep an eye on conflicts if there are any other devices running from the same
SPI port, and that the chip select on those devices is correctly set to be inactive
when the DMD is being written to.

USAGE NOTES
-----------

- Place the DMD library folder into the "arduino/libraries/" folder of your Arduino installation.
- Get the TimerOne library from here: http://code.google.com/p/arduino-timero ... loads/list
or download the local copy from the DMD library page (which may be older but was used for this creation)
and place the TimerOne library folder into the "arduino/libraries/" folder of your Arduino installation.
- Restart the IDE.
- In the Arduino IDE, you can open File > Examples > DMD > dmd_demo, or dmd_clock_readout, and get it
running straight away!

* The DMD comes with a pre-made data cable and DMDCON connector board so you can plug-and-play straight
into any regular size Arduino Board (Uno, Freetronics Eleven, EtherTen, USBDroid, etc)

* Please note that the Mega boards have SPI on different pins, so this library does not currently support
the DMDCON connector board for direct connection to Mega's, please jumper the DMDCON pins to the
matching SPI pins on the other header on the Mega boards.

This example code is in the public domain.
The DMD library is open source (GPL), for more see DMD.cpp and DMD.h

--------------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------------
Includes
--------------------------------------------------------------------------------------*/
#include <SPI.h> //SPI.h must be included as DMD is written by SPI (the IDE complains otherwise)
#include <DMD.h> //
#include <TimerOne.h> //
#include "SystemFont5x7.h"
#include "Arial_black_16.h"

//Fire up the DMD library as dmd
#define DISPLAYS_ACROSS 29
#define DISPLAYS_DOWN 1
DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN);

/*--------------------------------------------------------------------------------------
Interrupt handler for Timer1 (TimerOne) driven DMD refresh scanning, this gets
called at the period set in Timer1.initialize();
--------------------------------------------------------------------------------------*/
void ScanDMD()
{
dmd.scanDisplayBySPI();
}

/*--------------------------------------------------------------------------------------
setup
Called by the Arduino architecture before the main loop begins
--------------------------------------------------------------------------------------*/
void setup(void)
{

//initialize TimerOne's interrupt/CPU usage used to scan and refresh the display
Timer1.initialize( 3000 ); //period in microseconds to call ScanDMD. Anything longer than 5000 (5ms) and you can see flicker.
Timer1.attachInterrupt( ScanDMD ); //attach the Timer1 interrupt to ScanDMD which goes to dmd.scanDisplayBySPI()

//clear/init the DMD pixels held in RAM
dmd.clearScreen( true ); //true is normal (all pixels off), false is negative (all pixels on)

}

/*--------------------------------------------------------------------------------------
loop
Arduino architecture main loop
--------------------------------------------------------------------------------------*/
void loop(void)
{
byte b;

// 10 x 14 font clock, including demo of OR and NOR modes for pixels so that the flashing colon can be overlayed
dmd.clearScreen( true );
dmd.selectFont(Arial_Black_16);

// dmd.drawChar( 0, 3, '2', GRAPHICS_NORMAL );
// dmd.drawChar( 7, 3, '3', GRAPHICS_NORMAL );
// dmd.drawChar( 17, 3, '4', GRAPHICS_NORMAL );
// dmd.drawChar( 25, 3, '5', GRAPHICS_NORMAL );
// dmd.drawChar( 15, 3, ':', GRAPHICS_OR ); // clock colon overlay on
// delay( 1000 );
// dmd.drawChar( 15, 3, ':', GRAPHICS_NOR ); // clock colon overlay off
// delay( 1000 );
// dmd.drawChar( 15, 3, ':', GRAPHICS_OR ); // clock colon overlay on
// delay( 1000 );
// dmd.drawChar( 15, 3, ':', GRAPHICS_NOR ); // clock colon overlay off
// delay( 1000 );
// dmd.drawChar( 15, 3, ':', GRAPHICS_OR ); // clock colon overlay on
// delay( 1000 );



dmd.drawMarquee("EMOTIQUE",10,(32*DISPLAYS_ACROSS)-1,0);
long start=millis();
long timer=start;
boolean ret=false;
while(!ret){
if ((timer+30) < millis()) {
ret=dmd.stepMarquee(-1,0);
timer=millis();
}
}



// // half the pixels on
// dmd.drawTestPattern( PATTERN_ALT_0 );
// delay( 1000 );
//
// // the other half on
// dmd.drawTestPattern( PATTERN_ALT_1 );
// delay( 1000 );
//
// // display some text
// dmd.clearScreen( true );
// dmd.selectFont(System5x7);
// for (byte x=0;x<DISPLAYS_ACROSS;x++) {
// for (byte y=0;y<DISPLAYS_DOWN;y++) {
// dmd.drawString( 2+(32*x), 1+(16*y), "freet", 5, GRAPHICS_NORMAL );
// dmd.drawString( 2+(32*x), 9+(16*y), "ronic", 5, GRAPHICS_NORMAL );
// }
// }
// delay( 2000 );
//
// // draw a border rectangle around the outside of the display
// dmd.clearScreen( true );
// dmd.drawBox( 0, 0, (32*DISPLAYS_ACROSS)-1, (16*DISPLAYS_DOWN)-1, GRAPHICS_NORMAL );
// delay( 1000 );
//
// for (byte y=0;y<DISPLAYS_DOWN;y++) {
// for (byte x=0;x<DISPLAYS_ACROSS;x++) {
// // draw an X
// int ix=32*x;
// int iy=16*y;
// dmd.drawLine( 0+ix, 0+iy, 11+ix, 15+iy, GRAPHICS_NORMAL );
// dmd.drawLine( 0+ix, 15+iy, 11+ix, 0+iy, GRAPHICS_NORMAL );
// delay( 1000 );
//
// // draw a circle
// dmd.drawCircle( 16+ix, 8+iy, 5, GRAPHICS_NORMAL );
// delay( 1000 );
//
// // draw a filled box
// dmd.drawFilledBox( 24+ix, 3+iy, 29+ix, 13+iy, GRAPHICS_NORMAL );
// delay( 1000 );
// }
// }
//
// // stripe chaser
// for( b = 0 ; b < 20 ; b++ )
// {
// dmd.drawTestPattern( (b&1)+PATTERN_STRIPE_0 );
// delay( 200 );
// }
// delay( 200 );

}

User avatar
stryker
Posts: 282
Joined: Sat Jan 14, 2012 2:44 pm

Re: LIMIT DISPLAY ACROSS P10

Post by stryker » Thu Aug 06, 2015 10:13 am

Hi,

I've not looked at your code all the way through, but having that many DMD modules and using the 3000 microseconds value in the timer interrupt routine won't allow enough time for your full array of 29 to be written to.

Refer this forum post, especially the reply by @TheRevva for an explanation and a fix that worked well for us. I've only tried up to 6 DMD to be fair, but his maths shows the way to bigger arrays like yours working fine with a minor modification of the dmd library.

Cheers !
Geoff

Franco Picarelli
Posts: 1
Joined: Wed Aug 19, 2015 5:47 pm

Re: LIMIT DISPLAY ACROSS P10

Post by Franco Picarelli » Wed Aug 19, 2015 11:22 pm

Hello there!

For some strange coincidence, I also want to display the word "EMOTIQUE", on a 29 panel setup ;)
(Thank you DJOPY for going through this trouble to help me)

Well, I read the link posted by stryker (Thank you too!) and did some tests, but, unfortunately, it did not solve my problem, even when I use the SPI_CLOCK_DIV2 divider.

I'm using an Arduino Uno with 16MHz clock. Is it possible that it's microprocessor is just too slow for the job? Should I try a faster one, like the ARM on Arduino Due (84 MHz)?

Does anyone knows about any other issue that might be causing this situation?

OBS: I own a chinese controller board for P10 panels, model TF-MU, with which I was able to display some rolling text in the 29 panel line without any trouble, so I guess it's not a hardware issue. Unfortunately it's software doesn't work for the project I'm working on...

Thanks,

Franco

User avatar
stryker
Posts: 282
Joined: Sat Jan 14, 2012 2:44 pm

Re: LIMIT DISPLAY ACROSS P10

Post by stryker » Wed Aug 19, 2015 11:36 pm

Hi Franco

I'd be tempted to agree that the microcontroller isn't up to refreshing that many panels due to the speed limitation. Have you tried reducing the panels and seeing as you add more where it is no longer functional?

As I mentioned I now limit arrays to 6 per Arduino. I'm presently working on a larger project which breaks the task down to multiple controllers as a consequence with a maximum of 6 DMD per Arduino. I do know 6 works with the above fix, but after that haven't tested higher numbers personally. The speed of the microcontroller and the divisor on the SPI bus impacts the refresh rate, eventually with so many pixels to update the job can't be achieved in the time of a refresh cycle.

Cheers ! Geoff

Brissieboy
Posts: 206
Joined: Fri Sep 20, 2013 7:25 am

Re: LIMIT DISPLAY ACROSS P10

Post by Brissieboy » Thu Aug 20, 2015 6:28 am

You should be able use more DMDs if you slow down the interrupt rate.
This will be OK for text displays as long as you don't want to scroll, or do anything fancy with graphics. It will make scrolling look very poor, but static displays will not be noticeably effected.

The DMD update process is performed by scanDisplayBySPI() which runs at each Timer1 interrupt. (It actually takes 4 calls to fully update the display.)

Try increasing the Timer1.initialize( 3000 ) to something significantly greater. However, it will increase the flicker effect.

And make sure that the SPI clock is set to 8MegHz (SPI.setClockDivider(SPI_CLOCK_DIV2)) in DMD.cpp.

Post Reply