Go Down

Topic: 11 x 10 LED Matrix MAX7219? (Read 1 time) previous topic - next topic

max713

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

CrossRoads

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

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

max713

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?

dhenry

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.

CrossRoads

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

max713

I've tried to control the brightness with the Output Enable pin, but that didn't work very well.
Code: [Select]
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)?

CrossRoads

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.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

max713

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

CrossRoads

Please explain which you mean by "the other idea".
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up