DMD keeps Restarting

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
Kerl
Posts:15
Joined:Fri Dec 04, 2015 1:57 am
DMD keeps Restarting

Post by Kerl » Tue Dec 08, 2015 2:59 am

Hey All,

I've deployed a simple code to display the X on the DMD provided by Freetronics as a test. However every 30 seconds approx, the dmd resets and the green light on the Ardunio resets at the same time. I've tried another DMD and I've deployed other code which does the same thing (resets every 30 second). Is there something at the end of the code or library I need to do to stop this reset? Thanks.

Code: Select all

#include "SPI.h"      
#include "DMD.h" 
#include "TimerOne.h"
#include "Arial_black_16.h" <arial_black_16.h> 
// you can remove the fonts if unused
#include "SystemFont5x7.h"
#define DISPLAYS_ACROSS 1   
#define DISPLAYS_DOWN 1       
/* change these values if you have more than one DMD connected */
DMD dmd(DISPLAYS_ACROSS,DISPLAYS_DOWN);

void ScanDMD()
{ 
  dmd.scanDisplayBySPI();
}

void setup()
{
   Timer1.initialize( 5000 );           
/*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()*/

   dmd.clearScreen( true );            
/* true is normal (all pixels off), false is negative (all pixels on) */

  dmd.selectFont(SystemFont5x7);
  dmd.drawChar(  5,  5, 'X', GRAPHICS_NORMAL );
}

void loop()
{ 
}

andrew
Freetronics Staff
Freetronics Staff
Posts:978
Joined:Sun Jul 14, 2013 7:06 am
Location:Melbourne, Australia
Contact:

Re: DMD keeps Restarting

Post by andrew » Tue Dec 08, 2015 3:42 am

Hello

That is peculiar.
Please try the following sketch and let us know what happens:

Code: Select all

#include "SPI.h"        
#include "DMD.h"        
#include "TimerOne.h"
#include "Arial_black_16.h" 
/* you can remove the fonts if unused */
#define DISPLAYS_ACROSS 1
#define DISPLAYS_DOWN 1
DMD dmd( DISPLAYS_ACROSS , DISPLAYS_DOWN );

void ScanDMD()
{ 
  dmd.scanDisplayBySPI();
}

void setup()
{
   Timer1.initialize( 5000 );           
   Timer1.attachInterrupt( ScanDMD );  
   dmd.clearScreen( true );            
}

String textToScroll="Hello, this will be displayed on the DMD";

void drawText( String dispString ) 
{
  dmd.clearScreen( true );
  dmd.selectFont( Arial_Black_16 );
  char newString[256];
  int sLength = dispString.length();
  dispString.toCharArray( newString, sLength+1 );
  dmd.drawMarquee( newString , sLength , ( 32*DISPLAYS_ACROSS )-1 ,0);
  long start=millis();
  long timer=start;
  long timer2=start;
  boolean ret=false;
  while( !ret ){
    if ( ( timer+20 ) < millis() ) {
      ret=dmd.stepMarquee( -1 , 0 );
      timer=millis();
    }
  }
}

void loop()
{
  drawText(textToScroll);
}

Kerl
Posts:15
Joined:Fri Dec 04, 2015 1:57 am

Re: DMD keeps Restarting

Post by Kerl » Tue Dec 08, 2015 4:09 am

andrew wrote:Hello

That is peculiar.
Please try the following sketch and let us know what happens:

Code: Select all

#include "SPI.h"        
#include "DMD.h"        
#include "TimerOne.h"
#include "Arial_black_16.h" 
/* you can remove the fonts if unused */
#define DISPLAYS_ACROSS 1
#define DISPLAYS_DOWN 1
DMD dmd( DISPLAYS_ACROSS , DISPLAYS_DOWN );

void ScanDMD()
{ 
  dmd.scanDisplayBySPI();
}

void setup()
{
   Timer1.initialize( 5000 );           
   Timer1.attachInterrupt( ScanDMD );  
   dmd.clearScreen( true );            
}

String textToScroll="Hello, this will be displayed on the DMD";

void drawText( String dispString ) 
{
  dmd.clearScreen( true );
  dmd.selectFont( Arial_Black_16 );
  char newString[256];
  int sLength = dispString.length();
  dispString.toCharArray( newString, sLength+1 );
  dmd.drawMarquee( newString , sLength , ( 32*DISPLAYS_ACROSS )-1 ,0);
  long start=millis();
  long timer=start;
  long timer2=start;
  boolean ret=false;
  while( !ret ){
    if ( ( timer+20 ) < millis() ) {
      ret=dmd.stepMarquee( -1 , 0 );
      timer=millis();
    }
  }
}

void loop()
{
  drawText(textToScroll);
}
Thanks
I tried it and it will restart every 30 seconds as before. Looks like I have an issue with the Arduino then....

andrew
Freetronics Staff
Freetronics Staff
Posts:978
Joined:Sun Jul 14, 2013 7:06 am
Location:Melbourne, Australia
Contact:

Re: DMD keeps Restarting

Post by andrew » Tue Dec 08, 2015 10:35 pm

Afraid it would appear so.
It may also be a power issue - if you are running the lot from one USB port, sometimes the USB cannot offer enough current.
If you can, try using external power for the DMD (5V 3~4A). Otherwise try another Arduino (etc) board.

Kerl
Posts:15
Joined:Fri Dec 04, 2015 1:57 am

Re: DMD keeps Restarting

Post by Kerl » Wed Dec 09, 2015 12:40 am

andrew wrote:Afraid it would appear so.
It may also be a power issue - if you are running the lot from one USB port, sometimes the USB cannot offer enough current.
If you can, try using external power for the DMD (5V 3~4A). Otherwise try another Arduino (etc) board.

Great I'll give that a try.

Kerl
Posts:15
Joined:Fri Dec 04, 2015 1:57 am

Re: DMD keeps Restarting

Post by Kerl » Fri Dec 11, 2015 3:49 am

andrew wrote:Afraid it would appear so.
It may also be a power issue - if you are running the lot from one USB port, sometimes the USB cannot offer enough current.
If you can, try using external power for the DMD (5V 3~4A). Otherwise try another Arduino (etc) board.
Thanks Andrew, I applied a 12v 4amp power supply (without being attached to the PC) and the everything is stable.

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

Re: DMD keeps Restarting

Post by stryker » Fri Dec 11, 2015 5:08 am

Kerl wrote:I applied a 12v 4amp power supply (without being attached to the PC) and the everything is stable.
hopefully that was 5V rather than 12...

andrew
Freetronics Staff
Freetronics Staff
Posts:978
Joined:Sun Jul 14, 2013 7:06 am
Location:Melbourne, Australia
Contact:

Re: DMD keeps Restarting

Post by andrew » Fri Dec 11, 2015 5:21 am

Kerl wrote:
andrew wrote:Afraid it would appear so.
It may also be a power issue - if you are running the lot from one USB port, sometimes the USB cannot offer enough current.
If you can, try using external power for the DMD (5V 3~4A). Otherwise try another Arduino (etc) board.
Thanks Andrew, I applied a 12v 4amp power supply (without being attached to the PC) and the everything is stable.
Yikes - 12V into the DC socket on the Arduino is fine.
However if you're connecting DC straight to the DMDs - use 5V not 12V.

Kerl
Posts:15
Joined:Fri Dec 04, 2015 1:57 am

Re: DMD keeps Restarting

Post by Kerl » Mon Dec 14, 2015 12:37 am

:lol: Cheers guys, 12v 4amp to the Arduino not the panels.

I'm interested to know if I have the power supply to the Ardinuo and the laptop is on the USB, I'm getting this restarting issue. Once I unplug the usb on the laptop, the issue goes away.

Does the power default to the USB?

andrew
Freetronics Staff
Freetronics Staff
Posts:978
Joined:Sun Jul 14, 2013 7:06 am
Location:Melbourne, Australia
Contact:

Re: DMD keeps Restarting

Post by andrew » Mon Dec 14, 2015 12:52 am

To successfully run more than one panel, you need to power the panels directly with the high-current 5V supply.
Most boards will default to USB power.

Post Reply