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