MAX7219 Common anode

Thread Starter

kgstewar

Joined Apr 5, 2012
152
I want to drive some large (2.3") 7 segment displays with a MAX7219. Voltages greater than 5V require some extra components and this circuit shows how to accomplish this for common cathode displays. I have some common anode displays and was wondering if there is a simple way to alter the linked circuit so that it could drive these displays. Would swapping the UDN2981 and the ULN2803 accomplish this?

Thanks!

Kevin
 

R!f@@

Joined Apr 2, 2009
9,918
You can but you need to invert the driver. Both the segment and digit drive.
Swapping one won't do. I think.
 

Thread Starter

kgstewar

Joined Apr 5, 2012
152
Many thanks for your response!

If the ULN2803 is now connected to the segment drivers from the MAX7219, that will sink the individual segments when the MAX7219 segment pins go high. If the UDN2981 is connected to the inverter, it will provide +V to the CA pin when the digit drivers on the MAX7219 go low. Am I correct?
 

Dodgydave

Joined Jun 22, 2012
11,285
I would remove the uln2803 (ic6) and connect the 74hc540 (ic5) direct, and connect the uln2803(ic6) to the uda2981a (ic4), this will invert the signals, to allow you to swap from common Cathode to Anode.
 

Thread Starter

kgstewar

Joined Apr 5, 2012
152
I would remove the uln2803 (ic6) and connect the 74hc540 (ic5) direct, and connect the uln2803(ic6) to the uda2981a (ic4), this will invert the signals, to allow you to swap from common Cathode to Anode.
Would that be pulling too much current through the inverter? The LED display I'm using needs about 12V (and I'm assuming 20-30 ma per segment).
 

elec_mech

Joined Nov 12, 2008
1,500
If the ULN2803 is now connected to the segment drivers from the MAX7219, that will sink the individual segments when the MAX7219 segment pins go high. If the UDN2981 is connected to the inverter, it will provide +V to the CA pin when the digit drivers on the MAX7219 go low. Am I correct?
Yes, just note you need to make sure pin 9 for each IC is connected correctly. Vcc for the UDN2981 and GND for the ULN2803. Also note the GND connection to pin 10 on the UDN2981.

Dodgydave's suggestion should work, but a quick glance at the datasheet shows a maximum open source current of 25mA. I assume a 2.3" digit will want ~20mA per segment if you're shooting for maximum brightness. 7 segments x 20mA = 140mA per common anode. This current will be higher, although for a short period of time, since the MAX7219 is multiplexing the segments. Hopefully someone will correct me if I'm wrong, but I don't think the 74HC540 can safely handle that alone.
 

John P

Joined Oct 14, 2008
2,025
The MAX7219 is an expensive component and if I had to drive LEDs with additional components, I would just use the other parts and forget the MAX7219. Sure, you'd have to do your own 7-segment encoding and the digit scanning, but neither of those is particularly difficult.
 

Thread Starter

kgstewar

Joined Apr 5, 2012
152
The MAX7219 is an expensive component and if I had to drive LEDs with additional components, I would just use the other parts and forget the MAX7219. Sure, you'd have to do your own 7-segment encoding and the digit scanning, but neither of those is particularly difficult.
Thanks John, I guess one advantage of the MAX7219 is that it requires just three uC pins to run 8 digits, but you are right about the cost. Do you have a link showing how to do this without the MAX7219? Thanks!
 

John P

Joined Oct 14, 2008
2,025
Not a link, but maybe I can describe it clearly enough: use 2 74HC595 serial to parallel converters, driving the inputs of the UDN2981 and ULN2803 that have already been mentioned. That should be all you need.
 

Thread Starter

kgstewar

Joined Apr 5, 2012
152
Quick follow up. The MAX7219 will indeed drive CA displays if you simply swap the UDN2981 and the ULN2803 shown in the circuit linked in my original post.

One issue that arose is that when some of the digits were supposed to be blank, a faint ghost image of whatever was showing on an adjacent display would appear. Adding a 10K pulldown resistor at each output pin of the UDN2981 eliminated some of the ghosting. The complete solution was to replace the UDN2981 with the pin-for-pin compatible TD62783. The TD62783 has a significantly faster switching time than the UDN2981 and this exchange combined with the pulldown resistors eliminated the ghosting.

For the heck of it, I also tried swapping the MAX7219 with the pin-for-pin compatible MAX7221. This created problems because I discovered that when the segment and digit drivers of the MAX7221 are turned off, they go to a high-impedance state, rather than to ground or Vcc like the MAX7219. This feature left the inputs of the transistor arrays floating, so to make the MAX7221 work, I had to add pullup and pulldown resistors. Too much trouble so I stuck with the MAX7219. I should mention that there is a pin-for-pin equivalent to the MAX7219 called the AS1106. It has the added benefits of being cheaper and it can be driven with 3.3V (as opposed to 5V for the MAX7219). I'm actually using this chip since my uC is an MSP430, which can't take 5V.

I can now drive eight different digits (and am using different sizes and colors) using a 16V source and only three pins on my uC. The MAX7219/AS1106 is a pretty slick little chip!
 
Last edited:
Top