MAX7219 Switched Pins, now fried ?

Hello

I am new to Arduino. Trying to build a Flight Simulator Project.

I have 3 Max7219 7 segment displays, i tested one of them yesterday with a sample from the web, was working perfect.
Today i kept on testing, but used another sample for link2fs.
Didn't work, after investigating, i found that the comment in the file for the pins, was wrong, and i didn't notice it and wrote them in like so.

By that i switched the Load and Clock Pins.
My Pins are 4 Data, 3 Clock, 2 Load.
Code used: LedControl led_Display_1 = LedControl(4,2,3,3);
Should be: LedControl led_Display_1 = LedControl(4,3,2,3);

That correct ?

If so, are my Chips now fried ?
The light up on start, all leds, but then nothing.
If they are chained as 3, only the second one works and displays the sample.
If i only hook up the second one, alone it does not work either.
I tried various pins on my mega, tested with alot of different code.
Checked if hooked up right.

Any help is appreciated.

Thanks

Sample code:

#include "LedControl.h" //  need the library
LedControl lc=LedControl(40,42,44,1); // lc is our object
void setup()
{
  lc.shutdown(0,false);
  delay (500); 
  lc.shutdown(1,false);
  delay (500); 
  lc.shutdown(2,false);
  
  lc.setIntensity(0,4);// sets brightness (0~15 possible values)
  lc.setIntensity(1,4);// sets brightness (0~15 possible values)
  lc.setIntensity(2,4);// sets brightness (0~15 possible values)
  
  lc.clearDisplay(0);
  lc.clearDisplay(1);
  lc.clearDisplay(2);
}
void loop()
{
  //1st
  for (int a=0; a<8; a++)
  {
    lc.setDigit(0,a,a,true);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setDigit(0,a,8,1);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setDigit(0,a,0,false);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setChar(0,a,' ',false);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setChar(0,a,'-',false);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setChar(0,a,' ',false);
    delay(100);
  }
  
  //2nd
    for (int a=0; a<8; a++)
  {
    lc.setDigit(1,a,a,true);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setDigit(1,a,8,1);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setDigit(1,a,0,false);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setChar(1,a,' ',false);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setChar(1,a,'-',false);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setChar(1,a,' ',false);
    delay(100);
  }
  
  //3rd
    for (int a=0; a<8; a++)
  {
    lc.setDigit(2,a,a,true);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setDigit(2,a,8,1);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setDigit(2,a,0,false);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setChar(2,a,' ',false);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setChar(2,a,'-',false);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setChar(2,a,' ',false);
    delay(100);
  }
}

Hi, switching the load and clock pins, if that was truly the only mistake, will not have damaged the max7219 at all.

Have you re-tried the test sketch from the web that worked before? Hopefully this will prove the chip is not damaged.

Paul

If you have 3 max7219 chips, should this line:

LedControl lc=LedControl(40,42,44,1);

have 3, not 1, as the final parameter?

PaulRB:
Hi, switching the load and clock pins, if that was truly the only mistake, will not have damaged the max7219 at all.

Have you re-tried the test sketch from the web that worked before? Hopefully this will prove the chip is not damaged.

Paul

Thats good news, Thanks, Yes i have it is not working anymore. Lights up, then goes dark. Doesnt display the anything.
Truly, i have not even changed, the connection since the first test until now, except added the 2 others via chaining and added other stuff to the mega (encoders, switches). Only diffrence was the code error.

WTF: Tested it again now with this sample, removed the 2nd and 3rd code, and now it works
Thats very strange, will test the others now, all solo.

Update:
Tested them all solo, all 3 are working and playing the sample.
Now i need to find out what was going wrong, could it be the usb cable ? i used a long one 3 meters, now im using a 0,5m, or can it be the chaining ? I read somewhere that VCC should not be chained, is there thruth in that ?
Or Is it a power issue ? I read on 5V via USB max 400ma, do 3 displays exceed that ?

PaulRB:
If you have 3 max7219 chips, should this line:

LedControl lc=LedControl(40,42,44,1);

have 3, not 1, as the final parameter?

Yes of course, that was just from testing them one by one.

How have you got the other 2 chips wired? To daisy chain you only connect Arduino to DIN on first chip and then DOUT from that into DIN of the next chip and so on. LOAD & CLK parallel wire to all chips. Also you need separate ISET resistors, decoupling and usually a another higher (10uF) electrolytic to reduce power sag on each chip.

I can't imagine how you could "chain" Vcc. The chip does not have a "Vcc in" and "Vcc out" pin. Have you checked Riva's suggestions yet?

As for total current, I would think that should be ok, but just to check, how many digits on each chip, what value resistor for Iset?

I got it running, they are working now perfectly.

I got buyed modules, like these:

They can be chained, i got it working now by not chainnig the VCC, instead connecting the VCC from each modul to the arduiono separately.

@PaulRB:
8 Digits per chip, resistor unknown.

Thanks for your inputs.

One of the pictures on the link you gave shows 3 modules chained without separate Vcc lines...

PaulRB:
One of the pictures on the link you gave shows 3 modules chained without separate Vcc lines...

Precisely!

Whilst chips may not have "Vcc in" and "Vcc out" pins, virtually all cascadable modules do.

What does interest me having looked at the (cheaper) modules cited in a recent post in the "Displays" forum, is that they have a polarity protection diode in the Vcc line. Now I presume that this only controls the chip on the same board and not the "Vcc out" or there definitely would be a problem!

I plan to investigate this the hard way.

I do prefer green modules to red - easier on the eyes.

Oh, and ...

As long as you have Vcc and GND correctly connected, no transposition of the clock, data and load pins will damage the module in any way.