Maker Pro
Maker Pro

sinking and sourcing current

W

Wong

Jan 1, 1970
0
Hi,
If I use a GPIO pin on a IC to drive LED, which configuration is the
best ?
1.) LED's negative pin to GPIO, positive pin to other power source.
or
2.) LED's negative pin to Ground, and positive pin to GPIO. Of
course both with current limiting resistor.

Is this related to the current sinking and sourcing ?
Thanks in advance.
 
B

Bernhard Roessmann

Jan 1, 1970
0
Wong said:
Hi,
If I use a GPIO pin on a IC to drive LED, which configuration is the
best ?
1.) LED's negative pin to GPIO, positive pin to other power source.
or
2.) LED's negative pin to Ground, and positive pin to GPIO. Of
course both with current limiting resistor.

In most cases, 1) ist better, because many IO-Pins can sink more current
than source, but newer Microcontrollers/Processors often have equal
sink/source capabilites.
Consult your data sheet, section "DC characteristics".
Is this related to the current sinking and sourcing ?

Yes, 1) GPIO sinks current, 2) sources current.

LG,
 
B

Bernhard Roessmann

Jan 1, 1970
0
Wong wrote:

Additionally, don't forget: If you use the "sink design", your software
has to invert the outputs (because of writing "1" means H voltage level
and led OFF, "0" means low voltage level and therefore led ON").


Regards,
 
S

Spehro Pefhany

Jan 1, 1970
0
Hi,
If I use a GPIO pin on a IC to drive LED, which configuration is the
best ?
1.) LED's negative pin to GPIO, positive pin to other power source.
or
2.) LED's negative pin to Ground, and positive pin to GPIO. Of
course both with current limiting resistor.

Sinking is better (the first one).
Is this related to the current sinking and sourcing ?
Thanks in advance.

Look at the voltage drop curves for why it is better. The maximum
current rating may well be the same in either direction, however the
sinking (n-channel) transistor will typically have less voltage drop
at the same current.

Best regards,
Spehro Pefhany
 
Top