This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

GPIO Behaviour During Power Down (NRF52832)

Hi Nordic,

I've used a GPIO of the NRF52832 to drive a FET circuit which latches off the battery, however as the board voltage collapses I see a short pulse on the GPIO pin, which reconnects the battery.

Would appreciate if you could suggest a work around to prevent the pulse. I've tried setting the pin back to an input prior to the power down, but still saw the pulse.

What is particularly odd is that I don't see the same behaviour on every GPIO pin.

To better debug, I've tested GPIO behaviour using GPIO P0.23 and P0.24 which are test points on my board and not connected to any circuitry. I also created a simple executable to ensure no odd software behaviour.

On P0.23 I get this:

  • exponentially decaying curve is the board voltage, decaying from 3V

  • lower trace is pin P0.23. When the board voltage reaches about 0.6V the pin voltage jumps up to approximately the board voltage

  • scope settings: 0.5V / div, and 1 second /div

image description

But on P0.24, I see:

  • traces and scope as above

  • P0.24 stays low, as board voltage decays

image description

My main function is:

int main(void)
{

  nrf_delay_us(1000);
  

  // initialise the gpiote driver if needed

  if(!nrf_drv_gpiote_is_init())
    nrf_drv_gpiote_init();

  // set test points low

  nrf_gpio_pin_clear( 23 );

  nrf_gpio_cfg( 23, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT,
 		NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_S0S1, NRF_GPIO_PIN_NOSENSE );

  nrf_gpio_pin_clear( 24 );
 
  nrf_gpio_cfg( 24, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT,
  		NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_S0S1, NRF_GPIO_PIN_NOSENSE );


  while(1);

}
  • Whoops, that would be a good think to mention. I'm using a NRF52832

  • OK.

    Its interesting that this only appears to happen on specific pins.

    I'm not entirely sure I understand what you are saying.

    You seem to be saying that when you remove the power from the nRF52 that the voltage on that pin decays to a specific point and then latches up to the Vdd voltage, which then continues to decay

    I'm not sure why this would be an issue, unless you are powering the FET from a different supply which is not turned off, or you are feeding the output of the FET to some other circuit which you are not turning off.

    Have you tried pulling the input to the FET low via a 10k or perhaps a 4.7k resistor etc

    Does it does this even if the FET is not attached?

  • Hi Roger,

    Thanks for looking at this.

    Yes exactly, at about Vdd = 0.6V, the GPIO pin suddenly appears to be connected to Vdd. About 0.75 seconds later, after futher decay of Vdd, the GPIO pulls back to GND. This happens on the GPIO where I have a FET connected with a pull down resistor, but it also happens on GPIO pin P0.23, which has nothing connected other than my scope. And oddly it does not happen on P0.24.

    I have a pull down on the FET to keep it off by default, even so the pulse is able to turn on the FET. The FET is not fully on, but the circuit driven by the FET is sensitive and responds event to the partial on state of the FET, and yes the FET drives a circuit which remains powered.

    I could alter my circuit to deal with the pulse, but this would be a respin of the board layout, so I am hoping there might be a software fix. Perhaps its possible to for instance turn off the power feed to the GPIOs. Probably requires someone at Nordic to take a look, as I haven't seen any published details of internal GPIO driver circuit.

    Michael

  • Hi Mike

    This sounds like something Nordic need to respond to.

    I would create a support request via their MyPage system.

    PS. My only other thoughts are to potentially fit a FET with less gain ( which is the same package) but that still may not work.

    You could potentially also try detecting the power being turned off and put the GPIO into input mode.

    Or as you already have a pull down, you could try not setting and clearing the pin, but switch it from output to input mode , as in input mode the pin will be pulled low.

    In fact perhaps you should try my last idea first ;-)

    Edit.

    Looks like you may have already tried it in input mode, but I am not sure...

Related