Dot Matrix Display

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
TechnicaOne
Posts: 4
Joined: Sun Dec 25, 2011 7:53 am

Re: Dot Matrix Display

Post by TechnicaOne » Mon Dec 26, 2011 9:21 am

Thanks Buzbo
I agree, this site does have structure around it and modules typically have been given their own topic , which is good, if the site deviates from this structure then we run the risk of having topics for modules fragmented and difficult to find.
I look forward to seeing your code and hopefully sharing our effects too.

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 298
Joined: Sat Oct 15, 2011 11:31 am
Location: Melbourne, Australia
Contact:

Re: Dot Matrix Display

Post by jonoxer » Wed Dec 28, 2011 3:35 am

Replies to a few points in this thread:

* Forum topic. It's great that the DMD is getting so much interest, so perhaps it does justify a section of its own. @Cef and I have just been talking about the threshold for when a module deserves a whole dedicated section, and I think the DMD may deserve it now. I'll do some rearranging.

* Power supply. The LEDs are amazingly bright and efficient, so you don't need a separate power supply at all to do development: it'll leech enough power off the data lines to light up very adequately, and in many cases you won't ever need anything more. As @LukeWeston suggested, a typical PC power supply would do very well. Even a simple plug-pack will be enough to make you think someone lit up a small sun next to you. Seriously, don't look directly at this display at the moment you power it up from an external power supply! You'll be seeing spots for ages.

* Daisy-chaining. The electronics was specifically designed to allow daisy-chaining, but we didn't get as far as writing support for it into the library when we hit the production deadline. It was an amazing amount of work designing, producing, and releasing about 12 new products all at the same time. Marc was working on the driver library for the DMD right up until the day the boards started arriving in Jaycar stores, and we released v1.0 with minutes to spare. It was a case of either trying to bite off too much and not having *any* operational library available when the first customers needed it, or making a pragmatic decision that we simply couldn't get all the features we wanted into v1 of the software and have a basic version ready to go at the same time as the hardware. Once the hardware ships it's too late to change it, but at least the software can be updated progressively. We've been working insane hours trying to keep up with all this, and the pressure isn't going to let up any time soon!
--
Jon

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 298
Joined: Sat Oct 15, 2011 11:31 am
Location: Melbourne, Australia
Contact:

Re: Dot Matrix Display

Post by jonoxer » Wed Dec 28, 2011 10:28 pm

Since the Dot Matrix Display has received a lot of interest I've now created a dedicated section for it, and this thread has been relocated into it.
--
Jon

TechnicaOne
Posts: 4
Joined: Sun Dec 25, 2011 7:53 am

Re: Dot Matrix Display

Post by TechnicaOne » Thu Dec 29, 2011 2:09 am

Great stuff Jon
Because redesigning the current library may be a big task amongst many, perhaps we can get a few snippets of code that show how to address multiple display panels, that may give us a head start into designing our own libraries?
Craig

breeti109
Posts: 2
Joined: Sun Jan 01, 2012 8:55 pm

Re: Dot Matrix Display

Post by breeti109 » Mon Jan 02, 2012 1:21 am

this might help. Its from a library i wrote myself so you can't just copy and paste, but it should help you get the gist of it.

Code: Select all

void dmd_scan()
{
	static byte scanline = 0;
	byte *p, i;
	DMD_BLANK();	//blank display to avoid glitches.
	DMD_CS0_LOW();
	//output bytes here.
	for (i = 0; i < PANEL_COUNT; i++)
	{
		p = panels[0][i] + scanline;
		DMD_WRITE_SPI(*(p + 0x30));
		DMD_WRITE_SPI(*(p + 0x20));
		DMD_WRITE_SPI(*(p + 0x10));
		DMD_WRITE_SPI(*(p + 0x00));
		
		DMD_WRITE_SPI(*(p + 0x31));
		DMD_WRITE_SPI(*(p + 0x21));
		DMD_WRITE_SPI(*(p + 0x11));
		DMD_WRITE_SPI(*(p + 0x01));
		
		DMD_WRITE_SPI(*(p + 0x32));
		DMD_WRITE_SPI(*(p + 0x22));
		DMD_WRITE_SPI(*(p + 0x12));
		DMD_WRITE_SPI(*(p + 0x02));
		
		DMD_WRITE_SPI(*(p + 0x33));
		DMD_WRITE_SPI(*(p + 0x23));
		DMD_WRITE_SPI(*(p + 0x13));
		DMD_WRITE_SPI(*(p + 0x03));
	}
	DMD_CS0_HIGH();
	//set row select lines to appropriate values.
	switch (scanline)
	{
		case 0:
			DMD_A_LOW();
			DMD_B_LOW();
			break;
		case 4:
		case 12:
			DMD_A_HIGH();
			break;
		case 8:
			DMD_A_LOW();
			DMD_B_HIGH();
			break;
	}
	DMD_UNBLANK();
	scanline = (scanline + 4) & 0x0c;
}
And this is what it looks like running out of a PIC (which is the reason I wrote my own library in the first place.)
P5300147_C.jpg

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 298
Joined: Sat Oct 15, 2011 11:31 am
Location: Melbourne, Australia
Contact:

Re: Dot Matrix Display

Post by jonoxer » Mon Jan 02, 2012 5:23 am

Hey @breeti109, that's great!

I know it's running on a PIC not an ATmega, but it's quite likely there'll be other people interested in driving those displays with a PIC too so perhaps you could post your library? I'd be very happy if this forum was also used for discussion of PIC-related projects: we don't have to stick to Arduino stuff only. Anything electronics-related is welcome here.
--
Jon

breeti109
Posts: 2
Joined: Sun Jan 01, 2012 8:55 pm

Re: Dot Matrix Display

Post by breeti109 » Mon Jan 02, 2012 10:30 am

I've attatched the libray I made here. I've added some compatibility headers for arduino, based on the original library, but I have no idea if it will work properly on arduino.
Attachments
dmd_distrib_v100.7z
(15.24 KiB) Downloaded 722 times

jubbp
Posts: 1
Joined: Sat Dec 31, 2011 9:51 am

Re: Dot Matrix Display

Post by jubbp » Wed Jan 04, 2012 11:43 am

Here is my attempt at programifying the scrolling marquee.

Code: Select all

#include <SPI.h> //SPI.h must be included as DMD is written by SPI (the IDE complains otherwise)
#include <DMD.h> //
#include <TimerOne.h> //

DMD dmd; //Fire up the DMD library as dmd

char message[23] = "Welcome to the future!";
int mesgLength = 22;
int location = 0;

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

void setup(){
Timer1.attachInterrupt( ScanDMD ); //attach the Timer1 interrupt to ScanDMD which goes to dmd.scanDisplayBySPI()
}

void loop() 
{
// 1st set of text
for (int i = 0; i < 6 ; i++ )
{
  dmd.clearScreen( true );
  dmd.drawCharacter_5x7( 5-i, 4, message[location+0], GRAPHICS_NORMAL );
  dmd.drawCharacter_5x7( 11-i, 4, message[location+1], GRAPHICS_NORMAL );
  dmd.drawCharacter_5x7( 17-i, 4, message[location+2], GRAPHICS_NORMAL );
  dmd.drawCharacter_5x7( 23-i, 4, message[location+3], GRAPHICS_NORMAL );
  dmd.drawCharacter_5x7( 29-i, 4, message[location+4], GRAPHICS_NORMAL );
  delay( 150 );
}

location++;
if (location >= mesgLength-4) {
  location = 0;}
  
}

Buzbot
Posts: 22
Joined: Wed Dec 14, 2011 10:03 am

Re: Dot Matrix Display

Post by Buzbot » Mon Jan 09, 2012 9:48 pm

Hi jubbp,

Thanks very much for posting this code. Its much more efficient than my poor first attempt. I appreciate you posting this as it has taught me a better way to program scrolling text.

Cheers

Buzbot

Oakley69
Posts: 1
Joined: Fri Jan 13, 2012 4:05 am

Dot Matrix Display - Scrolling text

Post by Oakley69 » Tue Jan 17, 2012 10:28 am

Have had a fun time playing with the DMD since purchasing over Xmas.
This is a terrific gadget at a reasonable price.
Following is my crack at creating some code for a scrolling message. works OK on my Duemilanove.
Hope this is appropriate.

//-------- SCROLLING TEXT -------------------------------------------
#include <SPI.h>
#include <DMD.h>
#include <TimerOne.h>

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

void loop()
{
int icnt = 0;
int ino = 0;
byte bChar;
String sMess;

sMess = "The Freetronics LED display is terrific";
sMess = " " + sMess + " "; //add 5 blank spaces at each end

ino = sMess.length(); // get string length

for(icnt = 0; icnt < ino-3 ; icnt++)
{
delay( 250 ); // set scroll speed
bChar = sMess.charAt(icnt); //get characters out of string
dmd.drawCharacter_5x7( 0, 0, bChar, GRAPHICS_NORMAL );
bChar = sMess.charAt(icnt+1);
dmd.drawCharacter_5x7( 6, 0, bChar, GRAPHICS_NORMAL );
bChar = sMess.charAt(icnt+2);
dmd.drawCharacter_5x7( 12, 0, bChar, GRAPHICS_NORMAL );
bChar = sMess.charAt(icnt+3);
dmd.drawCharacter_5x7( 18, 0, bChar, GRAPHICS_NORMAL );
bChar = sMess.charAt(icnt+4);
dmd.drawCharacter_5x7( 24, 0, bChar, GRAPHICS_NORMAL );
bChar = sMess.charAt(icnt+5);
}
dmd.clearScreen( true );
}

Post Reply