megi's PinePhone Development Log RSS

+972

2022–08–06: Pinephone keyboard bugs and new findings

There is some speculation out there about Pinephone keyboard charger chip (IP5209) getting damaged simply by plugging in something into Pinephone's USB-C port, because that's supposed to be like connecting two chargers into a single port, which somehow causes damage.

I decided to measure this, and see what really happens:

The charging situation with the keyboard looks like this:

There are a few things that can be seen from the picture:

So that's a bit annoying. Another few things can be seen about how charging the batteries works:

Many fun combinations are possible. The question is if some of them are problematic. For example what happens when you enable VOUT from keyboard and plug in USB PSU to the phone at once. Not much really. I've measured voltage transients and current from VOUT pin, and everything is withing reasonable parameters. The load presented by the phone is split between USB PSU and the keyboard's VOUT BOOST regulator, so part of the power is provided by the keyboard and part by the USB PSU. That is somewhat wasteful use of the keyboard battery, but not harmful. It's good to disable VOUT when you want to charge the phone battery using a phone's USB-C connector, to not needlessly discharge the keyboard battery.

What happens when VOUT is disabled? Nothing. IP5209 lives on, and there's no current flowing into VOUT from USB PSU connected to VBUS. All good.

Now the surprising thing is what happens when you plug USB PSUs to both the keyboard and the phone. One would think that the keyboard will continue supplying power to the phone via VOUT, like in the first scenario, except that the keyboard battery would not be getting discharged this time. Nope. What I measured was 450mA current flowing into VOUT, and not out of it, like before. That is NOT expected, and not wanted at all. At best we'd expect no current at all. IP5209 would nicely charge the battery from it's own VBUS input, and phone would charge it's own battery from its own VBUS input and no current would flow to VOUT. This is a situation that is problematic and needs to be avoided. To avoid it, it's enough to not connect anything to phone's USB port when a USB PSU is connected to the keyboard. All other combinations seem to be safe. In particular, it should be safe to have VOUT from the keyboard enabled, and to charge the phone via phone's USB-C port, or to use the dock with the phone's USB-C port.

So the only thing to worry about is to not connect anything to phone's USB port when keyboard's USB port is occupied. That is unsafe, and it behaves weirdly. Turning off VOUT when charging the phone directly is a good idea, but forgetting to turn it off will only lead to needless discharging of the keyboard's battery, and should not damage the keyboard. There's no backflow of the current into VOUT. The short periods of energy backflow into VOUT did not lead to IP5209 damage in my tests. But I don't know if that energy went into charging the keyboard battery somehow, or was dissipated as extra heat. That would be something to measure next. :)