7-Segment x 5 digits @ 3.3v 10mA/seg, duty cycle?

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

See the attached schematic fragment.

This question is more of a programming question. I have this setup on a board running on a 7.3728MHz crystal that also has PWM audio, with a 4KHz cutoff filter, and audio sampling will be output by PWM at 14.4KHz. So to limit the switching noise coupling to the audio signal, I was thinking of scanning the display as 5 phases (20% duty cycle) on a timer running at 14.4KHz/28.8KHz. I realize this is unnecessary, and the display could be scanned at <1KHz, but I am worried the transistor switching will be clearly audible in the audio output.

I am also worried that at 3.3v 10mA 20% duty cycle the LEDs might be a bit dim. I have no previous experience with these displays, although I do understand how to light up a few LEDs obviously. They all seem to have similar specs, and I was wondering if anyone played with those before, and if you think the above scheme will be fine.

Attachment(s): 

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

To get the same brightness as, lets say, 10ma, but with a 20% duty cycle (1:5), you would need 50ma segment current. Average current will be the same as in the DC case but the peak current will be a lot higher. The whole display will take as much current as the sum of the average segment currents. Thus, with 5:1 multiplexing at 50ma per segment, the whole display will take the same current as if every segment had 10ma DC.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

I can sorta walk around the duty cycle by eliminating the 5th phase and driving the semicolon with other digits and/or pairing digits. I can also easily replace the resistors, but would an AVR port withstand sinking say 20mA x 7 segments @ 25%? The atmega165A in TQFP is rated for 5-10mA sink each pin, 100mA for the port. I imagine they can take a beating, but how much of a beating? I would very much like to avoid additional transistors to switch the cathodes.

I know that a continuous 5mA @ 3.3v is plenty to light up a regular red led.

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

I have just realized a stupid mistake and moved the resistors to the cathodes as well...

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

As you have to use transistors to drive the cathodes, you may as well allocate another 5 anode drivers and then common the cathode drivers and save three I/O's & three transistors.

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

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

Well I don't really need to use transistors to drive the cathodes, if the pin can withstand sinking 25mA 1/5th of the time...

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

the pins are made fro about 10mA. It probably can handle spikes of a higher current (absolute max spec???) but you risk that on the long term the chip will eventually fail. Also if your software crashes and stops at 1 line....... (smoke ?!?)

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

Well, considering the datasheet:

Quote:
Although each I/O port can sink more than the test conditions (20 mA at VCC
= 5V, 10 mA at VCC
= 3V for Port B and 10 mA
at VCC
= 5V, 5 mA at VCC
= 3V for all other ports) under steady state conditions (non-transient), the following must be
observed:
TQFP and QFN/MLF Package:
1] The sum of all IOL, for all ports, should not exceed 400 mA.
2] The sum of all IOL, for ports A0 - A7, C4 - C7, G2 should not exceed 100 mA.
3] The sum of all IOL, for ports B0 - B7, E0 - E7, G3 - G5 should not exceed 100 mA.
4] The sum of all IOL, for ports D0 - D7, C0 - C3, G0 - G1 should not exceed 100 mA.
5] The sum of all IOL, for ports F0 - F7, should not exceed 100 mA.
If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater
than the listed test condition.

I think I should be fine at 20mA/segment 25% duty cycle. Of course software crashing might be an issue, but I'll just have to make sure that doesn't happen. The AVR datasheet lists 40mA per pin as absolute maximum continuous current.

As a comparison, what is the highest DC current you folks have had an AVR pin in TQFP package source/sink without issues?

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

hugoboss wrote:
Well I don't really need to use transistors to drive the cathodes, if the pin can withstand sinking 25mA 1/5th of the time...

But the 1/5 duty cycle is referred to the display, not the AVR driving pin which could be 2/5, 3/5...

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

That is correct. Quite a mess to calculate properly. The other factor is the voltage drop across the LED. If the LED has a 2v forward voltage, this means that I am actually sinking 1.3v (assuming Van is 3.3v). Considering the fact the AVR pin is rated at 3.3v, the rated 5mA ends up as 16.5mW. Does that mean sinking ~12mA @ 1.3v (continuous) is actually within spec?

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

Quote:
this means that I am actually sinking 1.3v

It is not a good idea to use the term sinking (or sourcing) for Voltages, as it infers that Voltages flow.
The idea that Voltages flow is really bad, because they don't.
Those who think that voltages flow are cursed to struggle with understanding electronics.
I must admit that I don't really understand the OP's previous post, because my anal, state machine driven mind, just can't handle any hint of voltages flowing.
In his case I know how Shelton Cooper must feel sometimes! :lol:

Quote:
Quite a mess to calculate properly.

Disagree, can be predicted & calculated very accurately.

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

Last Edited: Sat. Jun 25, 2011 - 12:12 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A more expensive solution would be a high channel count LED controller with DC-to-DC buck voltage regulator for the LEDs.
One 32 channel/string example is LT3746 (SPI interface); others likely exist from Maxim and etc.
Would use some Mega pins to drive low frequency delimiter LEDs.
Probably most of the noise is from the buck converter (well above audio band);
would still have to deal with the 25Hz to 30Hz noise for display update.
One advantage is per LED adjustment of variation in LED intensity.

"Dare to be naïve." - Buckminster Fuller

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

I understand that a voltage is just a level, and that the current flows. My question refers to what is actually limiting the AVR pin ability to sink current. I am going on the assumption that it is thermal constraints on the internal components, in which case a lower voltage would mean more current could be sunk within the same thermal constraints.

I do not "struggle" as much with electronics as I do with people referring to me directly by the third person in a somewhat insulting way by the way. My first language is French, so sometimes my point fails to come across as intended, pardon me for that.

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

gchapman wrote:
A more expensive solution would be a high channel count LED controller with DC-to-DC buck voltage regulator for the LEDs.
One 32 channel/string example is LT3746 (SPI interface); others likely exist from Maxim and etc.
Would use some Mega pins to drive low frequency delimiter LEDs.
Probably most of the noise is from the buck converter (well above audio band);
would still have to deal with the 25Hz to 30Hz noise for display update.
One advantage is per LED adjustment of variation in LED intensity.

I am trying to avoid this completely. If it really is impossible to get reasonable brightness without external components, I will simply add in transistor arrays. I am already using a 1.5A simple switcher @ 200KHz, and the low frequency noise from the display switching is dealt with by updating the display at a higher frequency, well above the audio filter's cutoff frequency.

Last Edited: Sat. Jun 25, 2011 - 12:21 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The MCU will have source impedance and hence will dissipated power under both sinking & sourcing conditions. ATMEL has already done the calculations for you and has given you a maximum per pin current & a total maximum device current.

A 20 mA rated fuse will blow if it's rating is exceed whether it supplies current from a 3.3 Volt or 5 Volt power supply.

Quote:
I do not "struggle" as much with electronics as I do with people referring to me directly by the third person in a somewhat insulting way by the way.

Bon mot - I don't care what people call me as long as they don't call me late for dinner! I have not see any insults any where and if you see them, they were not intended.
J'ai toujours vu que pour réussir dans le monde, il fallait avoir l'air fou et être sage.

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

Last Edited: Sat. Jun 25, 2011 - 12:27 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do AVR pins have a fuse? The datasheet schematic of a general IO pin does not show any...

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

No they do not have a fuse , but they will fuse (as in melt).
I think we are loosing some meanings in translation here.

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

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

lol

Ok, so you are confirming what I was assuming. Components will melt inside at a point X above specification. And thermal specification depends on power dissipation yes? And since power is IV, then lower V allows for higher I within the same power spec?

That was the crux of the whole argument, if V at pin is lower, then "safe" I limit is higher.

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

Quote:
And since power is IV, then lower V allows for higher I within the same power spec?

No not necessarily!
The manufacturer has specified a maximum current, a designer must stay within that design parameter as the manufacturer may know things that the designer does not.
Once again, if you are talking about fuses for a power supplies
Quote:
A 20 mA rated fuse will blow if it's rating is exceed whether it supplies current from a 3.3 Volt or 5 Volt power supply.

Alternatively a LED will dissipate just as much power at a given current, whether it is supplied from a 3.3V system or a 5V system. The manufacturers for the LED specifies Ifmax not Pdmax.

Quote:
That was the crux of the whole argument, if V at pin is lower, then "safe" I limit is higher.

Wrong!

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

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

I think we are both wrong. Atmel has lied to us in the Electrical Characteristics charts... This is from the datasheet. It seems the pins are safe all the way up to 20mA+. I guess they just decided to lower the recommended ratings to simplify the additional restrictions:

Quote:
Although each I/O port can sink more than the test conditions (20 mA at VCC
= 5V, 10 mA at VCC
= 3V for Port B and 10 mA
at VCC
= 5V, 5 mA at VCC
= 3V for all other ports) under steady state conditions (non-transient), the following must be
observed:
TQFP and QFN/MLF Package:
1] The sum of all IOL, for all ports, should not exceed 400 mA.
2] The sum of all IOL, for ports A0 - A7, C4 - C7, G2 should not exceed 100 mA.
3] The sum of all IOL, for ports B0 - B7, E0 - E7, G3 - G5 should not exceed 100 mA.
4] The sum of all IOL, for ports D0 - D7, C0 - C3, G0 - G1 should not exceed 100 mA.
5] The sum of all IOL, for ports F0 - F7, should not exceed 100 mA.
If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater
than the listed test condition.

Attachment(s): 

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

Maybe some Atmel rep could clear this up?

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

For a short time there is not problem driving more current (e.g. 50 mA) from the IO Pins - so its no problem to measure the curves. In the long run there are 2 problems: parts oft the chip and the bond wire will get to hot and there may also be electro-migration.

The first thing would be to test how much current you really need. LEDs can be very different in efficiency - in extreme cases a high efficiency LED only needs 0,1% of the current a low cost LED needs to get the same intensity. The ambient light also makes a big difference. Chances are, you can drive the segments at about 10 mA each directly from the µC and use the original circuit (probably need smaller resistors).