Pages: [1]   Go Down
Author Topic: 11 x 10 LED Matrix MAX7219?  (Read 929 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I want to use a MAX7219 for this in order to simplify programming (e.g. animations).
Now I have to use two of them, but I seriously don't know how to split the matrix (that still should be easy to program, I suggested each MAX controls 11x5, but that wouldn't work because there are only 8 anodes/cathodes available right?)

Has anyone an idea?
Thanks
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 437
Posts: 23718
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, 11 x 10 = 110,
MAX7219 controls 8x8 = 64, so two would seem to  have the control capacity you need.
Use an int array, map the upper bits of 3x11 into the 2nd.
Have 8x8 controlled by one. 2x8, 3x8, and 3x2 controlled by the second.
10 across, 11 down. Numbers  and hh thru pp are lower byte of int, letters a-f are upper byte of the int:

e e e e e e e e   f f  map to 2nd '7219 registers
c c c c c c c c    d d  map to 2nd '7219 registers
a a a a a a a a    b b map to 2nd '7219 registers
1 1 1 1 1 1 1 1    h h   a c e x x
2 2 2 2 2 2 2 2    i i    a c e x x
3 3 3 3 3 3 3 3    j j    a c e  x x
4 4 4 4 4 4 4 4    k k   a c e x x
5 5 5 5 5 5 5 5   L L   a c e x x
6 6 6 6 6 6 6 6   m m a c e f f
7 7 7 7 7 7 7 7   n n  a c e d d
8 8 8 8 8 8 8 8   p p a c e b b

Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That sounds complicated, I didn't understand that very much.

Another possibility are shift registers right? But there's no way to change brightness...
What about animations with 75HC595? Not as easy to program compared to MAX7219 right?
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But there's no way to change brightness...

There are ways to change brightness for all leds;

There are ways to change brightness for individual leds but it requires very fast data transmission rates, so fast that it is practically not doable.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 437
Posts: 23718
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

MAX7219, you can change brightness with writing to a register.
74HC595, you can change brightness with PWW to the output enable pin.

Animations - with MAX7219, you are writing data to 15 registers, the MAX7219 is taking care of multiplexing for you in between register writes.

With HC595s, your code is taking on the mulitplexing task over an array made of 2x2 shift registers.
I would use 74HC595 to source current thru current limit resistors to 11 rows anodes, and TPIC6B595 to sink current from each column (11 anodes) one at at time.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've tried to control the brightness with the Output Enable pin, but that didn't work very well.
Code:
int datapin = 13;
int clockpin = 12;
int output_enable = 11;
int latchpin = 8;
byte test[1];
int x = 0;
int brightness;
int potentiometer = A0;

void setup()
{
  Serial.begin(9600);
  pinMode(datapin,OUTPUT);
  pinMode(latchpin,OUTPUT);
  pinMode(clockpin,OUTPUT);
  pinMode(output_enable,OUTPUT);
  test[1] = 0b11111111;
}

void loop()
{
  brightness = analogRead(A0);
  analogWrite(output_enable, brightness);

  digitalWrite(latchpin, LOW);
  shiftOut(datapin, clockpin, MSBFIRST, test[1]);
  digitalWrite(latchpin, HIGH);
}


Where is the mistake?

It works much better when a potentiometer is connected in series to the supply voltage input, the LEDs go fluently from dark to light, but does this also work when a Darlington Array is also connected in series (to supply the LEDs)?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 437
Posts: 23718
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is a 10-bit result
  brightness = analogRead(A0);
 
This needs a 8-bit value
 analogWrite(output_enable, brightness);

Maybe try this
byte brightness_byte =  lowByte((brightness >> 2));
to drop the lower 2 bits of the 10-bit result and ignore the upper byte.

Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i couldn't try this yet. what about the other idea if that doesn't work?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 437
Posts: 23718
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please explain which you mean by "the other idea".
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: