3
\$\begingroup\$

I have a question about driving an LED from an IC. NXP in the datasheet of their PCAL6416A (section 9.1) says that a resistor parallel to the LED should be used in order to minimize power consumption in the off-state, see image. Why is that needed?

In their datasheet they say that the voltage at the pin Pn of the IC should be at or higher than VDD when the LED is off. However, this can be achieved by setting pin Pn as output at high level, which should be VDD. In that case the voltage (with reference to GND) before the LED and behind the LED is both VDD, so no current should be flowing even in the absence of the 100k resistor.
Additionally, I could set Pn as input pin and thus disable current flow through the LED, again without the 100k resistor. So why is the 100k resistor needed?

parallel resistor

More confusing is the other suggestion, supplying the LED with a higher voltage then VDD, see second picture. In this case, if Pn is configured as output, it can be high (3.3V) or low (0V). Now let's use a red LED with a voltage drop of 1.5V and supplied from 5V. In this case, I will get a current through the LED regardless of whether I set Pn to high or low. Why is this design suggested as a solution to reduce power consumption?

higher supply voltage

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

These I/O pins are programmable, so even if you are using them as outputs, there is an active input inside the part.

Inputs that are not at a valid logic 0 or 1 may draw a slight amount of current. Many MCUs with programmable GPIOs will have this same warning.

The amount of wasted power is small, it may not be a factor in many applications.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ That is true but the IO pin would likely be an output so it would likely have valid logic 0 or valid logic 1 voltage so there would be no invalid voltages - which is what the question is about why the extra resistor is needed if the output is push-pull. The diagram and text may be simply copied from a similar device with quasi-bidirectional IO. \$\endgroup\$
    – Justme
    Aug 27, 2022 at 22:41
  • 1
    \$\begingroup\$ @Justme - good point. It seems that programming to push-pull instead of open-collector is a better solution. \$\endgroup\$
    – Mattman944
    Aug 27, 2022 at 23:07
  • 1
    \$\begingroup\$ Note that output configuration is by port rather than individual pin. \$\endgroup\$ Aug 27, 2022 at 23:51
  • \$\begingroup\$ So when I either set the pin as high output or activate the pull-up when selecting input, then I need no external resistor? \$\endgroup\$
    – laolux
    Aug 28, 2022 at 0:49
1
\$\begingroup\$

The datasheet clearly says when the LED is OFF, meaning default state as INPUT.

"When the I/Os are used to control LEDs, they are normally connected to Vdd through a resistor as shown in Figure 17. Since the LED acts as a diode, when the LED is off the I/O Vin is about 1.2 V less than Vdd. The supply current, Idd(+), increases as Vin becomes lower than Vdd(+).

When the input is near Vdd/2 there is internal cross-conduction leakage current.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Well, the LED is also OFF when having the pin set as output with a high level, at least when supply voltages are identical. Also, they use the same graphics and description for the PCAL9555A, which by default is configured as input with internal pull-up enabled. Though the info about leakage current is something I will remember, thanks. \$\endgroup\$
    – laolux
    Aug 28, 2022 at 0:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.