Externally powering LEDs so Arduino doesn't fry

OK I will try one more time, but this is a triumph of hope over expectation because you have ignored facts in the past.

I used to do this for a living so I have been involved with this process professionally.

Look at how reliability of a circuit is measured, calculated, worked out. An link, this is one of the first I found:-
http://www.ece.cmu.edu/~koopman/des_s99/electronic_electrical/
Look at the bath tub curve. This shows that you can get a failure at any time but there is more chance of getting one early or late.

Read the bit about stressing components.

Now the more a thing is subjected to stress, the shorter is it's life, this applies for lots of things including electrical circuits.

There is not one point in a rating of a component where below is safe and above it instantly vaporises. Engineering is not that good. It is a continuum to more stress a component is placed under the shorter will be its life. So how much stress is safe?
To find out what you have to do is to test a lot of parts under conditions to accelerate any ageing. Most of us can't do that so it is lucky that the manufacturers do it for us. They work out what is a safe stress and publish it in the data sheet.
So if you step over that line then the component does not instantly die but it's life is shortened. The more the stress the shorter the life, too much and the life is very short indeed.

So when we make stuff into a system we need to go through all that with the complete system. You take a number of samples, the more samples the shorter time you get your answer. You also subject it to accelerating conditions like elevated temperature and humidity. You have to wait for two failures to get a 65% estimation of the life. You have to do this because one failure could just be a "random" failure from the bath tub curve. You then subtract the accelerating factors to give you the life time of the system. The longer the test and the more failures you get the higher degree of certainty is your life time estimate.

From that you can see that just testing one sample is not going to tell you anything. Just like the fatal dose of poisons is worked out by the concept of a half lethal dose. That is a dose that will kill half the people it is administered to. It will not kill half the people but you can not conclude from just giving it to one person that it is safe or not.

So the way systems are designed are that the stresses on components are less than that stated by the manufacturers. Normally these are reduced to the 80% level. Even then some parts of a system may fail before others and by testing you can hope to identify these parts and either replace them with higher ratings parts or try and reduce the stress on a part.

Now what you are doing is taking a design that exceeds the manufacturers ratings and coming to the conclusion that because it is still working, you say undiminished, then the design and practice of exceeding these limits is some how validated.

You have made no measurements of light output you have just looked at it over six months or so and say it is no difference. If you take an LED and put 20mA through it and then change the current so that 13mA goes through it you can tell it gets darker. However, if you show the LED with one current and then turn it off for 5 second or so. Then put up at random one of the two currents, then you are very hard put to say what current the LED is receiving. Now I know you are not going to believe this so I invite you to make your own game of guessing the brightness and see how close you can get reliably.

Now do you understand why one sample tells you nothing about the reliability of a system design?

You have started by claiming that I have ignored facts, that is not true. In some cases it was a simple oversight, other cases its unknown if there is any excessive damage going on, and dont have a scanning tunnelling microscope or decapping ability to measure stuff, It is entirely possible that there is no excessive damage going on, or that there is significant damage going on, but it may still take a very long time before any noticeable change occurs (dimming or complete failure).

I'm told that Im causing damage to LEDs and microcontroller, but I have no effective way to measure it, and since I can not measure it, you are assuming that I am doing damage. I may or may not be doing excessive damage, but LEDs will wear even when used within manufacturers specifications, exceeding those specifications will accelerate the damage, there is no question about that. This type of damage is like erosion, it may take a very long time to see any results of the damage. Im also being told that the level of damage is in excess of multiple times the rated value, You may expect to run a part over spec for a small amount of time, but not multiple times the spec, for extended periods of time, like I have been lead to believe. The fact that the parts have shown no signs of wear over extended periods of time suggest to me that the theory that I maybe running LEDs well in excess of 100mA (and the microcontroller many times that, since its running many LEDs at once) is inaccurate. It seems unlikely that the microcontroller or LEDs would sustain that level of overstress, and that is why I am sceptical about your assertions that Im am doing inordinate amounts of damage.

The cubes Im working on do not require high reliability, like they would if they were being used in aerospace, or medical type uses, nor are the in large production, or in any mission critical devices, they are toys and learning tools for hobbyists. If I were, then sample size would be important, and with the same parts I have repeated the results 3 times with the exact same results, however with enough different parts, i might start to see different results.

If the situation were running 400mA through a device rated at 200mA, then you likely expect a catastrophic failure in a short period of time. It would not be the slow erosion type of failure, it would likely be the type of failure where a part is not able to dissipate the heat fast enough, causing thermal overload and catastrophic failure.

Im still unclear on what the current spec really is. Is it 200mA, is it 300mA if you use the right ports, is it 400mA under some conditions? In the case of running 20 LEDs at 20mA, you would likely be using the arduinos ground, but the atmegas vcc, so the real bottleneck seems to be the VCC on the atmega chip. Even thought the voltage regulator wont have a problem delivering the 400mA, the CPU will probably have trouble dissipating the heat. At the very least, its right at the max specs, and the worst, its twice the load that the part is rated for.

In the case of the single color cube, where where it uses upto 320mA at a time, it may be that is just over the 300mA limit, and while it exceeds the limit, its not exceeding the limit by many times, and may just increase the likelyhood of failure. I do think that It has been sourcing (or trying to at least) upto 320mA on each of the 4 plane pins (this does make a lot of assumptions that are unverified though), and that seems way too high (almost 10 times the limit for a single i/o pin.) and I dont see how that could be happening without causing catastrophic failure in a very short period of time (like poof, instant burnout). In retrospect, I have no idea why this thing didnt just smoke, Im pretty sure i was sourcing way too much current on 4 pins. It has been down for a long time, I broke the usb connector on it, and its sort of half repaired. I plan on putting some transistors on the plane pins before I run it again.

In the case of the 64 RGB LED cube, where I am running 192 LEDs from a single microcontroller with and without resistors, Im told that im running the LEDs at 5v, and that is causing them to use a lot more than the expected 20mA. The issue with the LEDs is a non-linear current issue, where a tiny amount of voltage, can make a huge current difference, and one or two volt may increase the current as much 10 times (like 200mA), but only for a fraction of a second. If several LEDs are using hundreds of mA, then the microcontroller (in this case it is using i/o ports for both sinking and sourcing) is also taking many hundreds of mA, well exceeding the 200/300/400 specification. The theory you present is that it is definitely causing damage, but it may not the typical thermal overload type situation, rather a slow erosion type situation due to short duration time.

I have a digital volt meter, and it can measure current, but it cant measure it as fast as the microcontoller and change it (and reverse polarity), so its not very effective for measuring peak current, it just displays a sort of average, or truncated current measurement.

Yesterday, i did measure the current through the cube via 6v battery (4AA), and through a 5v(5.25 technically) power supply. They both used about the same amount of current.

I actually have complete 64 RGB LED setups, 2 are in cube form, one in hat form, all use the same parts, but the interconnections are slightly different. The 2 cubes have been running for over 2 months each, and one of them has never had any resistors, but the other one has been modified a couple times using resistors. I measured the current through the hat setup, it has no resistors, and it measures just over 40mA at startup, then fluxuates between 30 and 40mA.
The cube with resistors has had 2 sized resistors, I started with 100 ohm resistors, but have replaced them with 50 ohm resistors. With the 50 ohm resistors seem to run the cube between 25-30mA. Using 2 100 ohm resistors the cube uses between 30 and 35mA. The resistors make a very noticeable difference in brightness.

These measurements are with a very slow device (relatively speaking), so it is unlikely to show very high readings that are a very short duration (like a couple milliseconds), and we cant trust that these measurements are accurate for such small durations, but can give you a good idea of the overall consumption. You can see that the overall consumption between uncontrolled (no resistors), and overcontrolled (200 ohms) is not more than 50% difference, which means that unresistored is likely well under 200% of the specification, since 200 ohms keeps both the LEDs and the microcontroller well under spec. My guess is using no resistors is not too far over spec, and may not even be over spec.

Because the LEDs are charlieplexed, it means that 2 resistors are always being used when lighting a single LED, and it means I have to use one size resistor for 3 different LEDs and as such, I can not light each LED with the same amount of current.
with 100 ohm resistors, the blue and green and red should be well under 20mA, assuming they are getting 5v. With 5v, the red should need 150 ohms and the blue and green need 100 ohm. When using the 100 ohm resistors, no LED should be getting anywhere near the 20mA current limit. Changing to 2 50 ohm resistors should put the blue and green at their limit, but put the red over its limit.
I've measured the voltage at the Vin, and the 5v on the cubes, and they are way below 5v, in some cases, as low as barely over 4volts. If I assume the LEDs are actually getting 4.5v, then 2 50 ohm resistors puts the red at about 25ma, while the blue and green are under 20mA. That isnt very excessive, but it is just over the assumed specification.

In the case of charlieplexing, you always have 2 diodes in circuit, which means that other diode may be having some effect on the circuit, it maybe that is helping prevent overcurrent.

The other thing that the charlieplexed cube has going for it is the lack of parts, its literally, microcontroller, LED, and wire. Here is a quote from the document that linked:

"Reliable circuit design. As a general rule, simpler designs will be more reliable. Thus there should be a push for simplicity throughout all phases of the design process. The necessity of all parts should be questioned and design simplifications should be employed where available. This can be through circuit design simplifications or by simply using fewer parts. Also, the use of standard components and circuits is always recommended (where a component could be as complex as a microprocessor)."

When I say, I havnt ignored you, I really mean that I havnt ignored you, I have said that I am sceptical, and I have good reason to sceptical.

Since you want to bring up hope over expectation, lets examine the difference between resorting to name calling, and calling someone ignorant, I would say that is measurable improvement, so keep up the good work, maybe one day we can have conversation where I dont have to tolerate such nonsense.

It looks like you put a lot of thought, and effort into your post, and with one tiny exception, you kept to the facts. I expect that was difficult, so I am compelled to thank you for your effort and consideration.

retrolefty:

Im still unclear on what the current spec really is. Is it 200mA, is it 300mA if you use the right ports, is it 400mA under some conditions? In the case of running 20 LEDs at 20mA, you would likely be using the arduinos ground, but the atmegas vcc, so the real bottleneck seems to be the VCC on the atmega chip. Even thought the voltage regulator wont have a problem delivering the 400mA, the CPU will probably have trouble dissipating the heat. At the very least, its right at the max specs, and the worst, its twice the load that the part is rated for.

Well there is some disagreement among some of us members (me and CrossRoads for sure) on what the maximum safe total current consumption for a avr chip is. Others have not really issued an opinion on the matter one way or another, at least where I can find. The datasheet is not all the clear on the following question, at least for two of us members.

So can a AVR mega1280 chip actually have 800 ma flowing through it if loads are carefully balanced between the port/pins or is there a absolute maximum 200 ma chip total current limit?

Lefty

Ok I give up.
You are a lost case.
You obviously know more about reliability of design than I do. I have only made products that they have manufactured half a million of and had the lowest return rate of any product they ever made so what do I know about reliability? You obviously know a lot more. You also know a lot more about the components than the component manufacturer, why not offer them advice?

Hippynerd:
Im still unclear on what the current spec really is. Is it 200mA

You may not be clear, but the datasheet is:

DC Current per I/O Pin ........................................ 40.0 mA

DC Current VCC and GND Pins................................ 200.0 mA

It also says:

*NOTICE: Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to the device.

Not much wiggle room there.

This is a stress rating only and functional operation of the device at these or other conditions beyond those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability.

ie. The part is under stress at 200mA, you should design for less than that if reliability is important to you.

Hippynerd:
is it 300mA if you use the right ports

No.

Hippynerd:
is it 400mA under some conditions?

No.

Hippynerd:
I am sceptical, and I have good reason to sceptical.

I saw this the other day: http://www.instructables.com/id/IR-Remote-Controlled-Color-Changing-Cloud-Arduino/

What do you think of his circuit design (see below) and the fact that he puts multiple LEDs on single Arduino pins "so that the light would be dimmer from each individual one and be more defused"? Is is OK to do that? His cloud seems to be working, right?

I'm interested to know if you'd ever draw a line between OK/not OK.

If you admit such a line exists, why would you place it somewhere random and not exactly where the datasheet says it should go? The datasheet was written by the people who know more about the chip than anybody else in the world yet you claim to have "good reasons" for ignoring it. What are those reasons?

retrolefty:
Well there is some disagreement among some of us members (me and CrossRoads for sure) on what the maximum safe total current consumption for a avr chip is. Others have not really issued an opinion on the matter one way or another, at least where I can find. The datasheet is not all the clear on the following question, at least for two of us members.

So can a AVR mega1280 chip actually have 800 ma flowing through it if loads are carefully balanced between the port/pins or is there a absolute maximum 200 ma chip total current limit?

The datasheet lists power ratings in groups:
ATmega640/1280/2560:
1)The sum of all IOH, for ports J0-J7, G2, A0-A7 should not exceed 200mA.
2)The sum of all IOH, for ports C0-C7, G0-G1, D0-D7, L0-L7 should not exceed 200mA.
3)The sum of all IOH, for ports G3-G4, B0-B7, H0-H7 should not exceed 200mA.
4)The sum of all IOH, for ports E0-E7, G5 should not exceed 100mA.
5)The sum of all IOH, for ports F0-F7, K0-K7 should not exceed 100mA.

There's also four sets of VCC/GND pins on the chip, each with a 200mA rating.

To me that adds up to 800mA (ie. four groups of 200mA).

Grumpy_Mike:
Ok I give up.
You are a lost case.
You obviously know more about reliability of design than I do. I have only made products that they have manufactured half a million of and had the lowest return rate of any product they ever made so what do I know about reliability? You obviously know a lot more. You also know a lot more about the components than the component manufacturer, why not offer them advice?

Mike, there you go, trying to take back my hope. :frowning:

I had no idea that was a feature of the mega. I knew it had more ports and memory, but hadnt considered that it may also have higher current limits.

Fungus, it sounds like you are saying that the mega has 4 200ma (well, one of the 4 is split into 2 100ma), ports, but the current limit on the regular 328 based chips is 200ma for all ports combined. I think I've read that there are 4 ports on the 328 chips. Is it possible that going over 100ma on any one port might be damaging?

What is ok or not ok, is up to each individual to decide, and they need to decide for each circumstance. The circumstances can play into the situation to make one way or another seem like the best option. In the case of wearable LEDs, number of parts, and complexity are a big factor. Power consumption is another big factor (typically running from batteries), but longevity may not be a big factor, since they are often only used for not more than a couple hours at a time, and may go days without any use.
If these LEDs run for weeks on end without failure, then only running them for a few hours a week should make the last a very long time.

I am sceptical about claims that current levels are as high as you say they are, not about what datasheets say.

I would say that running 4 LEDs in series is a better way to limit brightness of the LED, I dont know how that worked out, my guess is it didnt really work how he had expected.

There still seems to be a lot of diversity in the responses that im seeing on this page of this thread alone.

The only thing i can conclude is that things are not very clear.

retrolefty:

fungus:

retrolefty:
Well there is some disagreement among some of us members (me and CrossRoads for sure) on what the maximum safe total current consumption for a avr chip is. Others have not really issued an opinion on the matter one way or another, at least where I can find. The datasheet is not all the clear on the following question, at least for two of us members.

So can a AVR mega1280 chip actually have 800 ma flowing through it if loads are carefully balanced between the port/pins or is there a absolute maximum 200 ma chip total current limit?

The datasheet lists power ratings in groups:
ATmega640/1280/2560:
1)The sum of all IOH, for ports J0-J7, G2, A0-A7 should not exceed 200mA.
2)The sum of all IOH, for ports C0-C7, G0-G1, D0-D7, L0-L7 should not exceed 200mA.
3)The sum of all IOH, for ports G3-G4, B0-B7, H0-H7 should not exceed 200mA.
4)The sum of all IOH, for ports E0-E7, G5 should not exceed 100mA.
5)The sum of all IOH, for ports F0-F7, K0-K7 should not exceed 100mA.

There's also four sets of VCC/GND pins on the chip, each with a 200mA rating.

To me that adds up to 800mA (ie. four groups of 200mA).

That is CrossRoads take on the matter, that one can take the sum of all the port maximum values to reach a package total allowed. I'm still not convinced that is the case. Why would they not use the 800ma number in the absolute maximum current rating if that was the case. They do state Vcc and ground pins not pin. But again as I said the datasheet is not 100% clear in this matter, at least not to my satisfaction.
800ma is a lot of current.

Lefty

@fungus,
Yes! That's what I have been saying all along for the '2560 (and '1280, same die, less memory)): 4 Vcc pins + Avcc on a Mega, 800mA allowed when spread across the ports.

'328P would be similar Vcc & Avcc @ 200mA each, 300mA allowed across the ports.
TQFP has Vcc x 2 + Avcc as well.

retrolefty:
That is CrossRoads take on the matter, that one can take the sum of all the port maximum values to reach a package total allowed. I'm still not convinced that is the case. Why would they not use the 800ma number in the absolute maximum current rating if that was the case.

Because no single part of the chip can take 800mA...?

retrolefty:
But again as I said the datasheet is not 100% clear in this matter, at least not to my satisfaction.

if the total chip limit was 200mA, why would they bother separating the current consumption of the I/O ports into 200mA groups? It would just say "200mA"...

Hippynerd:
Fungus, it sounds like you are saying that the mega has 4 200ma (well, one of the 4 is split into 2 100ma), ports, but the current limit on the regular 328 based chips is 200ma for all ports combined. I think I've read that there are 4 ports on the 328 chips. Is it possible that going over 100ma on any one port might be damaging?

If only the datasheets would tell us stuff like that...

Oh, wait, they do!!

Seriously, how many times must you be told to read them?

Hippynerd:
What is ok or not ok, is up to each individual to decide

The laws of physics disagree.

Hippynerd:
they need to decide for each circumstance. The circumstances can play into the situation to make one way or another seem like the best option. In the case of wearable LEDs, number of parts, and complexity are a big factor. Power consumption is another big factor (typically running from batteries), but longevity may not be a big factor, since they are often only used for not more than a couple hours at a time, and may go days without any use.
If these LEDs run for weeks on end without failure, then only running them for a few hours a week should make the last a very long time.

If I'm a dancer (or whatever) wearing LEDs, I don't want them to die in the middle of an act because somebody thought "They'll be OK because they're only used a couple of hours a week!!"

My question still stands: Do you think there's a line somewhere, or is any amount of abuse OK? If there is a line, why not draw it where the datasheet says instead of at some random place?

if the total chip limit was 200mA, why would they bother separating the current consumption of the I/O ports into 200mA groups? It would just say "200mA"...

Because there are several ways to reach the 200ma limit, one port at max, several ports at each less then port max?

The datasheet which should be the final source of judgement, is frustratingly vague (if not misleading) on this issue of total safe chip maximum current consumption. No matter what side one is on is issue, there has to be some questionable interpretation done to arrive at one's opinion. Absolute max rating section reference to maximum current rating of Vcc & gnd pins (all together or X4 is the key question) of 200 ma can't just be ignored as a simply requiring an X4 being required to come up with a 800 ma total. Many IC devices include a total maximum device power dissipation in wattage, which would have been helpful in this mega1280/2560 debate, but I haven't seen such a specification?

I guess a real world test would be simple enough, just put load resistors on every pin such that no single pin limit or port limit is violated and then measure total device current consumption and see how long the chip lives? I'm just not prepared to volunteer either of my two mega1280 boards as guinea pigs to the cause, as I don't believe it would be a non-destructive test. :wink:

I'm perfectly capable of being wrong in my opinion, I have no emotional attachment to this opinion, or being wrong. I just have not seen a clear unambiguous argument made yet. The datasheet just lacks clarity in this issue.

Lefty

fungus:

Hippynerd:
Fungus, it sounds like you are saying that the mega has 4 200ma (well, one of the 4 is split into 2 100ma), ports, but the current limit on the regular 328 based chips is 200ma for all ports combined. I think I've read that there are 4 ports on the 328 chips. Is it possible that going over 100ma on any one port might be damaging?

If only the datasheets would tell us stuff like that...

Oh, wait, they do!!

Seriously, how many times must you be told to read them?

Hippynerd:
What is ok or not ok, is up to each individual to decide

The laws of physics disagree.

Hippynerd:
they need to decide for each circumstance. The circumstances can play into the situation to make one way or another seem like the best option. In the case of wearable LEDs, number of parts, and complexity are a big factor. Power consumption is another big factor (typically running from batteries), but longevity may not be a big factor, since they are often only used for not more than a couple hours at a time, and may go days without any use.
If these LEDs run for weeks on end without failure, then only running them for a few hours a week should make the last a very long time.

If I'm a dancer (or whatever) wearing LEDs, I don't want them to die in the middle of an act because somebody thought "They'll be OK because they're only used a couple of hours a week!!"

My question still stands: Do you think there's a line somewhere, or is any amount of abuse OK? If there is a line, why not draw it where the datasheet says instead of at some random place?

Oh wait, they datasheets arent always as clear as you say, thats why half of the post in this thread exist. Did the datasheets mention that the quad fine pitch package has 2VCCs and an AVCC all rated at 200ma? How about what crossroads says? There clearly is good question here, so your comment about oh wait... is just trying to be an ass to me, why would you feel that is acceptable?

It seems to me that If you are careful, maybe you can use 200ma on 2 ports, and another 200ma on the other ports, but maybe that didnt make it to the datasheet, or maybe they thought it was obvious that they meant on 200ma for any vcc pin, and they just happen to have more than one. It seems to me, that people trying to sell a product usually advertise every feature on their product. Or it maybe they didnt include all the VCC info so that folks would be less likely to exceed specification? I dont know, and its all to unclear.

Fungus, you seem to want to harp on about how I want to ignore datasheets, thats not the case, thats just you trying to paint me as a bad person. If I didnt read datasheets, how did I find the 200mA spec that you brought up, that started this whole mess going. Thats right, i found it in the datasheet, on page 313, remember, you didnt bother quoting your source, so I did it for you.

If you are a dancer, and you come to me and say that you want to light up 64 RGB LEDs for a 1 hour performance next tuesday, and probably wont use it again. Would you spend 3 months engineering the circuitry? I spent over a week reading about stuff to figure out how to calculate a good mosfet for just for one cube. There are many many ways to solve the same problem, and you could spend a week just figuring out all the various way, or you could charlieplex them all, you can resistor them if you want, or not, because they will almost certainly last more than an hour. Mine have been running for over 1000 hours, with no sign of slowing down. If you dont mind them being dimmer, you can add 16 resistors to the circuit too, i've also done that.

I have 4 cube designs going, and the 2 simple ones are looking the best, the more complex ones that use shift registers, or constant current drivers may turn out to be better, but they have taken months to get running, and the charliecube only took about a week.

There is a fine line between use and abuse, and if the choice is between project failure from not getting completed in time, or a little excessive wear on some parts, I'll wont be choosing failure.

How are you going to explain to your dancer that the LED out fit will be ready the week after they dont need it anymore?

It turns out that I may have access to a scanning tunnelling microscope, but I dont think I will have access to any decapping type machines. I've found that LED bodies are hard and chemical resistant, how should I prep an LED for scanning tunnelling microscope.

The total current capacity for a chip is all a bit academic because Hippynerd does not believe in using series resistors with LEDs when multiplexing because he dose not appreciate the difference between peak current and average current. So even if he is prepared to pay attention to one small part of a manufacturers data sheet he totally ignores another.
The only current he is measuring is average current, which is the wrong sort of measurement to make. But as you have seen there is no telling him anything. Just as dhenry departs then we have a step in replacement giving advice that contradicts the data sheet, so he needs careful monitoring to minimise the damage he will do. The first step of actually trying to educate him has failed.

I'm just not prepared to volunteer either of my two mega1280 boards as guinea pigs to the cause,

No need because two samples is no where near enough to tell you anything about stress ratings especially if your only criteria is total loss of function.

Grumpy_Mike:
The total current capacity for a chip is all a bit academic because Hippynerd does not believe in using series resistors with LEDs when multiplexing because he dose not appreciate the difference between peak current and average current. So even if he is prepared to pay attention to one small part of a manufacturers data sheet he totally ignores another.
The only current he is measuring is average current, which is the wrong sort of measurement to make. But as you have seen there is no telling him anything. Just as dhenry departs then we have a step in replacement giving advice that contradicts the data sheet, so he needs careful monitoring to minimise the damage he will do. The first step of actually trying to educate him has failed.

I'm just not prepared to volunteer either of my two mega1280 boards as guinea pigs to the cause,

No need because two samples is no where near enough to tell you anything about stress ratings especially if your only criteria is total loss of function.

Well if both my mega1280 boards were to go up in smoke in short order trying to sink or source 800 ma of steady state current, that would be pretty conclusive to me, but alas I've no guts so no glory will fall upon me.

So GM what is your take on what the absolute maximum current consumption is for a mega1280/2560 chip assuming no pin or port limit is reached?

Lefty

what is your take on what the absolute maximum current consumption is for a mega1280/2560 chip assuming no pin or port limit is reached?

Well at one stage member mem was in contact with an Atmel field engineer and at my prompting he was going to ask that very question.

My take is that a normal DIL 328 chip can take 200mA sourcing and 200mA sinking so I would set the design limit to 150mA each. I would not consider the analogue voltage pin to be part of the equation.

However, on the quad flat pack packages of the 1280/2560 chips then on the pure current considerations I would say 4 X 150mA total source and the same for sink, as well. However, in practice you will have to watch the thermal performance of the chip as well. This would probably mean that you would derate the current capability with temperature.

I have a query in with Atmel, lets see what they say:

Hello,
Please forward this to the 8-bit AVR tech folks, my browser won't let me open that page.

The ATmega328P, ATmega1284P, ATmega2560 data sheets all show
DC current VCC and GND pins .................................. 200.0mA.

The Electrical characteristics all show greater then 200mA total being supported by the ports with various current limits per port:

Notes on allowed currents:

ATmega48A/PA/88A/PA/168A/PA/328/P:
3. Although each I/O port can source more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state conditions (non-transient), the following must be observed:
1] The sum of all IOH, for ports C0 - C5, D0- D4, ADC7, RESET should not exceed 150mA.
2] The sum of all IOH, for ports B0 - B5, D5 - D7, ADC6, XTAL1, XTAL2 should not exceed 150mA.
If IIOH exceeds the test condition, VOH may exceed the related specification. Pins are not guaranteed to source current greater than the listed test condition.
4. Although each I/O port can sink more than the test conditions (20 mA at VCC = 5V, 10 mA at VCC = 3V) under steady state conditions (non-transient), the following must be observed:
1] The sum of all IOL, for ports C0 - C5, ADC7, ADC6 should not exceed 100 mA.
2] The sum of all IOL, for ports B0 - B5, D5 - D7, XTAL1, XTAL2 should not exceed 100 mA.
3] The sum of all IOL, for ports D0 - D4, RESET 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.

ATmega164A/PA/324A/PA/644A/PA/1284/P:
3. Although each I/O port can sink more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state conditions (non-transient), the following must be observed:
1.)The sum of all IOL, for ports PB0-PB7, XTAL2, PD0-PD7 should not exceed 100mA.
2.)The sum of all IOL, for ports PA0-PA3, PC0-PC7 should not exceed 100mA.
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.
4. Although each I/O port can source more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state conditions (non-transient), the following must be observed:
1.)The sum of all IOH, for ports PB0-PB7, XTAL2, PD0-PD7 should not exceed 100mA.
2.)The sum of all IOH, for ports PA0-PA3, PC0-PC7 should not exceed 100mA.
If IOH exceeds the test condition, VOH may exceed the related specification. Pins are not guaranteed to source current greater than the listed test condition.

ATmega640/1280/2560:
3. Although each I/O port can sink more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state conditions (non-transient), the following must be observed:
1.)The sum of all IOL, for ports J0-J7, A0-A7, G2 should not exceed 200mA.
2.)The sum of all IOL, for ports C0-C7, G0-G1, D0-D7, L0-L7 should not exceed 200mA.
3.)The sum of all IOL, for ports G3-G4, B0-B7, H0-B7 should not exceed 200mA.
4.)The sum of all IOL, for ports E0-E7, G5 should not exceed 100mA.
5.)The sum of all IOL, for ports F0-F7, K0-K7 should not exceed 100mA.
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.
4. Although each I/O port can source more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state conditions (non-transient), the following must be observed:
1)The sum of all IOH, for ports J0-J7, G2, A0-A7 should not exceed 200mA.
2)The sum of all IOH, for ports C0-C7, G0-G1, D0-D7, L0-L7 should not exceed 200mA.
3)The sum of all IOH, for ports G3-G4, B0-B7, H0-H7 should not exceed 200mA.
4)The sum of all IOH, for ports E0-E7, G5 should not exceed 100mA.
5)The sum of all IOH, for ports F0-F7, K0-K7 should not exceed 100mA.
If IOH exceeds the test condition, VOH may exceed the related specification. Pins are not guaranteed to source current greater than the listed test condition.

My interpretation of these notes is that:

for the '328P the sum of current across the VCC/AVCC pins can support the current thru the ports, with 400mA max thru the VCC/AVCC & Gnd pins and 300mA thru the ports, (altho SMD parts have an extra VCC& Gnd pin, so 600mA could be taken in)

for the '2560 the sum of current across the VCC/AVCC pins can support the current thru the ports, with 1000mA max thru the VCC/AVCC & Gnd pins and 800mA thru the ports,

and for the '1284P the sum of current across the VCC/AVCC pins can support the current thru the ports, with 400mA max thru the VCC/AVCC & Gnd pins and 200mA thru the ports (altho SMD parts have 4 each VCC/AVCC & Gnd pins, so 800mA could be taken in) So the '1284 seems to be under supported for IO current. But a nice chip none the less that I will continue to use.

Can you confirm that for 328s & 2560s that the higher currents in the notes are supported and the 200mA Absolute Max is for each individual VCC/Gnd pin and Not for the entire device?

Thank you.

Grumpy_Mike:
The total current capacity for a chip is all a bit academic because Hippynerd does not believe in using series resistors with LEDs when multiplexing because he dose not appreciate the difference between peak current and average current. So even if he is prepared to pay attention to one small part of a manufacturers data sheet he totally ignores another.
The only current he is measuring is average current, which is the wrong sort of measurement to make. But as you have seen there is no telling him anything. Just as dhenry departs then we have a step in replacement giving advice that contradicts the data sheet, so he needs careful monitoring to minimise the damage he will do. The first step of actually trying to educate him has failed.

I'm just not prepared to volunteer either of my two mega1280 boards as guinea pigs to the cause,

No need because two samples is no where near enough to tell you anything about stress ratings especially if your only criteria is total loss of function.

Did you just completely not read anything i wrote, or did you just chose to ignore it?

Since you brought up the peak current issue, what is the constant current value, and what is the peak current value for the 328?

Someone said that their LEDs had a constant forward current of 20ma, but a peak of 200mA if pulsed. If the spec on the datasheet is for constant current, then what is the pulsed current spec?

Grumpy mike just doesnt like it when people dont do what he says, and if you dont do what he says, he is has to defend himself by outing you as some kind of reckless fool that doesnt know what they are doing. Its pathetic, but whatever, everyone needs a hobby. He feels its ok to be abusive to people when they dont agree with them.

I have done the best to measure what I can, with what I have, and mostly its just because mike and fungus want to tell me the Im doing OMG huge amounts of damage, but yet they just keep working. What is more likely, that my personal arduinos and LEDs are super sturdy, or their claims are greatly exaggerated? If you were paying attention, you would know that the datasheets for LEDs that I have are very limited, and dont include pulsed current data. You would also know that I have current limiting resistors on the a cube, and i've tried a few different values, and measured the current load for each, and that I even stated that my meter probably wont show peak current.

Mike, I actually may be able to get some scanning tunnelling time, I dont need to prove anything to myself, but you cant stop harping about how the only way i can tell if im damaging something is by using a scanning tunnelling microscope. So... why do you just outline the procedure that you will find acceptable, since its really only to satisfy you.

Mike, you and fungus just wanna hate on people that dont follow your personal criteria. If they dont do what you say, you call them names, you've done it to me, and you've done it to dhenry a lot, to the point where he wont even bother responding. You dont seem to understand that your behavour is abusive, even though I have mentioned it in the past, and you have made progress, so there is hope, but sadly, you take that back every chance you get.

If I want to abuse my LEDs, and show others that they can abuse their LEDs, thats fine, but being abusive to people isnt fine.

P.S. Reliability isnt the only thing that is important to everyone. Sometimes its ok to reduce reliability to increase usability.

Hippynerd:
Someone said that their LEDs had a constant forward current of 20ma, but a peak of 200mA if pulsed. If the spec on the datasheet is for constant current, then what is the pulsed current spec?

The datasheets normally list pulse width (eg. 10%) and frequency (eg. 1us).

I've got LEDs that can take 200mA pulsed and LEDs that can only take 30mA.

Again, the datasheet says:

DC Current per I/O Pin ........................................ 40.0 mA
DC Current VCCand GND Pins ................................ 200.0 mA

This is a stress rating only and functional operation of the device at these or other conditions beyond those indicated in the operational sections of this specification is not implied.

Exposure to absolute maximum rating conditions for extended periods may affect device reliability.

Those words were written by the people who know more about the AVR chips than anybody else in the world. Only a bad engineer would knowingly ignore them. Only a terrible engineer would argue endlessly to justify doing so.

PS: I don't see how following the datasheet means it takes longer to build a circuit. That's a strawman.