Max load

I know I read this someplace, but now I can't find it.

What is the max output current for a ATMega168?

i.e, each pin can source 40 ma, but what is the total over all, can I draw 20ma from 15 pin at the same time?

I'm sure I read someplace that there is a max.

Thanks

Maximum is 200mA combination of all pins sourcing and another 200mA from all pins sinking.

There are limits also for some combinations of pins in the data sheet:-

  1. 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:
    ATmega48/88/168:
    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.
  2. Although each I/O port can source 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:
    ATmega48/88/168:
    1] The sum of all IOH, for ports C0 - C5, D0- D4, ADC7, RESET should not exceed 150 mA.
    2] The sum of all IOH, for ports B0 - B5, D5 - D7, ADC6, XTAL1, XTAL2 should not exceed 150 mA.
    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.

Thats what I was looking for , thanks.

Which kind of puts a damper on things.

I'm needing to drive 15 LEDs and it is possible that they might all be on at the same time.

Each LED with it's resitor will pull ~20ma.

Thanks for the info.

You should use some kind of driver for this amount of current. I like the ULN2803 but there are many other choices.

Alternatively reduce the power to the LEDs. Can you really tell the difference between 20mA and 15mA?

Can you really tell the difference between 20mA and 15mA?

I will go as low as I can, 20ma is just nominal. Besides, the requirment just went up to 30 LEDs so even if I went to 10ma, I am back where I started.

I've been looking at differnet drivers all night, I found this one HTTP 301 This page has been moved
Looks like it is what I need, but not real sure I understand it all - been a long day. Can this be driven with a PWM for the signal pin?

Thanks

That chip takes an analogue input and converts it into a bar display so the individual LEDs are not controllable and there is not much scope fro putting in a PWM signal to controls the brightness. Yes you could filter it and put it in the Vref if you want but it controls all the LEDs at the same time.

How about a STP16C596, it is a 16 bit shift register with hefty current outputs, no PWM though for that you should use a TLC5940.

I can tap at the PWM output, or or after the Low-Pass filter, wich gives me a faily stable ~0-5 out, but I need to make sure I don't over draw that pin either way.

I'll look at them both - thanks!

EDIT
What I am trying to do is get the 0 - 5 volts to scale over 10 LEDs, for an "empty to Full" type graph.

In that case the DS007971 will do this without an Arduino.

The Analog output is comeing from the Arduino.
At first I was going to use the digi pins to simply turn on/off the LEDs based on the output Value of the PWM pins. But now I have far to many LEDs to control (3 sets of ten). So my options seem to be either the Analog out, or the Serial connected to a LCD display.

Just a simple LED bar graph is prefered.

Thanks for your input.