1
\$\begingroup\$

Setup

I have an STM32L151 mcu(application processor) and on its PB5 pin I have a peripheral (SARA-N3) connected. The requirements for the peripheral are that the pin is configured as an open drain output and is only used to pull it down for 1 second. The peripheral has an internal pull up to 1.1V and a max allowed voltage at 1.3V, however the mcu pin levels are at 3.6V. The mcu side is configured with no pull-up/pull-down resistor.

enter image description here

Problem

The problem I am having is that when the mcu goes in stop mode (low power), there is a power supply increase due to that connection pin, i.e. PB5.

  • 1st attempt was to set that pin to output 1 and open drain. In theory, this should mean the pin should no be driven and keep the voltage of the peripheral(as observed), but observed the additional current.
  • 2nd attempt was to enable the pull up on the mcu side ( pin is still output). This had the effect to drive the pin to 2.7V which is not allowed by the peripheral pin and still there additional current was observed.
  • 3rd attempt was to set the pin to analogic or input mode but the effect was the same as attempt 1
  • 4th attempt was to disable the Schmidt trigger of the mcu pin (pin is was output). This improved a little bit but still not what I expect
  • 5th attempt tried a different pin, i.e. PA11. The pin is configured as open drain output with no pull. The power supply current is still there. It only stops when I disconnect the pin and connect it to the Vdd of the MCU

Guess

My guess is that the voltage level of the pin compared to the voltage levels of the mcu pins is probable considered digital low and hence causing some FET to let current through

Question

Is there any suggestion on how to configure the STM32L1 GPIO pin operating at 3.6V so that it does not leak current when the pin connected to has a voltage value of 1.1V?

\$\endgroup\$
7
  • \$\begingroup\$ How did you determine that was 'current leakage' into or out of the pin? \$\endgroup\$
    – brhans
    Commented Mar 18, 2021 at 0:10
  • \$\begingroup\$ Which exact STM32L1 model it is? \$\endgroup\$
    – Justme
    Commented Mar 18, 2021 at 6:46
  • \$\begingroup\$ @brhans I measured the current of peripheral itself, e.g. 3uA. I measured the current of the mcu without the peripheral 7uA. Then I connected the peripheral to the mcu and there was an additional current, it was 20uA instead of 10uA. \$\endgroup\$
    – akarapatis
    Commented Mar 18, 2021 at 8:40
  • \$\begingroup\$ @Justme STM32L151CC \$\endgroup\$
    – akarapatis
    Commented Mar 18, 2021 at 8:42
  • 1
    \$\begingroup\$ PB5 is an FT pin and it should consume least when configured to analog mode where Schmitt trigger is also disabled, as in input or output modes the Schmitt is enabled. Pull ups and downs must be obviously disabled. You also need to make sure that the analog routing for PB5 is disabled. Those are your software options. Can you verify where the current leaks if you cut the trace to PB5? Can you change hardware? \$\endgroup\$
    – Justme
    Commented Mar 18, 2021 at 9:08

1 Answer 1

1
\$\begingroup\$

You could use an external pull-up resistor coupled with a BJT, or MOSFET to reduce the junction voltage.

That way, you can enable the pull-up only when the MCU is running.

schematic

simulate this circuit – Schematic created using CircuitLab


Another option is:

2nd attempt was to enable the pull up on the mcu side ( pin is still output). This had the effect to drive the pin to 2.7V which is not allowed by the peripheral pin and still there additional current was observed.

You can make a voltage divider with 2 resistors to reach 1.1V and then use an ADC to read the value.

Even though the voltage is 2.7V, higher than allowed, it might be OK as the current is actually very small as integrated MCU pullup are very high, so the current will be limited to a few uA and shouldn't fry your device. Don't forget to disable the pull-up before putting the MCU to sleep and set the pin as an input.

\$\endgroup\$

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.