PDA

View Full Version : max7219 boards issue



vikingsraven
02-09-2014, 11:20 AM
HI guys, just got 7 off the max7219 boards from ebay, having the devils own time trying to get them to work in series, they all work fine separately , but when i daisy chain 2 or more the second board only lights up with all the segments, the first one runs ok, written some code to display com 1 info and that working ok for the first display but nothing on the second.
Anyone else had this? im going to stick a scope on the board at work tomorrow to see if its chucking out the right info, had some leds on the output and the clk and the load seem to be correct.
cheers

#include"<ledcontrol.h>LedControl.h"
led_Disp = LedControl(12, 10, 11, 8);
// 12 data, 10, clk, 11 cs ,8 no of devices




int CodeIn;
void setup() {
led_Disp.shutdown(0, false);
delay (500);
led_Disp.shutdown(1, false);
delay (500);
led_Disp.setIntensity(0, 3);
led_Disp.clearDisplay(0);
delay (500);
led_Disp.shutdown(1, false);
delay (500);
led_Disp.setIntensity(1, 3);
led_Disp.clearDisplay(2);
delay (500);
Serial.begin(115200);
}






void loop() {


if (Serial.available())
{
CodeIn = getChar();
if (CodeIn == '=')
{
EQUALS(); // The first identifier is "="
}
}


}


//*********************************************************
char getChar()// Get a character from the serial buffer
{
while (Serial.available() == 0); // wait for data
return ((char)Serial.read()); // Thanks Doug
} // end of getChar
//*****************************************************************
//*****************************************************************




void EQUALS() { // The first identifier was "="
CodeIn = getChar(); // Get another character
switch (CodeIn) { // Now lets find what to do with it
case 'C': { //COMM1 Active


led_Disp.setDigit(0, 7, getChar() - '0', false);
led_Disp.setDigit(0, 6, getChar() - '0', false);
led_Disp.setDigit(0, 5, getChar() - '0', true);
int DP = getChar() - '0';
led_Disp.setDigit(0, 4, getChar() - '0', false);
led_Disp.setDigit(0, 3, getChar() - '0', false);


break;
}


case 'D': { //COMM1 Active


led_Disp.setDigit(0, 1, getChar() - '0', false);
led_Disp.setDigit(0, 0, getChar() - '0', false);
led_Disp.setDigit(1, 7, getChar() - '0', true);
int DP = getChar() - '0';
led_Disp.setDigit(1, 6, getChar() - '0', false);
led_Disp.setDigit(1, 5, getChar() - '0', false);


break;
}
}
}


</ledcontrol.h>

Fess_ter
02-10-2014, 12:02 AM
Be sure to run a separate 5v and ground to other display cards. If you chain the 5v you lose voltage with each card from an onboard diode.

Tom_G_2010
02-21-2014, 09:01 PM
Fess_ter, I don't know if that little tip helped the OP, but it sure put me back in action. I was daisy chaining the power and ground and the third board was acting flaky. If I added 4 or more boards everything went nuts.

But, I just powered each directly and things are working great! Now if I could get my encoders to play nice I'd be in great shape.