2
\$\begingroup\$

I'm using an MCP73833 (link to the datasheet) as the charging chip in one of my projects. We use its STAT1 pin (which is an open drain that goes to GND when a battery is being charged and floats if the battery is fully charged, or no battery is connected) to interface with a microcontroller to play an LED effect when the charge is underway and another one when it's completed. The pin is pulled high with a 10k resistor, and the GPIO pin of the microcontroller is also pulled high internally. Our current design follows the recommended design on the datasheet with some changes to accommodate our needs (nothing critical, things like max current, etc.)

So far, everything worked as expected, but we wanted to also add an LED to the same pin to use as a second indication (for a very particular reason. I know it's redundant, it's a long story). When we added the LED, the LED turns on when a battery is being charged, as expected, but we noticed that the microcontroller would rarely detect a battery charging. After measuring the voltage at the pin, we noticed that the voltage was ~0.8V, and not 0V, well above the logic level for 0. If I cut the trace that goes to the microcontroller, then the LED works and the voltage at the pin goes to GND. I drew a small schematic, hope it helps.

enter image description here

So to sum up, we follow the recommended design of the charging chip and want to use STAT1 to know the status of the charge cycle. If we interface with a microcontroller, or we use an LED as an indication, the pin goes to GND, as expected. If we use both, then the pin shows ~0.8V, and only the LED turns on, but the voltage is too high for the μC to see a low level, and I just can't think why. I know that the current drawn by the LED is a tad above the typ sinking current of the STAT1 pin, but it's well within spec. I could also see that an internal pull down in the GPIO pin in the μC could cause a voltage rise if some of that current leaked into it, but that's not the case.

\$\endgroup\$
  • \$\begingroup\$ Vusb is perhaps 5V. Which is what the GPIO will see when STAT1 floats. Likely fries your micro. \$\endgroup\$ – scorpdaddy Jun 10 at 13:03
  • \$\begingroup\$ Sorry, for simplification I didn't show the whole schematic. The voltage would be pulled to 3.3V, so no chance for the microcontroller to see 5V. On top of that, there's actually a pogo pin connecting the charger to the μC. When the pin floats, there's no connection, so that risk is gone. Your comment made me realise that there's actually some voltage across the LED (1.7V), which should not be the case, even though is not enough to make the light from the LED visible. \$\endgroup\$ – Joel Santos Rico Jun 10 at 13:34
3
\$\begingroup\$

Summary: The conditions you see are what would be predicted from the data sheet.
The combination of LED current alone can pull the STAT1 pin to the level you see on some (and probably many samples of the IC used, and adding uC pullup current makes it worse.

Try reducing LED current to a few mA, which should be more than adequate for the purpose with any modern LED, and see what difference it makes.


Detail:

Datasheet values include some or all of minimum / typical / maximum.

In this case the key parameters are

...Sink Current ISINK: — 15 25 mA
Low Output Voltage VOL: — 0.4 1 V @ ISINK = 4 mA

Where "-" for the minimum value = unspecified.

Your diagram indicates that you are sinking 20 mA via the LED when pin STAT1 is low.
Maximum STAT1 sink current is 25 mA - from SOME ICs, typical is 15 mA (above what YOU show the pin being required to sink) and the manufacturer does not indicate what the minimum capability is. It could be 10 mA or even 5 mA and still meet specification!

Also, at a sink current of 4 mA the data sheet (and the above extract) show that STAT1 is typically at 0.4V and worst case may be 1 volt. I the internal gate had constant resistance (and it doesn't) then at 20 mA you'd expect 0.4 x 20mA/4 mA = 2V typical and 1 x 20/4 = 5V max. It is, of course, unlikely to be that high with a 6V supply - but you also are probably not getting 20 mA LED current.

\$\endgroup\$
  • \$\begingroup\$ Ah! I think this must be it. You are totally right. It was the stat just below the one I checked to make sure that the sink current was ok (which... kind of wasn't...). I tried reducing the LED current by increasing the current limiting resistor and it started to behave better. I will try to isolate the output from the other circuitry with a transistor. Thanks! \$\endgroup\$ – Joel Santos Rico Jun 10 at 13:28
  • \$\begingroup\$ @JoelSantosRico Just using a substantially higher resistor value should work. If eg a RED LED and 5 mA then R ~+ (5Vusb - 2VLED)/ 0.005 = 600 Ohms. Something in the 470R - 1k range should be fine. \$\endgroup\$ – Russell McMahon Jun 10 at 14:27
  • \$\begingroup\$ Hi Russel. That's a good idea, but the LED has to shine through some plastic material, so I'm quite weary to change its light level at this point in the design phase in case it's not bright enough. \$\endgroup\$ – Joel Santos Rico Jun 10 at 15:52
  • \$\begingroup\$ @JoelSantosRico Do what you have to BUT a modern LED should be well over 100 lumen/Watt. At say 5 mA and 2V that's 10 mW or at 100 l/w = 1 lumen. Illuminate an area 5mm x 5mm gives a light level of 40,000 lux or about 40% of looking straight at the sun or 100 x as bright as a bright LCD screen. If your plastic material does not pass that you may wish to redesign it :-). \$\endgroup\$ – Russell McMahon Jun 11 at 1:48
  • \$\begingroup\$ Damn! that 40% of the sun really put it in perspective :D Thanks for your advice, I will do some tests and grab the design team to ask for their opinion. \$\endgroup\$ – Joel Santos Rico Jun 11 at 9:37
5
\$\begingroup\$

There is a distinct possibility that there is some type of latchup going on inside the MCU when the STAT output pin OFF. Under this condition the bleed from the 5V USB source through the LED and into the input pin of the MCU is going to bias the input above the 3.3V VDD of the MCU. This illegal condition may be turning on some circuit that makes the input pin of the MCU suddenly source a lot of current when the STAT pin goes low. The high level of current overloads the STAT pin to the point that it can no longer drive to GND.

You could check this condition by putting a current meter in series with the input to the MCU.

This condition could be avoided by using an MCU that as 5V tolerant inputs. Some do and others do not.

\$\endgroup\$
  • \$\begingroup\$ or alternatively powering the LED from 3.3v \$\endgroup\$ – Jasen Jun 10 at 10:23
  • 1
    \$\begingroup\$ @Jasen - Connecting the LED to 3.3V is a possibility but may not be advisable in the case that the 3.3V is generated from the battery. \$\endgroup\$ – Michael Karas Jun 10 at 10:25
  • \$\begingroup\$ Thanks for your quick reply. I tried driving the LED with 3.3V and keep the current to 20mA, and the voltage drop was also ~.8V. I also checked the current going to the pin, and measured 50μA (coming out of the pins), so I don't think it's this particular case. I liked your answer a lot though, I appreciate the effort you put to help me! \$\endgroup\$ – Joel Santos Rico Jun 10 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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