Arduino Forum

Using Arduino => General Electronics => Topic started by: firashelou on Oct 02, 2015, 05:32 pm

Title: MAX7219 controlling 2 7-segment display ! help !
Post by: firashelou on Oct 02, 2015, 05:32 pm
hello guys,
i am trying to learn how to use the MAX7219 with the LedControl library
so i searched and read about it here on this website and on other and made a the connection for 2 single digits 7-segment display CC of course to the MAX7219, the display number 0 is connected to the DIG 0 on the MAX and the display number 1 is connected to DIG 1 on the MAX
and other segment are connected to the proper SEG on the MAX
so i am trying to print individual numbers just to experiment but nothing is happening, the displays stays off, but when i remove one of the pins connected to arduino, the displays starts to flicker
so i need help please to understand what is going on ?

here is my sketch:

Code: [Select]

//We always have to include the library
#include <LedControl.h>

/*
 Now we need a LedControl to work with.
 ***** These pin numbers will probably not work with your hardware *****
 pin 12 is connected to the DataIn
 pin 11 is connected to the CLK
 pin 10 is connected to LOAD
 We have only a single MAX72XX.
 */
LedControl lc=LedControl(12,11,10,1);

void setup() {
  /*
   The MAX72XX is in power-saving mode on startup,
   we have to do a wakeup call
   */
  lc.shutdown(0,false);
  /* Set the brightness to a medium values */
  lc.setIntensity(0,15);
  /* and clear the display */
  lc.clearDisplay(0);
}


/*
 This method will display the characters for the
 word "Arduino" one after the other on digit 0.
 */
void writeArduinoOn7Segment() {
  lc.setChar(0,0,'a',false);
  delay(delaytime);
  lc.setDigit(0, 0, 1, false);
}

/*
  This method will scroll all the hexa-decimal
 numbers and letters on the display. You will need at least
 four 7-Segment digits. otherwise it won't really look that good.
 */


void loop() {
  writeArduinoOn7Segment();

}
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: CrossRoads on Oct 02, 2015, 07:41 pm
Is there a library call to setup the MAX7219 to only use 2 digits?

Do you have 10K resistor, 0.1uF, 10uF caps connected on the MAX7219 per its datasheet?
Is MAX7219 Gnd connected to Arduino Gnd?

What a waste:
LedControl lc=LedControl(12,11,10,1);
Arduino has great SPI hardware to drive MAX7219 Clock, data, and chip select pins, works great at default 4 MHz speed - yet the library instead bit-bangs the data out to the chip.


Try calling the function less frequently, instead of as frequently as possible:
Code: [Select]

void loop() {
  writeArduinoOn7Segment();

}
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: firashelou on Oct 02, 2015, 07:52 pm
Is there a library call to setup the MAX7219 to only use 2 digits?
what do you mean ? i put my codes as it is

Do you have 10K resistor, 0.1uF, 10uF caps connected on the MAX7219 per its datasheet?
Is MAX7219 Gnd connected to Arduino Gnd?
i have a 33K
oops i forgot the capacitor ! i just added them and 1 digit the one on the right means 0 is now on and it gives letter A upper case


What a waste:
LedControl lc=LedControl(12,11,10,1);
Arduino has great SPI hardware to drive MAX7219 Clock, data, and chip select pins, works great at default 4 MHz speed - yet the library instead bit-bangs the data out to the chip.
Code: [Select]

what do you mean ? i did not understand :/


[quote author=CrossRoads link=msg=2421072 date=1443807696]
Try calling the function less frequently, instead of as frequently as possible:
[code]
void loop() {
  writeArduinoOn7Segment();

}


what should i do here ?
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: firashelou on Oct 02, 2015, 07:54 pm
seems now that it is working when i change the character, it changes except for 'b' when i put 'b' it showed A upper case but upside down
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: firashelou on Oct 02, 2015, 08:02 pm
seems it's working now ! i removed the setChar() function and kept setDigit() and i made a count++ from 0 to 9 and when the count reach 9, it will display a letter on the display number 0 on the right looping threw an array containing the characters

but ! what i noticed is that the display addr should be always 0 but the number of digit must change if i wanna change from the first digit to the next going from right to left ! or, they made a mistake on the website and said in the comment number of display instead of number of MAX7219 !

here are the codes :

Code: [Select]

//We always have to include the library
#include <LedControl.h>

/*
 Now we need a LedControl to work with.
 ***** These pin numbers will probably not work with your hardware *****
 pin 12 is connected to the DataIn
 pin 11 is connected to the CLK
 pin 10 is connected to LOAD
 We have only a single MAX72XX.
 */
LedControl lc=LedControl(12,11,10,1);

void setup() {
  /*
   The MAX72XX is in power-saving mode on startup,
   we have to do a wakeup call
   */
  lc.shutdown(0,false);
  /* Set the brightness to a medium values */
  lc.setIntensity(0,15);
  /* and clear the display */
  lc.clearDisplay(0);
 
  Serial.begin(9600);
}


/*
 This method will display the characters for the
 word "Arduino" one after the other on digit 0.
 */
void writeArduinoOn7Segment() {
  //lc.setChar(0,0,'2',false);
  int i=0;
  static int count = 0;
  char array[9] = {'A','b','c','d','E','F','H','L','P'};
  lc.setChar(0,0,array[count],false);
 
  for(i=0; i<10; i++){
    lc.setDigit(0, 1, i, false);
    delay(250);
    if(i == 9){
      count++;
    }
  }
  if(count == 9){
    count = 0;
  }
}



void loop() {
  writeArduinoOn7Segment();

}
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: firashelou on Oct 02, 2015, 10:48 pm
How to drive a Common Anode display with the MAX7219 ? Paul said it can be done by software so how is that ? or i must use logic gates ?
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: dwightthinker on Oct 02, 2015, 11:17 pm
How to drive a Common Anode display with the MAX7219 ? Paul said it can be done by software so how is that ? or i must use logic gates ?
I believe what he had in mind was to use the display selects to drive the segments and the
segments to drive the individual displays.
Of course, you won't be able to use the character library as it is and you'll only
drive 7 displays ( one for each segment, maybe 8 if there is a DP out, I don't have access
to the MAXIM pdf right now ).
The library you have will not be the easiest to modify to do what you want.
As was mentioned, it might be easier to use the SPI library and use the MAXIM
data sheet to write your own interface.
Dwight
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: firashelou on Oct 02, 2015, 11:53 pm
I believe what he had in mind was to use the display selects to drive the segments and the
segments to drive the individual displays.
what do you mean by this :/ ?


Of course, you won't be able to use the character library as it is and you'll only
drive 7 displays ( one for each segment, maybe 8 if there is a DP out, I don't have access
to the MAXIM pdf right now ).
The library you have will not be the easiest to modify to do what you want.
As was mentioned, it might be easier to use the SPI library and use the MAXIM
data sheet to write your own interface.
Dwight

but how to do this ? how to use the SPI ?
in fact the tutorials about the MAX with 7-segment are rare online :/

Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: dwightthinker on Oct 03, 2015, 03:06 am
I mean you only write to one segment at a time the digits run the segments.
You do the multiplexing in software.
The Maxim data sheet explains how to bypass the character ROM.
As for how to use the SPI, look at:

https://www.arduino.cc/en/Reference/SPI

I think it covers it. It also has a pointer to the a software driven signals.
Look at the Maxim data sheet. It explains any of the rest.
You most likely need to experiment in your software to determine the desired
multiplexing rate that doesn't miss or beat with the multiplexing rate of the
Maxim chip.
Dwight
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: Paul__B on Oct 03, 2015, 09:03 am
You do the multiplexing in software.
What on earth do you mean by that?  You meant font generation, didn't you?

Right, the whole question has been muddled.  As best can be figured here, the question is how to drive a common anode display with the MAX7219.

There is no problem here.  You simply interchange digits and segments so that the common anodes are driven by the "segment" pins and the segment cathodes are driven by the "digit" pins.  You clearly have to generate the font yourself, but you need to do that anyway to display other than digits 0 to 9, "H". "E", "L", "P", "-" and blank (and IIRC, in that order).  As such, you can drive as always, eight seven segment displays with their decimals.  You can actually drive eight common anode 7-segment displays without decimals plus one common cathode display with a decimal!

The multiplexing - as always - is performed by the MAX7219.  The display limit of course, must be set to 8, or 7 if you really do not need the decimals, because it is now constraining the number of segments, not the number of digits.

The only reason to require software multiplexing is where you use two or three MAX7221s to drive RGB matrices.
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: firashelou on Oct 03, 2015, 11:46 am
What on earth do you mean by that?  You meant font generation, didn't you?

Right, the whole question has been muddled.  As best can be figured here, the question is how to drive a common anode display with the MAX7219.

There is no problem here.  You simply interchange digits and segments so that the common anodes are driven by the "segment" pins and the segment cathodes are driven by the "digit" pins.  You clearly have to generate the font yourself, but you need to do that anyway to display other than digits 0 to 9, "H". "E", "L", "P", "-" and blank (and IIRC, in that order).  As such, you can drive as always, eight seven segment displays with their decimals.  You can actually drive eight common anode 7-segment displays without decimals plus one common cathode display with a decimal!

The multiplexing - as always - is performed by the MAX7219.  The display limit of course, must be set to 8, or 7 if you really do not need the decimals, because it is now constraining the number of segments, not the number of digits.


first question:
but isn't the LedControl library made for Seg as Seg and diG as Dig ?

second question :
Is it possible to use Logic Gates to perform this instead of changing the software ?

third:
Is there any example for what you said ?


four:
where do i have to change the characters where do i have to make them i don't get it ?
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: Paul__B on Oct 03, 2015, 01:52 pm
first question:
but isn't the LedControl library made for Seg as Seg and diG as Dig?
Honestly do not know, haven't used it!

second question :
Is it possible to use Logic Gates to perform this instead of changing the software ?
Oh come on!

No.

Why?  Well, the logic is inside the chip, you see.  That's what we are doing here, using software.

third:
Is there any example for what you said ?
Sorry, I personally do not have any example to hand.

four:
where do I have to change the characters where do I have to make them I don't get it ?
If there is not an available library, you have to make an array with the character font, and use the array to translate.  For example the character "0" might be B0111110 - every segment from A to F active, not G or DP.  This would mimic the built-in character generator but with segments and digits swapped, you actually have to have a temporary array to hold either the data digits to be displayed, or - probably simpler - their corresponding character patterns.  You then read corresponding bits of each byte in the array into each register in the MAX7219 so that the first register contains all the bits for segments A, then next all the segments B and so on.
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: firashelou on Oct 03, 2015, 03:18 pm
Honestly do not know, haven't used it!
then how do you program this chip ?!!
give me an example please online all they use is the LedControl library which here on this website too !

Oh come on!

No.

Why?  Well, the logic is inside the chip, you see.  That's what we are doing here, using software.
but why not ! i mean we know the connection and how they work, it lets the proper DIG opens so instead we can connect the DIG to a logic gate that will give 0 out from 1 in it's simple

If there is not an available library, you have to make an array with the character font, and use the array to translate.  For example the character "0" might be B0111110 - every segment from A to F active, not G or DP.  This would mimic the built-in character generator but with segments and digits swapped, you actually have to have a temporary array to hold either the data digits to be displayed, or - probably simpler - their corresponding character patterns.  You then read corresponding bits of each byte in the array into each register in the MAX7219 so that the first register contains all the bits for segments A, then next all the segments B and so on.

i don't understand :/
if you see my codes up top you will notice how it works, same as the LCD library some how
there is no array no nothing, all are in the library all i have to do is know how to use the function provided
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: dwightthinker on Oct 03, 2015, 08:16 pm
Paul, I was wrong about the software multiplex but
I think the problem is the uneven brightness.
You'd need to know when each digit was driven so that
you could rewrite the brightness control to match the number
of segments turned on at that time.
The digit control is just a pull high if used for segments, it
doesn't know how many are driven. One could make a small
circuit to sample the first digit out. It could then
synchronize to the display with updated brightness controls.
Dwight
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: dwightthinker on Oct 03, 2015, 08:29 pm
Firashelou,
Here is the data sheet for the display:

https://www.sparkfun.com/datasheets/Components/General/COM-09622-MAX7219-MAX7221.pdf

Here is how you use the SPI:

https://www.arduino.cc/en/Reference/SPI

Read these until you have some understanding of them. Don't ask us to write
your code for you. When you have specific questions please come back we will
be glad to help you but you need to be asking a specific question.
The answers to the questions you've asked are in these two locations. If some part
of one of these is not clear, ask us about that part that isn't clear.
If you write some code and it doesn't work, you can ask about it.
Dwight
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: firashelou on Oct 03, 2015, 09:10 pm
Firashelou,
Here is the data sheet for the display:

https://www.sparkfun.com/datasheets/Components/General/COM-09622-MAX7219-MAX7221.pdf

Here is how you use the SPI:

https://www.arduino.cc/en/Reference/SPI

Read these until you have some understanding of them. Don't ask us to write
your code for you. When you have specific questions please come back we will
be glad to help you but you need to be asking a specific question.
The answers to the questions you've asked are in these two locations. If some part
of one of these is not clear, ask us about that part that isn't clear.
If you write some code and it doesn't work, you can ask about it.
Dwight

ok thank you i found some examples for CA display with the MAX7219 so i hope it would work

and by the way what is your opinion for the last time about Paul's method ?
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: CrossRoads on Oct 03, 2015, 09:38 pm
Quote
You'd need to know when each digit was driven so that
you could rewrite the brightness control to match the number
of segments turned on at that time.
I can't see that working as the MAX7219 multiplexes at 800 Hz.
With common cathode, we assume the anodes are driven, and one cathode goes low to turn on one digit.
With a common anode display, it'd be like the same segment of all digits was driven at the same time. So that'd be even harder to control the brightness.


The uneven brightness is more likely from the Scan register in the MAX7219 not being set to match the number of digits selected.
The Max7219 is just a bunch of registers.
To control them via SPI is pretty simple:
Code: [Select]

digitalWrite (ssPin, LOW);
SPI.transfer(registerAddress); // 00 to 15
SPI,transfer (dataToWrite);
digitalWrite (ssPin, HIGH);






addresses 0x09, 0A, 0B, 0C, 0F are usually written in setup() and then not changed.  0A may be changed in loop() for brightness control.
0x01 to 0x08 are the individual digits. You send the data you want displayed for the 8 segments each register controls.
For common cathode 7-segment display, one register is one digit. You can set the scan limit register to 2 to only have 2 digits being driven.
For common anode 7-segment displays, one register is one segment across the 8 digits. So you can see how writing a font is a little funny, with 1 bit of register 1 thru 8 would make up a digit. You'd need the scan limit register set to 7 or 8 to ensure that all segments were being controlled. Bits 0,1 of each register would only be used for the 2 digits for example.
The font might look like
Code: [Select]

byte fontArray[] = {
0b11101101, // segment a
0b10011111, // b
0b11111011, // c
0b01101101, // d
0b01000101, // e
0b01110001, // f
0b01111100, // g
0b00000000, // dp
};


with bit 0 = 0, 1 =1, 2 =2 , 3 =3, 4=4, 5=5, 6=6, 7=7. More bytes are needed for 8,9,0 other letters.
1 in a position = segment on.
So you'd set the NoDecode register to NoDecode mode, and send all 8 digits out.






Code: [Select]

for (byte x=0; x<8; x=x+1){
digitalWrite (ssPin, LOW);
SPI.transfer(registerAddress+1); // result is 1 to 8 for addresses
SPI,transfer (fontArray[dataArray[x]]); // double look up!
digitalWrite (ssPin, HIGH);







The fontArray, dataArray would need a little more thinking. I'm not convinced the mapping I describe above would work, this is my first time looking at it this way.
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: CrossRoads on Oct 03, 2015, 09:39 pm
(freaking forum! messing up my simple code example with color tags. Arrgh!)
(alright, all cleaned up now)
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: dwightthinker on Oct 03, 2015, 10:05 pm
and by the way what is your opinion for the last time about Paul's method ?
You set the Maxim chip to the direct mode, as would be done for 64
LEDs ( read the Maxim spec ). The only issue you will have is that you'll
need to map the segments to the right locations ( some binary logic in your code ).
I recommend you first build the bytes into a memory array of 8 bytes.
You'll need to put one digits segments in as a specific bit of each byte.
Then send the bytes to the display, once build up.
To help out, make a map on a page to see what you need 8x8 map.
I see now I was incorrect about the intensity. If you draw the map, you'll see
what is going on.
Each location on the grid is one segment of your LED. By transposing the axis,
segments for digits, instead of lighting one LED digit up at a time with the
multiplexing, you are doing it sideways across the display.
You just can't use the ROM inside the display to convert the number 1 into
two segments on one digit of the display.
You need to make a table of each segments to light up for each number.
You are switching rows for columns to write to the display.
As an example, you wanted to write the number 5 in the first digit of you display.
Looking at the spec, that is segments A,C,D,F and G.
So, translated, that would be,
Byte0, D0 =1  // your G
Byte1, D0 =1  // F
Byte2, D0 =0  // no E
Byte3, D0 =1  // D
Byte4, D0 =1  // C
Byte5, D0 =0  // no B
Byte6, D0 =1  // A
Byte7, DP?

If you wanted the next digit to show 4, that would be B,C,F and G.
or
Byte0, D1 =1  // your G
Byte1, D1 =1  // F
Byte2, D1 =0  // no E
Byte3, D1 =0  // D
Byte4, D1 =1  // C
Byte5, D1 =1  // no B
Byte6, D1 =0  // A
Byte7, DP?

so the bytes built up for the display would be
0x03,0x03,0x00,0x01,0x03,0x02,0x03
and would display 54 on the first two digits.
I hope this makes some sense.
Dwight

Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: Paul__B on Oct 03, 2015, 10:21 pm
then how do you program this chip ?!!
By writing code to put the data that I want, into the registers in the chip. :smiley-roll:

give me an example please online
Sorry, that would take a lot of research! :smiley-eek:

all they use is the LedControl library which here on this website too !
Well, not having used it, I can't really help with it.  Maybe some day I will, but so far I haven't.

but why not ! i mean we know the connection and how they work, it lets the proper DIG opens so instead we can connect the DIG to a logic gate that will give 0 out from 1 in it's simple
No, it isn't.  As I explain below, the MAX7219 does a whole lot of work for you.  Adding "logic" (level shifting) unless there is no other way (such as when driving 12V displays), defeats the whole purpose.

there is no array no nothing, all are in the library all i have to do is know how to use the function provided
You are stuck then!  :smiley-eek:

Paul, I was wrong about the software multiplex but I think the problem is the uneven brightness.  You'd need to know when each digit was driven so that you could rewrite the brightness control to match the number of segments turned on at that time.
The digit control is just a pull high if used for segments, it doesn't know how many are driven. One could make a small circuit to sample the first digit out. It could then synchronise to the display with updated brightness controls.
Total and complete nonsense!

The whole point of the MAX7219 is that it is an array driver to drive an array of 64 - 8 by 8 LEDs.  It does not care what the array looks like, it just drives eight at a time, the same time for each eight, and it controls the current to each of the eight LEDs that it may be driving.  All segments - if it is driving an array of segments - get equal attention.

The uneven brightness is more likely from the Scan register in the MAX7219 not being set to match the number of digits selected.
Equal nonsense.  Gah!  You didn't manage to remove the colour garbage!  I give up quoting any more of your post.

If you are scanning by segment instead of digit, then the scan register is set to the number of segments - either seven or eight if you are actually using decimal points as well.  That's it!  That's all the scan register has to do with it, and all segments - in all digits - get equal brightness.  Of course, if you only have two displays, then you are only ever driving two anodes at any time.

You - and dwightthinker who has added stuff since I wrote this - have the array buffer concept correct.
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: dwightthinker on Oct 03, 2015, 10:28 pm
Total and complete nonsense!

Yep, I had to draw out the array before I figured that out. If you read my
last post, I corrected my self.
Thanks for checking
Dwight
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: CrossRoads on Oct 03, 2015, 10:37 pm
I don't know, I think the scan register may still come into play:
Quote
Scan-Limit Register
The scan-limit register sets how many digits are displayed,
from 1 to 8. They are displayed in a multiplexed
manner with a typical display scan rate of 800Hz with 8
digits displayed. If fewer digits are displayed, the scan
rate is 8fOSC/N, where N is the number of digits
scanned. Since the number of scanned digits affects
the display brightness, the scan-limit register should
not be used to blank portions of the display (such as
leading zero suppression). Table 8 lists the scan-limit
register format.
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.
Table 9 lists the number of digits displayed and the
corresponding maximum recommended segment current
when the digit drivers are used.
I've only driven digits as common cathode tho, and made my own font array when I did this 8x32 display:
https://www.youtube.com/watch?v=hwYqgyMc5S4 (https://www.youtube.com/watch?v=hwYqgyMc5S4)
Looks a lot brighter in person, haven't got filming LEDs down yet.
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: Paul__B on Oct 03, 2015, 11:15 pm
I don't know, I think the scan register may still come into play
No.

Quote
The scan-limit register sets how many digits are displayed,
from 1 to 8.
So if you have swapped digits for segments, the scan register defines how many segments you may connect - which is clearly either seven or eight.
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: CrossRoads on Oct 04, 2015, 12:51 am
Quote
the scan register defines how many segments you may connect 
Disagree - there is no register setting to use Common Anode vs Common Cathode, so all 8 segments will always be driven - but not all 8 digits (anodes) unless the scan register is set to 8.
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: dwightthinker on Oct 04, 2015, 05:22 am
What he is saying is that if using digits to run segments, that register
controls the number of segments since the segments are wired to the chips
digit drivers.
Yes, there is not common cathode/anode switch ( although there should have
been ).
There is a switch so that one can treat the array as 64 individual LEDs.
That means, with the right data, it can be used as either cathode/anode.
Dwight
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: runaway_pancake on Oct 05, 2015, 01:38 pm
http://forum.arduino.cc/index.php?topic=121174.0 (http://forum.arduino.cc/index.php?topic=121174.0)
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: firashelou on Oct 05, 2015, 03:23 pm
http://forum.arduino.cc/index.php?topic=121174.0 (http://"http://forum.arduino.cc/index.php?topic=121174.0")
seems interesting but there is a problem with the links when you share it it opens in new tab with this : http://"http//forum.arduino.cc/index.php?topic=121174.0%22
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: CrossRoads on Oct 05, 2015, 04:05 pm
(Offtopic - Pasting in links seems to vary day by day as well - I often see extra http & %22 added, but some days not - links I have created today typing in [ url ] and [ /url ] are working, but I have not tried any forum links today. Forum link pasting yesterday with Chrome seemed to work ok. Very aggravating at times.)
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: runaway_pancake on Oct 05, 2015, 11:46 pm
I don't know why that happens either.
Clicked on the 'View source' button and fixed the hyperlink.
[ If typed in as it is/was shown, that works (of course). ]
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: dwightthinker on Oct 05, 2015, 11:49 pm
I always cut and paste links anyway for security reasons.
I want to know where I'm connecting if possible.
Dwight
Title: Missing the forest for the trees!
Post by: Paul__B on Oct 06, 2015, 01:46 pm
Disagree - there is no register setting to use Common Anode vs Common Cathode
And that is precisely the point.

In fact, the chip does not actually have "segment drivers" or "digit drivers" at all notwithstanding what they are called in the datasheet (https://www.sparkfun.com/datasheets/Components/General/COM-09622-MAX7219-MAX7221.pdf) - it has anode drivers and cathode drivers with each cathode driver corresponding to one register in the chip, and the "Scan limit" register determining how many cathode drivers are enabled.  It does not care to what you actually connect the lines as long as they connect correctly to anodes and cathodes in a matrix.

so all 8 segments will always be driven - but not all 8 digits (anodes) unless the Scan Limit register is set to 8.
So if we now understand that the cathode drivers are now connected to segments in a common anode display, then the Scan Limit register will necessarily determine how many segments are enabled in the multiplex.
Title: Re: MAX7219 controlling 2 7-segment display ! help !
Post by: srivijayjain on Apr 24, 2017, 10:04 pm
i am use max 7219 ic with single digit 7 segument Display use college project ,

and  "led control.h" header i was use but its not show properly plz help me friends