10 LEDs on atmega328?

HI, Im doing my own PCB with atmega328 chip and NCP1117ST50T3G (wich have 1Amp max current)

i have read that arduino have max 40mAmps on 1 digital pin... ok.. so if i have a resistor and a LED (1) on one digital pin... OK

Meaning, if i have 10 LEDS with resistor connected and all LED are ON for a long long loooong time... Will this be ok?

So if each LED have 20 milliAmp current 10 leds x 20 milliA = 200 milliAmp = 0,2 A

So... if im correct this should work with no problems? Right? Just want to be shure :D

i have read that arduino have max 40mAmps on 1 digital pin...

No that is the current when damage starts to occur.

So if each LED have 20 milliAmp current 10 leds x 20 milliA = 200 milliAmp = 0,2 A

So... if im correct this should work with no problems? Right?

Sorry wrong. There is a current limit on the power pin of 200mA and all the LEDs will be going through that. In addition there is a limit on the current from each port. This is in the data sheet for the processor:-

ATmega48PA/88PA/168PA/328P: 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.

Sorry about the formatting of this it looks good in the preview but at the moment the forum is crap.

So the max sum of all ports is 100 millis... So if i add darlington array (transistors) i think everithing will be ok :D

So the max sum of all ports is 100 millis..

No. B0 - B5, D5 - D7, XTAL1, XTAL2 should not exceed 100 mA. and for ports D0 - D4, RESET should not exceed 100 mA.

Couple that with a max +5V pin of 200mA

Grumpy_Mike: Sorry about the formatting of this it looks good in the preview but at the moment the forum is crap.

And it wasn't even broken before they fixed it...

If you wire some LEDs to GND and some to 5V (active LOW) then you can arrange that the max current for the GND pin of the IC is 100mA and max for Vcc is 100mA, which is less stress on the device. You compensate for some LEDs being active LOW in the code...