Go Down

Topic: Interfacing an 8x8 LED matrix with the MAX7219 driver (Read 11225 times) previous topic - next topic

nickgammon

I've done a post about hooking up an 8x8 LED matrix display (obtained fairly cheaply from Adafruit) to a MAX7219 multiplexing chip. This is it in action, displaying the letter "c":



Circuit:



More details (code, other issues) here:

http://www.gammon.com.au/forum/?id=11516
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Techone

Nice Nick.

I wonder where did you get the chip MAX7219 ?

nickgammon

Here:

http://www.adafruit.com/products/453

I gave the link in the full post.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

ajofscott

Pretty sweet Nick, I see a Dout pin making cascades just like any other shift register. Next goal a 4' x 4' panel display ;)

Techone

Thank Nick for the link...But at $10 US ...Man...Not a cheap chip.

ajofscott

@Techone Maxim will sample a few devices provided you have some plausable story of business venture or scholastic task.

Techone

@ajofscott

LOL... yeah...right... lying... no thank !  I am just an hobbyist here.

nickgammon


Pretty sweet Nick, I see a Dout pin making cascades just like any other shift register. Next goal a 4' x 4' panel display ;)


Absolutely. If you have the patience (which I don't) to wire up a few more, then you can cascade the Dout to Din of the next device. Then you bring SS low, transfer the commands for all devices and then bring SS high again. Effectively the first command ends up in the last (furthest) device, and so on.


Thank Nick for the link...But at $10 US ...Man...Not a cheap chip.


By the time you have bought, say, 8 transistors instead (and current-limiting resistors) and spent a lot more time wiring them up, you aren't that far behind.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

ajofscott

Maxim's sample criteria:
Quote
Please note that public domain e-mail addresses (e.g. @yahoo.com, @gmail.com, etc.) are not supported with free samples. If you are using a public domain e-mail address, please logout and re-login with a business or educational e-mail address.

2 devices per sample.

Techone

Quote
By the time you have bought, say, 8 transistors instead (and current-limiting resistors) and spent a lot more time wiring them up, you aren't that far behind.


I see your point.  And I did just that...it was fun and relaxing.

Quote
with a business or educational e-mail address


In my case, I am not eligible for the sample. Cost nothing to try.

GaryP

How about these... 10$ each is robbery.
http://www.ebay.com/itm/10PCS-IC-MAXIM-MAX7219CNG-IC-DRIVER-LED-DISPLAY-8DGT-24DIP-/280820616518?pt=LH_DefaultDomain_0&hash=item4162368d46

Cheers,
Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

Techone

Thank GaryP.

Load up PayPal, and order it. I check... it is from China... Lots of waiting... 3 to 4 weeks...I don't mind.

GaryP

Yep, most of these comes from Hong Kong, and it takes its time, but that's the "price".

I have so much to do all the time, so no hurry, that have always arrived (knock the wood).
;)

Cheers,
Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

pamda100

Hi!
I saw this and was curious if I could interface a hand made 8X8 with MAX7219 and make it work. So far I was not very successful(but I'm somewhat new to this so pardon me.) I must mention that I am also using an ultrasonic sensor(HC-SR04) to trigger the LEDs. Here is my code:

#include <Ultrasonic.h>

#include "LedControl.h" //  need the library
#define trigPin 7
#define echoPin 13

LedControl lc=LedControl(12,11,10,1); // lc is our object
// pin 12 is connected to the MAX7219 pin 1
// pin 11 is connected to the CLK pin 13
// pin 10 is connected to LOAD pin 12
// 1 as we are only using 1 MAX7219
void setup()
{
  Serial.begin (9600);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
 
// the zero refers to the MAX7219 number, it is zero for 1 chip
lc.shutdown(0,false);// turn off power saving, enables display
lc.setIntensity(0,15);// sets brightness (0~15 possible values)
lc.clearDisplay(0);// clear screen
}
void single() {
for(int row=0;row<8;row++) {
for(int col=0;col<8;col++) {
lc.setLed(0,row,col,true);

}
}
}
void loop(){
int duration, distance;
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(1000);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = (duration/2) / 29.1;
  if (distance >= 200 || distance <= 0){
   Serial.println("Out of range");
   for(int row=0;row<8;row++) {
   for(int col=0;col<8;col++) {
   lc.setLed(0,row,col,false);}}
   
   
  }else{
  lc.setIntensity(0,15);

single();
for (int n=0; n<5; n++)
{
for (int z=0; z<16; z++)
{
lc.setIntensity(0,z);
delay(100);
}
for (int z=15; z>-1; --z)
{
lc.setIntensity(0,z);
delay(100);
Serial.print(distance);
    Serial.println(" cm");
}
}
lc.clearDisplay(0); // turns on LED at col, row
  }
}

I must say that the same code worked when I interfaced the MAX7219 with an 8X8 store bought LED grid. So I cant figure out why the code works for the store bought 8x8 and not the hand made one?
here's the the video to demonstrate what I am talking about in action:
http://youtu.be/OGyOXTKHUOE

nickgammon

Certainly it should, depending on how you have your hand-wired LEDs set up. The one I used (the store-bought one) was wired like this:



To the extent that you have wired it differently you would need to compensate. I don't know how you wired it so it is impossible to comment further.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Go Up