Arduino MEGA 2560

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
angusgr
Freetronics Staff
Freetronics Staff
Posts:853
Joined:Tue Apr 09, 2013 11:19 pm
Location:Melbourne, Australia
Contact:
Re: Arduino MEGA 2560

Post by angusgr » Wed Apr 13, 2016 6:46 am

Hi Copycat,

If you use DMD2 then you can use pins 11-13 on a Mega, via the "SoftDMD" feature. This is probably the easiest approach, provided all of the display graphics features you need are present in DMD2.

Regarding the problems with a connection, is it possible the jumper pins you are using are too short or too thin to contact the Mega's pin socket properly?


Angus

killer800
Posts:2
Joined:Sat Jan 14, 2017 11:38 pm

Re: Arduino MEGA 2560

Post by killer800 » Wed Feb 22, 2017 10:09 pm

TheRevva wrote:If there's anyone out there who wants to connect up a DMD to an Arduino MEGA using the supplied DMD_CON board (i.e. without having to make a mess with jumper wires to re-route pins to the MEGA SPI pins)...
Well, I've made some 'mods' to the DMD library to make it work...
Basically, it eliminates the need for SPI altogether replacing the SPI calls with low-level bit-banging on the appropriate pins... (8 thru 13).
In the interests of speeding things up, I also changed all the digitalWrite() calls into low level direct port access so this code will ONLY work on a MEGA. It'd be easy enough to convert back to digitalWrite(), but I see no reason why anyone would want to.

The zip file below contains an updated DMD.h and DMD.cpp which must be copied into your Arduino 'libraries' sub-folder.
DMD.zip
Enjoy.

NB: I have NOT calculated the new pixel dot clock rate. However, it's probably quite a bit more than the 125kHz used in the SPI library version. Therefore, USE SHORT CABLES!!!
i have tried this and succes but can't control the brightness..do you have some advance how to add the brightness,,thank's

killer800
Posts:2
Joined:Sat Jan 14, 2017 11:38 pm

Re: Arduino MEGA 2560

Post by killer800 » Thu Apr 06, 2017 2:16 pm

i just try using mega tu control DMD Brightness control with change the code but failed ...can anyone give me some advice..
my code is below
#define OE_DMD_ROWS_OFF() { PORTH &= 0xBF; } // { digitalWrite( PIN_DMD_nOE, LOW ); }
#define OE_DMD_ROWS_ON() { PORTH |= 0x40; } // { digitalWrite( PIN_DMD_nOE, HIGH ); }

to

#define OE_DMD_ROWS_OFF() { pinMode(9,INPUT); } // { digitalWrite( PIN_DMD_nOE, LOW ); }
#define OE_DMD_ROWS_ON() { pinMode(9,OUTPUT); } // { digitalWrite( PIN_DMD_nOE, HIGH ); }

and add this code like this post to setup() viewtopic.php?f=26&t=5760
Timer1.pwm(9, Brightness); // to setup PWM and the starting brightness
Timer1.attachInterrupt(ScanDMD);

but if i add "analogWrite(9,100);" to loop()

t's work but the Brightness not stable

please help..

TheRevva wrote:If there's anyone out there who wants to connect up a DMD to an Arduino MEGA using the supplied DMD_CON board (i.e. without having to make a mess with jumper wires to re-route pins to the MEGA SPI pins)...
Well, I've made some 'mods' to the DMD library to make it work...
Basically, it eliminates the need for SPI altogether replacing the SPI calls with low-level bit-banging on the appropriate pins... (8 thru 13).
In the interests of speeding things up, I also changed all the digitalWrite() calls into low level direct port access so this code will ONLY work on a MEGA. It'd be easy enough to convert back to digitalWrite(), but I see no reason why anyone would want to.

The zip file below contains an updated DMD.h and DMD.cpp which must be copied into your Arduino 'libraries' sub-folder.
DMD.zip
Enjoy.

NB: I have NOT calculated the new pixel dot clock rate. However, it's probably quite a bit more than the 125kHz used in the SPI library version. Therefore, USE SHORT CABLES!!!

haris
Posts:3
Joined:Thu Aug 03, 2017 8:00 am

Re: Arduino MEGA 2560

Post by haris » Thu Aug 03, 2017 5:48 pm

TheRevva wrote:
Thu Oct 17, 2013 9:25 am
If there's anyone out there who wants to connect up a DMD to an Arduino MEGA using the supplied DMD_CON board (i.e. without having to make a mess with jumper wires to re-route pins to the MEGA SPI pins)...
Well, I've made some 'mods' to the DMD library to make it work...
Basically, it eliminates the need for SPI altogether replacing the SPI calls with low-level bit-banging on the appropriate pins... (8 thru 13).
In the interests of speeding things up, I also changed all the digitalWrite() calls into low level direct port access so this code will ONLY work on a MEGA. It'd be easy enough to convert back to digitalWrite(), but I see no reason why anyone would want to.

The zip file below contains an updated DMD.h and DMD.cpp which must be copied into your Arduino 'libraries' sub-folder.
DMD.zip
Enjoy.

NB: I have NOT calculated the new pixel dot clock rate. However, it's probably quite a bit more than the 125kHz used in the SPI library version. Therefore, USE SHORT CABLES!!!
wow excelent this working now, but i have problem when transtition from example number 22 to 11 extra pixel is still there, any idea ..?
Attachments
font.jpg

Loki
Posts:18
Joined:Mon Jul 06, 2015 7:12 pm

Re: Arduino MEGA 2560

Post by Loki » Sat Aug 05, 2017 11:20 am

draw numbers to fixed positions and edit font that will have all numbers with same width (included non visible parts)

haris
Posts:3
Joined:Thu Aug 03, 2017 8:00 am

Re: Arduino MEGA 2560

Post by haris » Tue Aug 08, 2017 2:11 pm

killer800 wrote:
Thu Apr 06, 2017 2:16 pm
i just try using mega tu control DMD Brightness control with change the code but failed ...can anyone give me some advice..
my code is below
#define OE_DMD_ROWS_OFF() { PORTH &= 0xBF; } // { digitalWrite( PIN_DMD_nOE, LOW ); }
#define OE_DMD_ROWS_ON() { PORTH |= 0x40; } // { digitalWrite( PIN_DMD_nOE, HIGH ); }

to

#define OE_DMD_ROWS_OFF() { pinMode(9,INPUT); } // { digitalWrite( PIN_DMD_nOE, LOW ); }
#define OE_DMD_ROWS_ON() { pinMode(9,OUTPUT); } // { digitalWrite( PIN_DMD_nOE, HIGH ); }

and add this code like this post to setup() viewtopic.php?f=26&t=5760
Timer1.pwm(9, Brightness); // to setup PWM and the starting brightness
Timer1.attachInterrupt(ScanDMD);

but if i add "analogWrite(9,100);" to loop()

t's work but the Brightness not stable

please help..

TheRevva wrote:If there's anyone out there who wants to connect up a DMD to an Arduino MEGA using the supplied DMD_CON board (i.e. without having to make a mess with jumper wires to re-route pins to the MEGA SPI pins)...
Well, I've made some 'mods' to the DMD library to make it work...
Basically, it eliminates the need for SPI altogether replacing the SPI calls with low-level bit-banging on the appropriate pins... (8 thru 13).
In the interests of speeding things up, I also changed all the digitalWrite() calls into low level direct port access so this code will ONLY work on a MEGA. It'd be easy enough to convert back to digitalWrite(), but I see no reason why anyone would want to.

The zip file below contains an updated DMD.h and DMD.cpp which must be copied into your Arduino 'libraries' sub-folder.
DMD.zip
Enjoy.

NB: I have NOT calculated the new pixel dot clock rate. However, it's probably quite a bit more than the 125kHz used in the SPI library version. Therefore, USE SHORT CABLES!!!
this code is working with me
viewtopic.php?f=26&t=5760&start=10

Timer1.initialize(5100);

smahen
Posts:1
Joined:Fri Sep 01, 2017 6:12 am

Re: Arduino MEGA 2560

Post by smahen » Fri Sep 01, 2017 6:25 am

Mate, it's weird, I had the same problem, spent a couple of days trying to fix it. Finally, came across the post by by angusgr and installed DMD2. It works. Thanks angusar for suggesting DMD2.

Post Reply