Go Down

Topic: MAX7219 and resistors for 7-segment displays (Read 2160 times) previous topic - next topic

skootles

Sep 25, 2012, 08:54 pm Last Edit: Sep 25, 2012, 09:18 pm by skootles Reason: 1
I'm trying to figure out how many resistors I need for my project, and where in line to put them. I'm using a MAX7219 to drive sixteen 7-segment common-cathode displays for a scoreboard. Yes, I know that the 7219 only actually supports 8 digits, so let me clarify.

The scoreboard has 4 sides. Each side has 4 digits; 2 for each player's score. Since I only need 4 unique digits, the other 12 displays (3 faces x 4 digits) are wired in parallel with the appropriate digit.

Now, assuming I want to have each segment running at 10mA, that makes a maximum current draw for 1 unique digit 280mA (7 segments x 4 displays x 10mA [not including DP since I don't use it]). Total, that means if all the segments on all the displays were lit up at the same time, it would draw 1.12A.

However, something occurred to me. The digits wouldn't actually be on at the same time because of how the MAX7219 works, right? It cycles the digits on/off very fast so they appear to all be on at the same time, but they aren't. Technically only 1 unique digit (in other words, 4 displays) would be on at a time, meaning that if all the displays were on "at the same time", they would actually only draw a maximum of 280mA total. This means that I could just put my resistors on the SEG pins of the MAX7219. This also means that I only need 7 resistors for the whole lot of displays, instead of 7 resistors for each of the displays, right?

Another thing caught my eye though. In the MAX7219 datasheet, it says that the resistor between the ISET and V+ pins is for controlling the display brightness. Does this mean that with that single resistor between ISET and V+, I don't even need those 7 resistors on the SEG pins?

Also, the datasheet says that a 10K resistor will limit the current on each SEG pin to about 40mA, what value resistor would be required to get that down to 10 or 20mA?

Bonus question: In the datasheet for the MAX7219, it says the following under the absolute maximum section:

Quote
Current
DIG 0-DIG 7 Sink Current..............................................500mA
SEG A-G, DP Source Current........................................100mA


Does that mean 500 / 100mA per pin, or in total?

DVDdoug

The best-easiest solution is probably to use two MAX driver chips...

Quote
Another thing caught my eye though. In the MAX7219 datasheet, it says that the resistor between the ISET and V+ pins is for controlling the display brightness. Does this mean that with that single resistor between ISET and V+, I don't even need those 7 resistors on the SEG pins?
Right...  But, because standard 7-segment displays have a common anode or common cathode, you can't wire the segmentsfrom different displays in series.  And if you wire them in parallel without current limiting resistors, there is nothing to assure that the current is divided equally between them.

However, you might be able to fake-out the driver chip by using a resistor that "programs" very-high current, and then use a separate resistor on each segment to limit the actual current.   But, that's something you'd have to experiment with, if you really think it's worth it...   And, you might fry a driver chip with these "unauthorized" experiments.


Quote
Also, the datasheet says that a 10K resistor will limit the current on each SEG pin to about 40mA, what value resistor would be required to get that down to 10 or 20mA?
Page 10 of the data sheet:
Quote
Selecting RSET Resistor and
Using External Drivers

The current per segment is approximately 100 times
the current in ISET. To select RSET, see Table 11....
.

skootles

#2
Sep 25, 2012, 10:33 pm Last Edit: Sep 25, 2012, 10:38 pm by skootles Reason: 1

And if you wire them in parallel without current limiting resistors, there is nothing to assure that the current is divided equally between them.


Alright thanks, that seems like it might be an issue. I have a whole couple of 7219s at my disposal so I think I might as well go with two drivers. That means more complicated code, but really it shouldn't be that bad.

Quote
Page 10 of the data sheet:
Quote
Selecting RSET Resistor and
Using External Drivers

The current per segment is approximately 100 times
the current in ISET. To select RSET, see Table 11....
.


I was a bit confused by RSET at first, I'm not sure how I missed it. Also the graph on page 4 seems to answer my other question about getting segments down to 10 or 20mA.

So now if all the segments are being properly connected to the drivers (instead of being wired in parallel like I proposed), and I have the appropriate RSET resister between ISET and V+, I should be fine without any more current-limiting resistors, right?

Jack Christensen

To ensure consistent segment current (and hence brightness) and to ensure the 7219 operates within specs, I'd cascade two 7219s and configure each for 8 digits. So each digit would have its own digit driver as intended. This means the code would have to send the data four times, e.g. if the score were 12 to 34, it would send 1234123412341234, but this is quite fast and really very little added complexity. No resistors (other than the Rset resistors) or other creativity required.

There are several MAX72xx libraries around, I'm not familiar with any of them really, but this one does support multiple cascaded devices: http://www.arduino.cc/playground/Main/LedControl

BTW, absolute maximum ratings are to be avoided. The rated typical segment drive current is 40mA, but the minimum is 30mA, so that is what should be designed for.

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

skootles

#4
Sep 26, 2012, 01:14 am Last Edit: Sep 26, 2012, 01:55 am by skootles Reason: 1

BTW, absolute maximum ratings are to be avoided. The rated typical segment drive current is 40mA, but the minimum is 30mA, so that is what should be designed for.


I was checking out the LEDcontrol library last night and it seems like a good library to use. Also, I'm aware that I'd probably burn it out at the absolute max rating. I just listed those ratings because they were what jumped out at me.

I was unaware, however, of the 30mA minimum. I was planning on using these 7-segment displays, however I'm not sure about something from the datasheet:



(I want to use the green ones).

Will this display be ok to use? I believe the 90mA peak forward current means that I can safely put 40mA to it for a very short period of time, like the MAX7219 would as it cycles the digits on/off.

Jack Christensen


Will this display be ok to use? I believe the 90mA peak forward current means that I can safely put 40mA to it for a very short period of time, like the MAX7219 would as it cycles the digits on/off.


The 30mA is max continuous current and 90mA is a peak current when the display is multiplexed, note the "1/10 duty cycle, 0.1ms pulse width" meaning it would be on for 0.1ms then off for 0.9ms in a multiplexed setup.

Note however on the datasheet the Luminous Intensity/Segment is specified with IF = 10mA. I'd try them out first at a low current, then work up if the brightness wasn't sufficient. I might start with a 56K resistor for RSET with the MAX7219, but it could go as low as 12K. If you get to 12K and the display is still not bright enough, then external drivers would be needed, but I'd be really surprised if that was necessary. My experience is that most decent displays (like I'm sure these are) are plenty bright even significantly below the specified test current.

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

skootles


The 30mA is max continuous current and 90mA is a peak current when the display is multiplexed, note the "1/10 duty cycle, 0.1ms pulse width" meaning it would be on for 0.1ms then off for 0.9ms in a multiplexed setup.


That's what I thought, just wanted to make sure! Thanks for your help.

skootles

Actually I've got one more question for someone. The datasheet recommends a 0.1uF ceramic and 10uF electrolytic decoupling capacitors between GND and V+. If I'm using two MAX7219s, can I use one set of capacitors, or should I use two sets?

CrossRoads

Can share the 10uF, but give each chip its own 0.1uF, located close to the power pin and nearest Gnd.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up