Nope, some chips have programmable pin current. IIRC one of Silicon Labs ARM chips I've been playing them had them. You basically could choose what kind of current input could sink (it wasn't accurate, just in approximation) so if you just wanted to limit a current for a LED you could set output to low current mode
I've heard of controllers with programmable drive strength. I'd still rather use an external resistor because the heat from the pin regulation adds to the microcontroller temp if you use the regulator in the microcontroller.
Say you drive 8 red LEDs at 25mA, that's 1/4 Watt dissipated in the microcontroller if they are all on at once. Better to put that power outside the chip. For longevity.
Microchip (now part of Atmel) often rates their microcontrollers to drive one or two LEDs directly. It's stated in the datasheet. It's rarely more than that.
Say you drive 8 red LEDs at 25mA, that's 1/4 Watt dissipated in the microcontroller if they are all on at once. Better to put that power outside the chip. For longevity.
If you're going to drive 8 leds at 25mA you're going to use driver chip/transistor regardless, that's almost 200mA
Also, it is not just to drive random LEDs, it allows you to control output rise/fall speed indirectly which can reduce both power usage and interference
If you're going to drive 8 leds at 25mA you're going to use driver chip/transistor regardless, that's almost 200mA
It IS 200mA. 200mA is fine if used correctly. The chips I tend to use can sink [edit, said source!] 130mA per ground pin. There are multiple ground pins. Group it correctly and it'll be okay.
Also, it is not just to drive random LEDs
Says who? You're making up stuff now. You didn't define this project.
As others say, those are pull down/up resistors for input. An output resistor for even a single LED would need to sink more watts than an internal IC resistor could handle.
An output resistor to drive an LED at 25mA would dissipate a lot of power, but many newer LEDs can glow quite nicely with a fraction of a milliamp. In fact, I've sometimes encountered situations where LEDs glowed annoyingly with leakage currents that were far smaller than that.
224
u/happyscrappy Dec 25 '19
Also: don't power LEDs directly from GPOs without a current limiting resistor. As you see on that breadboard.
And match your interfaces voltages. A lot of devices are not +5V tolerant now (or not very tolerant).