Go Down

Topic: MAX7219, 7-segment - daisy chaining (Read 2987 times) previous topic - next topic

AndyInSurrey

I've daisy chained 7 MAX7219 modules like this one.  I'm using a separate power supply to power the modules with a common ground back to the Arduino.  I'm using the LedLibrary and although I have setup 7 units in the code, I can only get the first 5 to display anything.  Can anyone recommend a solution to this problem?

I also found that when the Vcc was also daisy chained I could only get the first two units to work then with >2 units the displays was random data.  I got around this issue by feeding the external Vcc to each unit directly.

AndyInSurrey

Looks like one of my MAX7219 modules is faulty stopping the buffer from going past the 5th module in the chain!

Grumpy_Mike

And you have decoupling capacitors in the circuit as well?

PaulRB

#3
Sep 15, 2017, 06:30 pm Last Edit: Sep 15, 2017, 06:34 pm by PaulRB
And you have decoupling capacitors in the circuit as well?
Mike, you can see what looks like decoupling caps in one of the images on the page Andy linked to.


However, you can also see that there is a space for a reservoir cap, but that does not seem to have been populated. Maybe worth soldering some 10uF electrolytics there.


AndyInSurrey

#4
Oct 01, 2017, 02:45 pm Last Edit: Oct 01, 2017, 02:46 pm by AndyInSurrey
I've added a 10uF electrolytic capacitor to each of the MAX7219 units.  It fits quite nicely under the 7-segment.

Anyway, it hasn't been of much help.  I'm still not able to light up all the digits. 

I'm using an external power supply for all the 7-segments, 5V 4A, with common ground to the arduino uno.

The library I'm using is this  which uses SPI.

The code I'm testing with is this:

Code: [Select]


PINOUT:
MODULE.....UNO / NANO.....MEGA
VCC........ + 5V..........+ 5V
GND.........GND..........GND
DIN..........11...........51
CS(LOAD).....10...........10
CLK..........13...........52
*/

#include <SPI.h>
#include <HCMAX7219.h>


#define LOAD 10

HCMAX7219 MAX7219(LOAD);


void setup()
{
 MAX7219.clear();

 int addr(8);

 MAX7219.print7Seg(88888888, 1 * addr);
 MAX7219.print7Seg(88888888, 2 * addr);
 MAX7219.print7Seg(88888888, 3 * addr);
 MAX7219.print7Seg(88888888, 4 * addr);
 MAX7219.print7Seg(88888888, 5 * addr);
 MAX7219.print7Seg(88888888, 6 * addr);
 MAX7219.print7Seg(88888888, 7 * addr);
 MAX7219.print7Seg(88888888, 8 * addr);
 MAX7219.print7Seg(88888888, 9 * addr);
 MAX7219.print7Seg(88888888, 10 * addr);

 MAX7219.refresh();
}

void loop()
{
 
}


Up to 8 or 9 MAX7219's all is displaying ok, and then with all 10 a lot of digits across all units aren't displayed.  I read something somewhere about adding terminating resistors?

I would appreciate any further assistance.  I need to get 80 7-segment LEDs lit up reliably so I can contnue with my overall project.

PaulRB

Code: [Select]
AUTHOR:  Andrew Davies
That isn't you, then? HobbyComponents seem to be based in Chesterfield, not Surrey.

Did you change this part of the .h file?
Code: [Select]
/***************************** USER CONFIGURATION ****************************/

/* CHANGE THIS VALUE IF YOU ARE DASY CHAINING MORE THAN ONE DRIVER */
#define NUMBEROFDRIVERS 1


/* TO SAVE PROGRAM MEMORY COMMENT OUT ANY OF THE LINES BELOW FOR HARDWARE THAT'S
   NOT BEING USED */
#define SEVENSEGMENT //Seven segment display module HCMODU0082
#define DOTMATRIX //8x8 serial dot matrix module HCOPTO0014

/*****************************************************************************/

PaulRB

Try this:
Code: [Select]

/*
PINOUT:
MODULE.....UNO / NANO.....MEGA
VCC........ + 5V..........+ 5V
GND.........GND..........GND
DIN..........11...........51
CS(LOAD).....10...........10
CLK..........13...........52
*/

#include <SPI.h>
#include <HCMAX7219.h>


#define LOAD 10

HCMAX7219 MAX7219(LOAD);


void setup()
{
 MAX7219.clear();

 int addr=8;

 MAX7219.print7Seg(88888888, 1 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 2 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 3 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 4 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 5 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 6 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 7 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 8 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 9 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 10 * addr);
 MAX7219.refresh(); delay(500);
}

void loop()
{
 
}

AndyInSurrey

Code: [Select]
AUTHOR:  Andrew Davies
That isn't you, then? HobbyComponents seem to be based in Chesterfield, not Surrey.

No, not me.

Did you change this part of the .h file?

Yes, set it to 10
Code: [Select]
/***************************** USER CONFIGURATION ****************************/

/* CHANGE THIS VALUE IF YOU ARE DASY CHAINING MORE THAN ONE DRIVER */
#define NUMBEROFDRIVERS 1


/* TO SAVE PROGRAM MEMORY COMMENT OUT ANY OF THE LINES BELOW FOR HARDWARE THAT'S
   NOT BEING USED */
#define SEVENSEGMENT //Seven segment display module HCMODU0082
#define DOTMATRIX //8x8 serial dot matrix module HCOPTO0014

/*****************************************************************************/



AndyInSurrey

Try this:
Code: [Select]

/*
PINOUT:
MODULE.....UNO / NANO.....MEGA
VCC........ + 5V..........+ 5V
GND.........GND..........GND
DIN..........11...........51
CS(LOAD).....10...........10
CLK..........13...........52
*/

#include <SPI.h>
#include <HCMAX7219.h>


#define LOAD 10

HCMAX7219 MAX7219(LOAD);


void setup()
{
 MAX7219.clear();

 int addr=8;

 MAX7219.print7Seg(88888888, 1 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 2 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 3 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 4 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 5 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 6 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 7 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 8 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 9 * addr);
 MAX7219.refresh(); delay(500);
 MAX7219.print7Seg(88888888, 10 * addr);
 MAX7219.refresh(); delay(500);
}

void loop()
{
 
}

Tried it, displays 88888888 on unit #1 to #9 all ok, then on the 10th it displays some digits and random digits on the units #1 to #9 go

PaulRB

#9
Oct 01, 2017, 06:26 pm Last Edit: Oct 01, 2017, 06:28 pm by PaulRB
Code: [Select]
/* TO SAVE PROGRAM MEMORY COMMENT OUT ANY OF THE LINES BELOW FOR HARDWARE THAT'S
   NOT BEING USED */
#define SEVENSEGMENT //Seven segment display module HCMODU0082
#define DOTMATRIX //8x8 serial dot matrix module HCOPTO0014

Did you comment out the DOTMATRIX line? Perhaps your code is running out of memory. Looking at their library code, I'm not sure HobbyComponents have tested it, or expected anyone to use it, with 10 displays. There are data structures in the library that would be better stored in flash, not ram. Especially for the DOTMATRIX displays, which you are not even using.

AndyInSurrey

Yes I did comment out the DOTMATRIX

PaulRB

#11
Oct 01, 2017, 08:36 pm Last Edit: Oct 01, 2017, 08:38 pm by PaulRB
Ok. So...

Remind me what we have tested already. Did you test the supply voltage at each of the 10 displays? Need to eliminate that from our enquiries.

My next suspicion (chip in, anyone else) is problems with the clock and latch lines. They have to feed all 10 displays in parallel, unlike the data line, which is buffered by each max chip. Can you connect the clock and latch lines output from the 10th display back to original pins on the Arduino? In other words, the clock and latch lines are connected at both ends of the line that runs through all 10 displays. While you are at it, do the same with the 5V and ground lines.

If that does not work, maybe you could try some line buffer/driver chips.

AndyInSurrey

I'm not daisy chaining the supply voltage, the supply voltage is coming from an external supply of 5V 4amps direct to each MAX unit.  Common ground.

Grumpy_Mike

That is probably overkill, what about the other stuff?

PaulRB


Go Up