Operation of 7 segment LED display with avr studio4 without using max7221 driver ic

Thread Starter

shom_show

Joined Sep 4, 2010
15
Myself Sumanta Kumar Show is trying to operate a 7 segment LED with avr

studio4 using Atmega32. What I have seen in internet that normally

MAX7221/7219 driver IC is required. I am trying to do that same thing without

using MAX7221. Can anyone please give me his suggestions or any sample

program if you have for operating the 7 segment LED with avr studio4 but

without using max7221 ic. Yours suggestions will be highly appreciated. If

possible please email me on the below Email IDs.

Thanks in advance.


Email Id - <SNIP>
 
Last edited by a moderator:

bretm

Joined Feb 6, 2012
152
Max7221 is generally used when you need to drive multiple seven-segment displays. Is that what you want to do? Are your displays common-cathode or common-anode? What's the rated forward voltage of the segments that you want to drive?

Edit for more questions: How many I/O pins do you have available on the Atmega to drive the displays? Are you trying to avoid all extra driver chips? Because the point of the Max7221 is to reduce the part count and simplify circuit design. Going without it will probably require even more parts, such as resistors and transistors.
 
Last edited:

Thread Starter

shom_show

Joined Sep 4, 2010
15
Yes I want to drive multiple seven segment displays. The LEDs I am using are COMMON

ANODE (LTS543). The rated voltage forward voltage which I am applying is 2.5 volts. I

have the 4 ports available (port A, port B, port C, port D) with total 32 output pins. Yes

its true that MAX7221 is reducing the part count and simplifying the circuit. But with all

these ports of ATMEGA32 is it not possible to display a particular digit without driver ic.

Please have your suggestions.


Sumanta
 

Papabravo

Joined Feb 24, 2006
21,158
The technique is a trivial application of the "one-hot-enable". A transistor switch supplies Vcc to one and only one 7-segment display. The common segment lines are turned on for a small time and then turned off. The transistor switch that was on is turned off, and the next one is turned on and the process repeats.

If you want to do "Charlieplexing" then you just have to stare at the picture until it comes to you, but the idea is essentially the same.
 

John P

Joined Oct 14, 2008
2,025
Are you maybe trying to avoid the high cost of the MAX7219? I think we all want to do that if we have to drive LED digits, or LEDs in general.

Trouble is, you pay for replacing the expensive chip by being forced to use a pile of hardware. You need a PNP/P channel transistor per digit, with a base resistor if it's bipolar. Then you need 7 NPN/N channel transistors and 7 resistors to limit current, and base resistors for each if they're bipolar. Or 8 of each if you want to use the decimal point. Total processor pins used, 1 for each digit and 1 for each segment, so 16 to drive 8 digits with 8 segments.

Then of course you have to program the thing. You might end up wishing you had given Maxim the money in the first place.
 

Papabravo

Joined Feb 24, 2006
21,158
@John P -- you are not wrong about the economics of LED control. Don't forget the cost of assembly and layout. One part on a pick and place machine verses several dozen discrete parts. The Maxim chip is a bargain no matter how you slice it. Maybe the OP is more interested in having a "positive learning experience". After all any damn fool can take and slap a chip upon a board.
 

MrChips

Joined Oct 2, 2009
30,706
How many digits do you wish to display?

You can interface the displays directly to the MCU plus current limiting resistors if you don't mind less than full brightness. All you would need are two 8-bit ports at the most.
 

John P

Joined Oct 14, 2008
2,025
OK, yes. But if you multiplex pins of the processor directly, you need to drive all the segments that are "on" in any given digit from a single port pin (or maybe you could control two or more pins in parallel?) And on the cathode side, you have to recognize that the segments must be driven with more than the normal current, because each digit is only on for a fraction of the time. So for 8 digits, you'd need 8 times the rated current, per segment, to get the same perceived brightness.

You would need to make a careful assessment of how much current you need from the processor pins; worst case would be if the display is showing all 8's and every segment is lit. Then compare that with the processor specs.
 

John P

Joined Oct 14, 2008
2,025
That processor has a limit of 25mA per pin, so your current per segment is a maximum of 25/7, or about 3.5mA (when it's lit, the anode for each digit has to be driven by a single processor pin, supplying current to all 7 segments). That's roughly equivalent to 1mA on a continuous basis, as each digit is only lit for 25% of the time. I'm sure the LEDs will be visible, but they'll be operating at a low brightness level.
 
The MAX7219/MAX7221 are compact, serial input/output common-cathode display drivers that interface microprocessors (µPs) to 7-segment numeric LED displays of up to 8 digits, bar-graph displays, or 64 individual LEDs. Included on-chip are a BCD code-B decoder, multiplex scan circuitry, segment and digit drivers, and an 8x8 static RAM that stores each digit. Only one external resistor is required to set the segment current for all LEDs. The MAX7221 is compatible with SPI™, QSPI™, and MICROWIRE™, and has slew-rate-limited segment drivers to reduce EMI.
 
Top