MAX7219, LedControl and 2.3'' 7-Segment display. Timing issue?

Hi all and best wishes for Merry Christmas,

I'm being puzzled by a strange issue and need your valuable advise.

I'm trying to drive 8 x Common Anode 2.3'' tall 7-segment displays. These require 8Vf and 20mA.
MAX7219 datasheet has ways that his can be done with FETs and transistors. But searhing, I run into this post from a guy wanting to do just the same.

So this is what I built:

The top left IC is of-course a MAX7219 driven by an Arduino which is not shown here.
I'm using the LedControl library for this.

I had this tested on breadboard, using only 2 out of the 8 displays (as DIG-0 and DIG-1) and it was working fine (so I thought, but I should have tested more digits to discover there is a problem)

So went on and created a PCB out of it. Now that I have connected 4 of the 8 displays I'm having a problem which I will try to explain with example as I can not come up with another way to describe it.

So lets say I only have DIG-0 enabled and showing number 1 ( lc.setDigit(0,0,(byte)1,false); )
Then DIG-0 will work normally and show 1 and all other digital are of, as expected.

if I do the same for DIG-1 the same thing happens. The number appears on DIG-1 and all other digits are OFF.

When I try to display something on DIG-2 however, the same thing will ALSO be displayed on DIG-0. So if DIG-2 where to display number 3 the number three will also be displayed on DIG-0 as well.

The same holds true for all other Digits. Whatever displays on all digits (except for DIG-1) it will also be displayed on DIG-0.

In the above picture the DIG-0 should have been displaying number 1. But instead it displays additional segments from DIG-2 and DIG-3 (but not DIG-1).

I was thinking of a short-circuit, but wouldn't this mean that when I display something on DIG-0 the same thing would be displayed on all other (except DIG-1) digits? Moreover, if there was a short-circuit, since all digits (except DIG-1) are interfering with DIG-0 wouldn't they interfere among themselves? This is not the case as all other digits display their data only to themselves and to DIG-0.

Sorry, I can not explain it any better than this, I hope you understood me...

I would really like your advice as to what should I look in order to troubleshoot this...

Thank you for taking the time to read this.

Nikos

PS. Just realized that the diagram shows a bit small. If you go the the image address it will show larger.

I'm surprised you haven't burned up your display yet, with no current limiting on either the source side of the LEDs or on the sink side.

Try putting pullup resistors on the output of the '2803 to ensure the cathodes are getting turned off when not driven low.
You could be running into ghosting introduced by turn-on/turn-off delays among the buffer chips, interacting with the 800Hz multiplexing of the MAX7219.

Hi Nikos,

I know it is too late to change your design now, but for others searching for suggestions like you did, I would suggest saa1064 driver chip. These drivers can work with common anode displays with forward voltages up tp 15V, so no need for extra driver/buffer chips, series resistors and so on. Each chip can drive only 4 digits, so two chips would have been needed for your project, but up to 4 of these chips can be attached to the same i2c bus which the chip uses to communicate with the Arduino.

Paul

I think you need to show us the code (in code tags of course) you are using to illustrate each digit.

I'm betting there is a moment here!

CrossRoads:
I'm surprised you haven't burned up your display yet, with no current limiting on either the source side of the LEDs or on the sink side.

Try putting pullup resistors on the output of the '2803 to ensure the cathodes are getting turned off when not driven low.
You could be running into ghosting introduced by turn-on/turn-off delays among the buffer chips, interacting with the 800Hz multiplexing of the MAX7219.

I am too! I have no previous experience with 7-segment displays and particularly those big ones, so I used a 4.7K trimmer with full resistance when I first connected in order to measure current and optimal series resistance.
It turned out that each segment of these Chinese fellows draws no more that 20mA even when they are directly connected to their nominal 8V, without any resistor. Opting for as much brightness as I could, I left it without any resistor...

I will try to pull the outputs of 2803 up to see how it goes.. Thank you CrossRoads!

PaulRB:
Hi Nikos,

I know it is too late to change your design now, but for others searching for suggestions like you did, I would suggest saa1064 driver chip. These drivers can work with common anode displays with forward voltages up tp 15V, so no need for extra driver/buffer chips, series resistors and so on. Each chip can drive only 4 digits, so two chips would have been needed for your project, but up to 4 of these chips can be attached to the same i2c bus which the chip uses to communicate with the Arduino.

Paul

Nice little chip. I wish I knew its existence prior to starting this project. I might consider changing the whole design though, the only thing I'm thinking is the time invested on research already... It is an one-off project so the PCB i'm constructing myself, it will be an addtional day drawing/routing and another for developing the PCB.

One question though. I see the datasheet and it says it can be supplied with up to 15V. I guess, since we need the I2C bus on the 5V range, I will need to supply 5V to the IC. Then the 8-10V that I need to power the Displays will need to be supplied by the transistor controlled from the MX1 and MX2 outputs, right?

Another issue, I see its a bit old... I'm afraid I will not be able to find it here in Greece. Anyone know of any alternates?

Thanks!

Paul__B:
I think you need to show us the code (in code tags of course) you are using to illustrate each digit.

Well, its not actually rocket science kind of code :slight_smile:
Here you go:

#include "LedControl.h" //  need the library
#include <binary.h>

LedControl lc=LedControl(12,11,10,1); // 
 
// pin 12 is connected to the MAX7219 pin 1
// pin 11 is connected to the CLK pin 13
// pin 10 is connected to LOAD pin 12
// 1 as we are only using 1 MAX7219
 
void setup()
{
  delay(1000);
  // the zero refers to the MAX7219 number, it is zero for 1 chip
  lc.setScanLimit(0, 4);
  lc.shutdown(0,false);// turn off power saving, enables display
  lc.setIntensity(0,15);// sets brightness (0~15 possible values)
  lc.clearDisplay(0);// clear screen
  Serial.begin(115200);
}
unsigned long lastTimeRun=millis();
int interval = 2000;

void loop()
{

      
      
//      
//      lc.setLed(0,0,1,true); // turns off LED at col, row
//      lc.setLed(0,1,7,true);
//      delay(200);
//      lc.setLed(0,0,1, false);
//      lc.setLed(0,1,7,false);
//      lc.setLed(0,0,2,true); // turns off LED at col, row
//      lc.setLed(0,1,6,true);
//      delay(200);
//      lc.setLed(0,0,2, false);
//      lc.setLed(0,1,6,false);
//      
//      lc.setLed(0,0,3,true); // turns off LED at col, row
//      lc.setLed(0,1,5,true);
//      delay(200);
//      lc.setLed(0,0,3, false);
//      lc.setLed(0,1,5,false);
//      lc.setLed(0,0,4,true); // turns off LED at col, row
//      lc.setLed(0,1,4,true);
//      delay(200);
//      lc.setLed(0,0,4,false);
//      lc.setLed(0,1,4,false);
//      lc.setLed(0,0,5,true);
//      lc.setLed(0,1,3,true);
//      delay(200);
//      lc.setLed(0,0,5, false);
//      lc.setLed(0,1,3,false);
//      lc.setLed(0,0,6,true); // turns off LED at col, row
//      lc.setLed(0,1,2,true);
//      delay(200);
//      lc.setLed(0,0,6, false);
//      lc.setLed(0,1,2,false);
//      lc.setLed(0,0,7,true); // turns off LED at col, row
//      lc.setLed(0,1,1,true);
//      delay(200);
//      lc.setLed(0,0,7, false);
//      lc.setLed(0,1,1,false);
//      
//       lc.setLed(0,0,1,true); // turns off LED at col, row
//      lc.setLed(0,1,7,true);
//      delay(200);
//      lc.setLed(0,0,1, false);
//      lc.setLed(0,1,7,false);
//      lc.setLed(0,0,2,true); // turns off LED at col, row
//      lc.setLed(0,1,6,true);
//      delay(200);
//      lc.setLed(0,0,2, false);
//      lc.setLed(0,1,6,false);
      
//      lc.setLed(0,3,3,true); // turns off LED at col, row
//      
//      delay(200);
//      lc.setLed(0,3,3, false);
//      
//      lc.setLed(0,3,4,true); // turns off LED at col, row
//      
//      delay(200);
//      lc.setLed(0,3,4,false);
//      
//      lc.setLed(0,3,5,true);
//      
//      delay(200);
//      lc.setLed(0,3,5, false);
//     
//      lc.setLed(0,3,6,true); // turns off LED at col, row
//      
//      delay(200);
//      lc.setLed(0,3,6, false);
//      
//      lc.setLed(0,3,7,true); // turns off LED at col, row
//      
//      delay(200);
//      lc.setLed(0,3,7, false);
//      
    if (millis() - lastTimeRun > interval) {
        
      lc.setDigit(0,0,(byte)1,false);
      
      lc.setDigit(0,1,(byte)2,false);
     
      lc.setDigit(0,2,(byte)3,false);
      
      lc.setDigit(0,3,(byte)4,false);

//      lc.setDigit(0,4,(byte)5,false);

//      lc.setDigit(0,5,(byte)6,false);

//      lc.setDigit(0,6,(byte)7,false);

//      lc.setDigit(0,7,(byte)8,false);
      
      lastTimeRun = millis();
      }
      
}

Sorry about all those commented lines, they are part of testing/troubleshooting.

I see the datasheet and it says it can be supplied with up to 15V. I guess, since we need the I2C bus on the 5V range, I will need to supply 5V to the IC. Then the 8-10V that I need to power the Displays will need to be supplied by the transistor controlled from the MX1 and MX2 outputs, right?

No, you supply the chip with the higher voltage. It needs that to be able to switch on the transistors, which simply act as emitter-followers. It does not need a 5V supply because slave devices on an i2c bus only need to pull the data line down to ground with an open collector output. The bus lines are pulled up to 5V by external resistors or (and I'm not necessarily recommending this) by the Arduino's internal pullups.

PaulRB:
No, you supply the chip with the higher voltage. It needs that to be able to switch on the transistors, which simply act as emitter-followers. It does not need a 5V supply because slave devices on an i2c bus only need to pull the data line down to ground with an open collector output. The bus lines are pulled up to 5V by external resistors or (and I'm not necessarily recommending this) by the Arduino's internal pullups.

But will 5V be interpreted by the SAA as the correct logic (LOW if I'm not mistaken) on the I2C bus ?

nikosk:
But will 5V be interpreted by the SAA as the correct logic (LOW if I'm not mistaken) on the I2C bus ?

Not quite sure what you mean by that, but rest assured it does work correctly.