DMD / DMD2 - No SPI MEGA

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
Post Reply
twilliamson
Posts:6
Joined:Thu Dec 03, 2015 1:36 pm
DMD / DMD2 - No SPI MEGA

Post by twilliamson » Thu Dec 03, 2015 1:53 pm

So, while im waiting on my DMD(s) to arrive, i decided to play around with the code. I stated with a UNO and migrated to a MEGA (I think i was running out of ram, ultimatly wanting to build a GPS/SoftwareRTC/Clockhttp://github.com/Twilliamson3/DMD-GPSClock) ....

Now my issues. Using just the canned dmd_Demo sketch and a Saleae Logic probe conneted to the ICSP port on the UNO I get this.
Image
This looks valid. Or at least is something.

Run the same code on the mega, connected identically...Nothing
SCK is pulled Low thats the only change.

Did i miss something?

Running Arduino 1.6.5

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

Re: DMD / DMD2 - No SPI MEGA

Post by andrew » Thu Dec 03, 2015 11:41 pm

Try connecting to the SPI pins on the D13... header.
When it's time to use with a Mega, use the DMD2 library and the SoftDMD dmd(); function to reassign pins to match the DMDCON board that arrives with the display.

twilliamson
Posts:6
Joined:Thu Dec 03, 2015 1:36 pm

Re: DMD / DMD2 - No SPI MEGA

Post by twilliamson » Fri Dec 04, 2015 1:25 am

I left the board at the office so i cant mess with it right now, but are you saying that in order to use the library with a mega you must use softdmd? I really would have expected to see data on the mega's SPI Pins.

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

Re: DMD / DMD2 - No SPI MEGA

Post by Loki » Tue Dec 08, 2015 8:12 am

Hi, better option is to remake DMDCON, because SoftSPI is much slower than hardware spi (by my tests) it tooks much more time to scroll text etc. on soft spi

twilliamson
Posts:6
Joined:Thu Dec 03, 2015 1:36 pm

Re: DMD / DMD2 - No SPI MEGA

Post by twilliamson » Fri Dec 18, 2015 6:37 pm

Anyone ever rewritten DMD for use on the Mega. That might be out of my understanding.

angusgr
Freetronics Staff
Freetronics Staff
Posts:853
Joined:Tue Apr 09, 2013 11:19 pm
Location:Melbourne, Australia
Contact:

Re: DMD / DMD2 - No SPI MEGA

Post by angusgr » Wed Dec 30, 2015 6:00 am

The problem isn't in software and the DMD or DMD2 libraries, it's in hardware and the DMDCon board.

Soft DMD can use the same pins on both boards, because it toggles the pins using basic digital writes. But as you've pointed out it's slower (although when I tested the speed difference wasn't huge.)

SPI hardware DMD has to use the SPI bus pins on the Arduino. The SPI pins are in different places on the two boards - see the "Connections" table about half way down this page: https://www.arduino.cc/en/Reference/SPI

On the Arduino Uno/Duemilanove, the SPI hardware pins are 11,12, 13 - and this is where the DMDCon connector attaches. On the Mega they are 50, 51, 52 on the side connector.

So to use hardware SPI with the DMD on the Mega you need to rewire the DMD to use the different pins mentioned in the table, instead of pins 11-13.

The reason the "ISP connector" (6 pin header) is mentioned is because the SPI connections are in the same place on that header for all boards, so it's the most reliable place to get a SPI connection.

Post Reply