Configuration Pin in open-drain output - Low State unexpected

Hi,

I would like to declare my pin in output open-drain, so i use this configuration 

static void gpio_cfg_output_open_collector(uint32_t pin_number)
{
    nrf_gpio_cfg(
    pin_number,
    NRF_GPIO_PIN_DIR_OUTPUT,
    NRF_GPIO_PIN_INPUT_DISCONNECT,
    NRF_GPIO_PIN_NOPULL,
    NRF_GPIO_PIN_S0D1,							               // Standard '0', disconnect '1'.
    NRF_GPIO_PIN_NOSENSE);
}

My issue is when i declare my pin, I have an unexpected low state that occur, is this normal?

I tried to configure with pullup, but same behavior.

    gpio_cfg_output_open_collector(PIN_1); // pin goes high to down 
    gpio_cfg_output_open_collector(PIN_2); // pin goes high to down 
    
    nrf_gpio_pin_set(PIN_1); 					
    nrf_gpio_pin_set(PIN_2);

Are my configuration correct ? 

I would like to keep the high state during the configuration because a low state provoke a reset on a module not expected.

I'm using a NRF52840 and the S140 v6.1.0

Thanks and best regards,

Julien

Parents Reply Children
No Data
Related