SDA and SCL "leaking" current

I am developing a project using the P1 module and have come across some behavior that I am trying to explain. I have an epaper display connected to the P1 module and am using pins D0 and D1 for the BUSY and RESET lines respectively. I noticed when in deep sleep mode my project was drawing more current than I anticipated. After a lot of trial and error research I found that the culprits were the connections to D0 and D1.

If I’m using my uCurrent gold correctly my Photon Redboard from Sparkfun draws 5.2mA of current when in deep sleep mode with BUSY and RESET connected to pins D0 and D1. This is from running a very minimal firmware that simply turns off the RGB LED and then enters deep sleep mode. I don’t do any pin initialization and I’m not trying to drive the display. It’s just physically connected. If I move the BUSY and RESET lines to pins A0 and A1 the current drops down to 4.1mA.

Again, the firmware I’m running is not trying to drive the display at all. It simply goes into deep sleep and just the difference of pin connections changes the current consumption. Can anyone explain why pins D0 and D1 exhibit this behavior? I also tried pins D5 and D6 and saw the same, lower current behavior as on A0 and A1. As I understand it, all of the pins should be configured as hi-z input on startup if no pinMode code has run.

The only clue I was able to find was this nugget from the STM datasheet:
“the I/O pins SDA and SCL are mapped to are not “true” open-drain. When configured as open-drain, the PMOS connected between the I/O pin and VDD is disabled, but is still present.”

I’m not sure why that would matter but D0 and D1 are the SDA and SCL lines. Any thoughts in solving this mystery would be greatly appreciated.

@sidwarkd I am not familiar with Photon Redboard nor using epaper display. My experience comes from needing to manage down power use when in normal sleep mode as well as deep sleep mode with peripheral devices attached to the I2C and SPI. The mA currents you are quoting suggest these peripherals are pulling current out of the P1. Also, not clear where you are measuring current? What voltages are present on pins D0 and D1 when in sleep versus A0 and A1 or D5 and D6? In my case to achieve really low power in sleep (uA) required very careful design of the circuit board to switching off the peripherals using a mosfet - this was done on the supply although I understand it works better on the ground side. Hope this helps.

The problem is that there are internal pull-up resistors to 3V3 on the D0 an D1 lines on the P1 only. There’re part of the P1 module itself, not the STM32F205.


@rickkas7, that would mean that with D0/D1 floating during deep sleep, the display is drawing current through those pull-ups, correct? So either @sidwarkd changes the P1 pins used or controls the low-side power to the display via a transistor.


Thanks to everyone for the quick replies. @rickkas7 thanks for confirming my suspicion about the pull-ups. I didn’t see this documented anywhere. Is that true or did I just miss it? If so I’d be happy to submit a couple of pull requests to get that info into the datasheet and reference material.

As a reference for others that come across this issue the measured voltage on both D0 and D1 in deep sleep mode is 2.5V compared to 0.1V on the other pins. I will do a PCB rev and move those lines to another set of pins.

1 Like

Hey @rickkas7 could you possibly provide me with the value of those pullup resistors so I can understand the pin input impedance?

I don’t have the values of the resistors. They’re not documented in our datasheet, because USI didn’t document them in their datasheet! We determined this through experimentation and one customer who disassembled the can and looked at the P1 module with a microscope and found the resistors.

(We will update the datasheet, but it has not been done yet. I can edit the regular docs but not the datasheets directly as there’s an errata process necessary for datasheets.)

You could measure them approximately by setting D0 and D1 to input for high-impedance and then connect your multimeter in ammeter mode between each pin and ground. Take 3.3V (or whatever you measure) and divide by the current you measure to get ohms.


Thanks @bko. I’ll give that a go.