Max7219 All lit accept when Rset is removed

I'm using an ElEGOO UNO R3 board and trying to control a single Max 7219 chip. I was having the all-lit issue with a 4 digit seven-segment display but it would try and visibly flash. when the Rset resister is removed it would run but display nothing legible, The segments would turn on and off but some just dimmed and flickered.

I set up 8 LEDs in common anode on Dig 0 and ran each cathode to segments A - G and Dp. the same issue. All lit unless I remove the Rset resistor, and I am getting revers lit segments when the resister is removed. so 0 is turning off Seg A-F and turning on Seg G.

when I have it try and cycle threw numbers I still get some flickering of Segments that are supposed to be off like the Dp and it still won't do anything unless RSet is removed.

here is my code using LEDControl Library

#include <LedControl.h>
LedControl lc=LedControl (7, 6, 5, 1);
unsigned long delaytime = 250 ;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
    Serial.println("wake");
  lc.shutdown(0, false);
    Serial.println("set intensity");
  lc.setIntensity(0,7);
    Serial.println("clear");
  lc.clearDisplay(0);
  
  Serial.println("verify complete");
}

void scrollingDigits() {
    Serial.println("pre For");
    for(int i=0;i<13;i++){
      lc.setDigit(0,3,i,false);
      lc.setDigit(0,2,i+1,false);
      lc.setDigit(0,1,i+2,false);
      lc.setDigit(0,0,i+3,false);
      delay(delaytime);
    }
    Serial.println("Post for");
    lc.clearDisplay(0);
    delay(delaytime);
  }

void loop() {
  // put your main code here, to run repeatedly:
    for(int i=0;i<13;i++){
      lc.setDigit(0,0,i,false);
      
      delay(350);
    }
}  

I'm following the electrical schematics from The LEDControl website linked in the library and the Max7219 Datasheet

any help would be appreciated.

Let's be clear.

The MAX7219 works with a common cathode display.

you can use it with a common anode display, but you have to connect the "digit" pins to to the segments and the "segment" pins to the common anodes and code accordingly. :thinking:

MAX7219Features

The MAX7219 is designed to work only preferably with CC (common cathode) type LED/7-segment display unit (Fig1, 2). So, if you are using CA-type, the behavior could be erratic. edit

MAX7219Features
Figure-1:

max7219-4Digit
Figure-2:

1 Like

Complete and utter nonsense! :astonished:

The MAX7219 does not care whether it is driving a common-anode or common-cathode display - whatever those often indeterminate terms mean.

All it sees is a matrix of LEDs, and receives instructions to drive a matrix of LEDs.

The only thing it has that relates to common-cathode 7-segment displays, is a simple decoder that can be used to generate 16 suitable patterns for decimal digits and a few simple characters ("E", "H", "L", "P" and "-"). Not actually terribly useful as you usually wish to generate other patterns.

It works perfectly well with common-anode 7-segment displays, but you have to write the code to do so, which is naturally, slightly different to driving common-cathode 7-segment displays.

That is all. :roll_eyes:

@Paul_B

Then why does the feature (shown in Fig-1 of post #1) include the following term:?
Drive Common-Cathode LED Display

Datasheet says:

Net says:
max7219cc-2

Schematic Example from datasheet that shows CC-type 7-segment display unit:

I guess there is one other feature of the chip which works only with common cathode displays, which is the "scan limit" register. It can be used to increase the maximum brightness of the displays when using less than 8 digits by not scanning the missing digits. In theory this could make a 4 digit display twice as bright, although it would not actually look twice as bright to the eye. I guess this would have been a more useful feature back when the chip was designed because LEDs were much less efficient back then compared to modern "high brightness" LEDs, which produce more light per mA of current.

1 Like

Heh, heh, you mean it works only with seven segment common cathode displays as you would not want to limit the number of segments with a common anode seven segment display. :astonished:

I deliberately chose not to mention that as it would be just muddying the waters. :grin:

The point is - again - that there is no reason whatsoever that you can not, or even should not use a MAX7219 to drive a common-anode seven segment display. If you have such a display and particularly if it is 8-digits, the MAX7219 is arguably the optimum way to drive it.

You merely have to code appropriately as needless to say, you have to code appropriately for any display. :face_with_raised_eyebrow:

I stated that the MAX7219 works with a common cathode display - as it does - and that it also works - just as well - with a common anode display.

I note @GolamMostafa has now corrected his most nonsensical assertion. Thank you. :+1:

In respect of the "scan limit" register, note from page 10:

If the scan-limit register is set for three digits or less, individual digit drivers will dissipate excessive amounts of power. Consequently, the value of the RSET resistor must be adjusted according to the number of digits displayed, to limit individual digit driver power dissipation.

Learning is a continuous process! :slight_smile:

I stated that the MAX7219 works with a common cathode display (as it does) and that it also works (just as well) with a common anode display.

I have paraphrased as above just to emphasize that "and that it also works" is not an "optional part".

As a non-native, we have learnt that the English Grammar offers the following three styles/rules to enclose optional items in a sentence:
pair of - and -
pair of , and ,
pair of ( and )

Great!
:+1:

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.