xmega LED current limit

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

Hi
I am trying to drive about 10 LEDs from a XMEGA A4 chip, two on PORTB, 4 on PORTC and PORTD. Each LED needs about 20mA.
Does this exceed the current limit of XMEGA A4? Also, is it better to drive the LEDS using the XMEGA as current sink or source, or a mix of the two.
Thanks
Tom

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

According to datasheet,20mA is the absolute maximum rating of I/O pins.
Maximum source and sink currents depend on supply voltage and temperature.As you can see from Datasheet, maximum Source current is less than sink at VCC=1.8v by a factor of 2.
At higher VCCs both have maximum value of 20mA.

Ozhan KD
Knowledge is POWER

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

Like living on the edge?

The XMega A series data sheet says the Absolute Maximum DC Current per I/O Pin is 20.0 mA, and the Absolute Maximum DC Current on the Vcc and Gnd pins is 200.0 mA.

Atmel calls these Absolute Maximum values "stress ratings", and proper operation of the uC is NOT guaranteed under continous operation at these levels.

So, not a great idea to do this.

Several options include using the newer high intensity, low current LEDs. There are many that run at 2 mA and put out more light than the older ones use to at 20 mA.

You could also use external driver transistors, LED driver chips, or peripheral driver chips.

The Atmel Data Sheet for the Xmega A series can be found Here , and the section of interest is Section 34.1 Absolute Maximum Ratings*.

JC

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

I wonder if temperature is the factor for the 20mA limitation. How about 10mA, is it safe to drive 10mA as source continuously?

I don't want external LED driver or MSFET, cost and size are limiting factors.

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

Quote:

I wonder if temperature is the factor for the 20mA limitation

Surely it's width of traces and bonding wires? Above a certain voltage they'll act (once!) as a fuse.

You don't need MOSFETs for a small number of LEDs, BJT's should be fine or how about a high current latch? In fact you can trade AVR size/pins for the size of the latch if it's serially connected.

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

Quote:
is it safe to drive 10mA as source continuously?

That would be fine.

JC

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

I always prefer sink instead of source...personal preference. The resistor that you put between the supply and the led can be easily changed to the exact current requirement for the led.

What led type are you using? The led might only need 2mA as specified earlier by DocJC. Then you don't have a problem.

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

When I drive a lot of LEDs with a micro, enough that I'm getting near (or over) total current limits, I do half source and half sink. This equalizes the current in the uC Vcc and GND pins. e.g. if you're driving 16 LEDs at 10mA each, if you do all source or sink you're putting 160mA through Vcc or GND, but if you do half and half then both Vcc and GND are only seeing 80mA. That is of course in addition to other current drawn by the uC.

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

You can also time multiplex the leds so that you can drive more of them, just not all at the same time. Your eyes won't know the difference (except that since this is a form of PWM the absolute brightness will be less).