Peak Current from an IO pin?

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

Does anyone have an authoritative value for the max peak current drawn from an AVR IO pin? I'm driving a FET gate with it, and want to know what's the absolute minimum gate reisstance I can use without compromising reliability. The datasheet has an absolute max of 40mA per pin DC, but I can't find a peak max anywhere. Fets are a capacitive load, of course, so 95% of the time current flow is negligible, so the DC rating isn't relevant. Anyone have a peak load rating for me?

Thanks,
John

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

I can't speak for the non-Mega devices but, if you look in the datasheet for say, a Mega32, etc., it says that the maximum sink/source current capability for any given I?O pin is 100 miliamperes.

But, that doesn't mean that you can sink or source 100ma from all of the I/O pins similtainiously! You have to obey the maximum power disipation limitation of the microcontroller, as a whole.

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

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

Driving a capacitive load like a MOSFET isn't going to be dissipation limited. Your primary problem (if you have one) will be the momentary current into the capacitance, if it's enough, it may starve VCC momentarily.

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

Quote:
Does anyone have an authoritative value for the max peak current drawn from an AVR IO pin?

If you need an offical value the Datasheet is your only hope, and the only hope is the value given.

Otherwise just screw around a bit, and know you are outside of spec. It might be safer to just add a driver to handle the switching current though....

-Colin

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

An osciloscope should be able to give you an idea of the amount of current going from an I/O pin. Just watch the voltage drop. I'm kind of curious about the real answer to this question myself and will end up writing to Atmel to see if I can get a spice model for the I/O driver to get a better idea.

-Curiosity may have killed the cat
-But that's why they have nine lives

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

Spice isn't always available. Many vendors have decided that Spice models give away too much process information. The model you can usually get is the IBIS model. It looks a lot like a tabulated V/I curve.

You can get IBIS for 8515 and Meg8 (presumably fairly typical for their families). Google for Atmel AVR IBIS model.

https://www.avrfreaks.net/index.p...

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

None of the IBIS files in that archive will view correctly (many errors) on the two viewers that I've downloaded, can you point out a viewer that they will work on? They don't seem to be in the proper format. The first error that it comes up with is the capitolization of the basic information section in the .ibs file which is all caps (IBIS standard requires dos 8.3 file format which is all lower case) that makes me question the source that generated these files as Atmel wouldn't produce a file that had that glareing of an error inside the basic info section.
Also in the modules section here there is a link just bellow the above one to another file that has many IBIS models for AVR's which I can view with the browsers I've downloaded (Hyperlynx is the developer of one and Edality is the other) However these models are completly useless on the OP's load (virtual 0 ohms, just wire resistance) The model only had a 2k load for rise/fall. Can the V/I for smaller loads be calculated from this 2k load?

-Curiosity may have killed the cat
-But that's why they have nine lives

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

I can't point to any viewer that works with those files... it's not the first time I've encountered bad IBIS files (either bad format or dumb assumptions). Since I don't do that kind of modeling at home and we have specialists at work, I have no clue how you would proceed.

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

Hi John,

Since you are interested in absolute values, this is my little contribution.

During my last mega48 project, I needed to know the AVR output stages' ON resistance, something that is undocumented.

Testing any chip of the Mega family I have in hand of all their four generations(m8515, m8, m162, m48), I found out that their output stage is a real complimentary one, and R_ON = 24Ω ±10% at Vcc = 5.0V, for either the high-side output mosfet or the low-side one!

I am not sure how helpful this can be to you, but it worked fine for me.

I hope for nothing; I fear nothing; I am free. (Nikos Kazantzakis)

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

I looked at the ibis files of the newer post a little more closely and they appear to be corrupt. There are multiple lines that are repeated with garbage data and one line where the min/max/nominal values were swapped around so the file failed a check. I corrected the error so that I could at least view the curves and the output is pretty much garbage. I'm not even sure why it's posted. I'm leaving a message to a moderator to have it deleted.
On a good note the older file does appear to contain actual good IBIS data from Atmel so I can use that. There is a tool that's supposed to convert ibis files to spice compatible subcircuits, I'm going to try to compile the one for the 8515 and see what kind of output I get.

-Curiosity may have killed the cat
-But that's why they have nine lives

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

Giorgos,

Thanks, thats actually extremely helpful. I'm also using a mega48.

24 ohms? Good God, thats a lot. More than I was expecting, at any rate. Would explain why I'm not seeing any major difference between a 10 ohm gate resistor and a 24 ohm gate resistor.

So that would self-limit to 200 milliamps. That would also make the rated max power dissipation about 40 mW per pin.

I can work with that and get to the value I need.

Thanks much,
John

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

Hi all,

I looked into the M128 datasheet.

there is a chart named "I/O Pin Sink(Source) Current vs Output voltage"
I assume your FET´s gate threshold voltage to be about 2.0V.
The chart says a sink current of about 68mA typical at 5V-VCC and 25°C.
Extrapolated to 2.0V the source current is about 80mA.

Sink resistance: (2V) / 68mA = 29 Ohms
Source resistance: (5V-2V) / 80mA = 37 Ohms

I think all Megas are about the same. But check at your FET´s V(GS-th).

Klaus
********************************
Look at: www.megausb.de (German)
********************************

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

Hi John,

I am glad you found my AVR on-state output stage resistance information usefull.

BUT:
Those measurements I did were fully static ones, and took place at room temperature.
When a mosfet is in pulsed mode, its drain-source on-state resistance is usually much lower than what it is, when the same mosfet is in continous mode. In my opinion this applies to the AVR output stages, too.
Since the specific mosfet is an embedded and not a discrete one, the previously posted on-state resistance value is indicative, and includes the internal chip wafer and interconnection parasitic resistances.
That's why there in no such information at the AVR data sheets.

I am not sure how you can use my posted info, since you need the pulsed-mode drain-source on-resistance in order to specify your external fet driving model.

If you asked me what I would do to drive an external's fet -probably fat- gate, I would go with Colin's suggestion, above: I would add an extra driver to handle the gate drive, because violating the AVR max. current specs I might put the AVR itself, or its good operation at risk (stalling, browning-out, etc).

Regards,
George.

I hope for nothing; I fear nothing; I am free. (Nikos Kazantzakis)

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

Some IBIS informationfor you guys.

IBIS files for all newer AVR parts are available from www.atmel.com/AVR -> "Tools and Software" -> "AVR IBIS files". (http://www.atmel.com/dyn/resourc...)

To view the files you need a viewer like the Edality IBIS development Studio. They have a free evaluation version downloadable from : http://www.edality.com/ibisds/v1...

Please read the readme.txt-file in the zip-directory before you start. The naming of the files are a bit different from the usual part names and this is described in the readme file.

-Andreas

--
Follow me on the birdsite @AndreasMCUguy

I work at Atmel, but I try my best not to add marketing fluff in this forum.Hopefully I succeed. Views are my own and does not represent Atmel --

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

Giorgos_K wrote:
Hi John,

I am glad you found my AVR on-state output stage resistance information usefull.

Those measurements I did were fully static ones, and took place at room temperature.
When a mosfet is in pulsed mode, its drain-source on-state resistance is usually much lower than what it is, when the same mosfet is in continous mode. In my opinion this applies to the AVR output stages, too.

I am not sure how you can use my posted info, since you need the pulsed-mode drain-source on-resistance in order to specify your external fet driving model.

A given mosfet will only fail thermally, assuming the the current is anywhere within reason. With the DC allowable current (from the datasheet) and the static on resistance, I can get the static permissible power dissipation per pin. Then, knowing that, I'm not terribly concerned if the pulsed fet resistance is lower, because a lower resistance will mean less power dissipation, which moves me away from failure, not towards it. It would be a worry if I was using no gate reistor at all, but that isn't the case.

I'm not really concerned about browning out the AVR: My input decoupling capacitor is 1uf x5r, and we're only talking very short spikes to 80 - 100 milliamps, max. Switching time is well below a microsecond. My power rail looks clean with no noticable pulses even when using 10 ohm gate resistors. The AVR's power and ground rails are specced to 200 milliamps each continuous, so 80 milliamps in very short pulses won't endanger those.

The FET capacitance I'm driving is 1730 picofarads, for what that's worth.

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

Quote:
The FET capacitance I'm driving is 1730 picofarads, for what that's worth.

That´s only half of the truth: Mind the miller capacitance. Or is yours really the total?

Klaus
********************************
Look at: www.megausb.de (German)
********************************

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

Miller capacitance is 250pf. Input capacitance is 1460 pf. The same channel also drives a second mosfet with input capacitance of 20pf and miller capacitance of 5pf

/all datasheet values, but likely to be at least ballpark accurate

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

Actually I stopped using Edality and am now using HyperLynx 7.0 (It's free in it's view only mode and I hate 'nagware') I was fooled on Atmel's site by chosing some poor search terms. I only searched for IBIS which popped up some stuff about one of their eeprom chips and no other links (crappy search software) searching for IBIS and AVR in the same string brought up good results. Main problem is the rise and fall times are only available at a 2k output resistance, which is about useless for trying to figure out an I/O resistance of a few ohms.

-Curiosity may have killed the cat
-But that's why they have nine lives

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

Sceadwian wrote:
However these models are completly useless on the OP's load (virtual 0 ohms, just wire resistance) The model only had a 2k load for rise/fall. Can the V/I for smaller loads be calculated from this 2k load?

The latest IBIS files can now be downloaded from:
http://www.atmel.com/dyn/general...
http://www.atmel.com/dyn/general...

The first link covers Mega AVR's, the second is for Tiny's.

These models contain Rise/Fall curves for both 50 ohms and 2000 ohms load (previously only 2000 ohms). While the 50 ohm curves are indeed recommended by the IBIS standard (to be included if load >100 ohms) and give valuable information about output impedance, they will report errors at 2 volts and 50 ohms if run through a utility like IBISCHK. Note that this is not due to an error in the model, but operation outside the drive capability of the circuit.

I hope this helps.

Br
Andreas

--
Follow me on the birdsite @AndreasMCUguy

I work at Atmel, but I try my best not to add marketing fluff in this forum.Hopefully I succeed. Views are my own and does not represent Atmel --