ATMega 7 segment drive

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looking at building a 4 digit 7 segment LED multiplexed display. Some of the **examples of the hardware indicate segment control as being supplied by transistors for each of the 7 segments. I have common cathode available.
I am thinking that if I use resistors for each of the segments to supply 20mA or even a little less, then I don’t really need to drive the segments with a transistor for each segment. I think the Mega32 pins could handle this with no problem.
Of course, the common cathodes (digit select) will be transistors to sink the current to ground and enable a particular 7 segment display.

I don’t want to use one of the maxim chips as I have done that in the past. This is an effort to experiment using the timing required to multiplex and other task on the ATMega32. I am only looking for comments on the hardware setup in particular driving the individual segments from the AVR pins without using transistors with the exception of using transistors for digit select.

** various sites on the Internet

Thanks in advance

I'll believe corporations
are people when Texas executes one.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

you don't need transistors for every segment, as you say.

Leon

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Leon.

I'll believe corporations
are people when Texas executes one.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You should be able to drive the segments via the AVR, and the columns (digit select) by 4 transistors or buffer i.c. You would need very efficient or very dim display to drive the columns directly.

Multiplex at about 100-500Hz.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

On datasheet of ATMega32 says:

1] The sum of all IOH, for all ports, should not exceed 400 mA.
2] The sum of all IOH, for ports A0 - A7, should not exceed 100 mA.
3] The sum of all IOH, for ports B0 - B4, should not exceed 100 mA.
4] The sum of all IOH, for ports B3 - B7, XTAL2, D0 - D2, should not exceed 100 mA.
5] The sum of all IOH, for ports D3 - D7, should not exceed 100 mA.

If you have a decimal point (floating), I mean 8 segments to drive, I think 100mA per digit, on for 1/4 of time, is not enough.

Gelu.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
If you have a decimal point (floating), I mean 8 segments to drive, I think 100mA per digit, on for 1/4 of time, is not enough.

Are you saying that the 100mA/digit on for 25% time is not enough to display or, that the AVR drive is not enough?

I breadboarded a single digit set up using a UDN2983 high side driver and it seems that 20mA is not enough drive for acceptable brightness. I was using 5 VDC as the LED voltage and various current limiting resistors to observe the LED segment brightness.
The seven segment display (HP5082-7760)datasheet
seems to indicate that it can handle up to 60 mA/segment peak. (sorry, I was unable to paste the datasheet).
In my breadboard test, 20 mA did not have good brightness, but about 40 mA seemed good. I left the segment on at 40 mA for an extended time and observed no heat or change in the segment.
The ATMega32 can source the 20 mA per output pin, but
I see that perhaps the Mega32 can not handle all of the pins sourcing 20 mA each(?)
Thanks for the input/comments.

I'll believe corporations
are people when Texas executes one.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow--for the smaller 7-seg we use the high-efficiency red and budget right around 1mA per lit segment. No problems with common driving methods. Typically 3 to 6 are multiplexed, and I use around 100Hz refresh.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I did this a few days ago. If your gonna be displaying numbers, just get a sn7447a BCD to 7-seg decoder. and use that to drive the displays. Both types are accepted. then you don't have to worry about your AVR, only a 1$ chip. I did this. with 4.7k resistors on the segments and did 4 segments. My freq doesn't matter, because the duty cycle is still split up the same. It worked fine. The segments are dim, in light and good in the dark. It could definitely be brighter, but I can read it so I am happy.

If your doing to learn how to do it don't be concerned with brightness. If you are building it for a display, then you should be worried about brightness.

-John

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JohnGutmann:Yes, I am doing it to get a grasp on the multiplexing and also need a presentable display (brightness) when done. I can't use the 7447 device, but I want to be able to use segments individually to display other than BCD/HEX char's.

theusch: 1 mA per segment seems very small. That would allow using the Mega32 pins directly. I just tried another 7 segment display and it looks bright enough using 11.5 mA drive. I am wondering if the seven segment devices have more than one LED for each segment?

I have an old HeathKit H8 and the ROM monitor program used set memory locations for each of the individual digits and constantly updated the display(s) with what ever happened to be stored in those memory locations at the time. That seems like the best way to accomplish what will be displayed. That way the memory locations can be changed when new data is to be displayed.
Thanks to the helpful responses to this thread.

I'll believe corporations
are people when Texas executes one.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

here is an example using 3 7_seg display and an atmega 168.

The result is quite good with those parts value.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello there,

Sorry if this is a silly question, but I can´t undestand why you can´t just make the atmega directly select what display is turned on.

It is a matter of how much current is drain from the atmega port, right?

I believe I don't know how to calculate the ammound of current demanded when you use a transistor to select the display, and when you don´t..

Does it make any diference if you work with common cathode or common anode displays?

Please help me clarify this, thank you.

Regards,

Uderman

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have used multiplexing on good loads quite happily, so long as you have 1 pin per segment on the avr, you can drive 20mA no problem. For the common which will take 7 segments (140mA peaks) you will need something like 2n2222 or a darlington driver chip (common-ground/collectors) or else you will get dimming when driving/selecting more than 2 segments in your unit.

On your question, common cathode is simpler - however sometimes the cost difference is great enough to force you to swap, I can find no reason not to swap.

Also note that you are not going to cook your cpu too easily, it will get hot driving about 8 pins, but is actually incapable of more than 20ma per pin anyway. (atmega8 got warm at 16MHz with 8 high-brightness leds)

Conrad Braam - www.softcircuitry.blogspot.com - www.plcsimulator.org
Always start off poorly, that way when you finally figure it out, you can get a few surprise hits in.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

We use a p-ch fet to source the juice, pwm the gate for dimming, 3 n-ch fets on common anodes of 3 digits, output drive all segments and dps directly. (example at mcnallyelectronics.com)

Imagecraft compiler user