3

I am going to blink with LED from MCU I/O port. Where do I need to connect LED: VCC ot GND? I think it might be a difference whether the current goes into the inside MCU (when the port is low level and LED is connected to the VCC) or the current goes out from the MCU's port (when the port pin is high and the LED is pulled down to the GND). Is one of them better than another or they are equal and why?

  • 3
    Usually older designs of push-pull output drivers are more powerful when they sink (pull) current. Modern CMOS based MCU output drivers are usually symmetrical enough that the current sink/source capabilities are equal. – KyranF Aug 20 '15 at 16:49

1 Answers1

7

You should check the spec of the IO port.

If your circuit is like [Vcc --> LED --> resistor --> IO port] the port must be able to sink the current required for your LED.

If your circuit is [IO port --> LED --> resistor --> GND] then your port needs to be able to source the current required for the LED.

One isn't inherently better than the other. It depends on your design constraints. If Vcc is a much higher voltage than your IO port can reach than the first option won't work (could never shut off the LED). If they both are 3.3V then it shouldn't matter, but check the specs.

ACD
  • 2,338
  • 11
  • 26