Best IC to pilot 4 digits 7 segment

I have always used an 74HC595, but if there are some heavy computational task going on the Arduino can't refresh the screen enoght fast.
There are some other tipical IC to substitute the '595? (and even using four of these in parralel, crazy wiring :sleeping: )

Thank you! :slight_smile:

MAX7219 (for common cathode)
Use SPI

MAX7219 (for common anode)
SPI optional.

MAX7219 doesn't do common anode without other hardware support. It is designed for common cathode - drives up to 8 segment lines high, and one of 8 common cathode lines (digit select lines) low at a time.
Or daisy chain open-drain shift registers, one per digit. 4 SPI transfers to load them up:

digitalWrite (ssPin, LOW);
SPI.transfer[fontArray[digits[0]]); // fontArray[ ] contains the segment mapping
SPI.transfer[fontArray[digits[1]]); // ex 0b000000110; // turn on segments B, C for #1
SPI.transfer[fontArray[digits[2]]);
SPI.transfer[fontArray[digits[3]]);
digitalWrite (ssPin, HIGH);

TPIC6B595, TPIC6C595, TPIC6D595 are good, select depending on current & voltage to be supported.
74HC595 not so good only rated for 70mA total, so 8-9mA per IO pin.

I thought someone might say that!

That was my point.

As I explained before in detail, The MAX7219 works perfectly well with common anode displays!

If what you want is the most simple and compact assembly, and you do not want to have to perform the multiplexing in software, then the MAX7219 is the clear winner (there are of course other chips that do the same job); even if you have a common anode display - no "other hardware support" required. (What on earth does that mean?)

Yes, you need to arrange your code accordingly but that is trivial; you do not have to do the multiplexing.

And you do not need SPI.

but if there are some heavy computational task going on the Arduino can't refresh the screen enoght fast.

I was suggesting SPI because of this.

And you do not need SPI.

5 different people 5 different ways.

Paul__B:
I thought someone might say that!

That was my point.

As I explained before in detail, The MAX7219 works perfectly well with common anode displays!

If what you want is the most simple and compact assembly, and you do not want to have to perform the multiplexing in software, then the MAX7219 is the clear winner (there are of course other chips that do the same job); even if you have a common anode display - no "other hardware support" required. (What on earth does that mean?)

Yes, you need to arrange your code accordingly but that is trivial; you do not have to do the multiplexing.

And you do not need SPI.

I read ALL the thread you linked, interesting.

Well I have to admit that I also have a common anode display :grin:
And I also was thinking about a 328 as a separate controller for the multiplexing, like PaulRB

I need to study how the MAX7219 works, than I will be able to tell if it worths to simply buy another display or change the code.

I was sure that someone would suggest some solution involving a RAM...

Thank you!

olimex:
I read ALL the thread you linked, interesting.

It was indeed, interesting.

olimex:
Well I have to admit that I also have a common anode display :grin:

As I explained, not a problem.

olimex:
And I also was thinking about a 328 as a separate controller for the multiplexing, like PaulRB

But the MAX7219 is cheaper, and with a 328 you still have to add all sorts of hardware to achieve anything like the display brightness that the MAX7219 does easily.

olimex:
I need to study how the MAX7219 works, than I will be able to tell if it worths to simply buy another display or change the code.

If by "change the code", you mean write code to suit, well, you have to do that whichever way you do it anyway.

The MAX7219 has a number of registers which you load serially in much the same fashion as using a 74HC595 - that is a subroutine which you can do using SPI, but is so trivial that it is not really worthwhile and since you are only doing this to update the display data, any speed advantage is meaningless. By "bit-banging" it, you have the freedom to allocate any pins for the purpose and share them with other functions.

There are eight registers into which you load the display patterns; if the display is common cathode, then each register corresponds to a digit, if it is common anode, then each register corresponds to one segment of all the digits, how you manage that I explained before. Perfectly easy.

AS1108 and friends (Common-Cathode though)


Rob

Are you saying that the 7219 will switch the segments instead of the digits?

MAX7219 will drive 8 anodes and 1 cathode.
Whether that cathode is associated with 1 digit, or 1 segment from 8 digits, is all that will be different.
If driving an 8x8 matrix, it's not really noticeable. The matrix is just turned 90 degrees, maybe flipped end to end or side to side.
If driving 7 segment displays, you have to think about your font definitions differently. 1 byte/digit is pretty straight forward. I haven't got my head around 1 byte representing 1 segment of 8 digits yet and how one would code that, despite the earlier example.

Hi to everyone!
Now that my project is completed and work fine, firstly I want to thank all of you for the help! XD

But let me clarify something: Yes, the MAX7219 can be used also with commond anode displays, BUT you will haveproblems with the working specs of the chip. The segments pins can manage much less current than the digits pins and this maybe isn't a problem if you are using very small displays, but with bigger displays you have to put some sort of driver, am I right?

olimex:
But let me clarify something: Yes, the MAX7219 can be used also with common anode displays, BUT you will have problems with the working specs of the chip. The segments pins can manage much less current than the digits pins and this maybe isn't a problem if you are using very small displays, but with bigger displays you have to put some sort of driver, am I right?

No, quite wrong. :smiley:

It makes no difference.

CrossRoads is confusing you in his earlier post with statements that are only relevant if you continue to think of it as needing to display (multiplex) digit by digit.

CrossRoads:
MAX7219 doesn't do common anode without other hardware support.

Not true.

CrossRoads:
It is designed for common cathode - drives up to 8 segment lines high, and one of 8 common cathode lines (digit select lines) low at a time.

His later post is more correct.

It is not an electrical problem, it is coding. If you use a common anode display, you just connect it up the same as a matrix, cathodes to cathode drivers, anodes to anode drivers. Same number of components.

What happens now is that you are multiplexing one segment of all the digits at once, then the next segment of all digits at once and so on, rather than all segments of one digit at once. But the chip performs the multiplexing for you. All you need to know is that it has eight registers into which you write this data. Normally (which is to say, with a common cathode display) each of those registers contains all the segment data for one digit and you could use the internal decoder to map four bits of that byte as a value to be converted by the chip to a 7-segment pattern but this completely restricts you to digits 0 to 9 (and "H", "E", "L", "P"!).

If using a common anode display, you probably also want one byte to correspond to one digit so you write those bytes into an 8-byte array. You then write the code (or if you are desperate, I will write it for you) to shift corresponding bits of each of those digits into the MAX7219, one bit from each array byte at a time (which is no trouble, as you have to load the MAX7219 with the bits serially in any case and you only have to do this each time you have to change the data displayed, not to multiplex it), then the next bit from each array byte and so on.

The only practical limitation as I believe I explained before (in that other thread), is that if you were using only four digits, then if you had a common cathode display you could restrict the chip to a 1 in 4 multiplex and have each digits powered for a full quarter of the time, whereas for a common anode display, you are constrained to a 1 in 7 multiplex and have each segment powered for one seventh of the time (or one eighth if you are using the decimals), so you cannot push the brightness up quite as much. If you are using eight digits, there is of course no difference and the MAX7219 in any case delivers much more current than the crude shift register solutions.

TPIC6B595 is great for driving common anode displays, especially those with lots of LEDs in series running from higher voltages (12V and up) and those having strings of LEDs in parallel needing 40, 60mA to light them all up.

This board I offer was designed control up to 12 digits made of LED strips.
http://www.crossroadsfencing.com/BobuinoRev17/

olimex:
Are you saying that the 7219 will switch the segments instead of the digits?

Yeah, you are right.
I needed to draw the circuit myself and think about at was happening. Sorry for the dumb question, and thank you for offering yourself to write the code, but now I understand the problem.

Thank you, and see you :smiley: