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
But on P0.24, I see:
-
traces and scope as above
-
P0.24 stays low, as board voltage decays
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);
}