How to set the GPIO of NRF52840 to high resistance state?

I want to set the GPIO of NRF52840 to the high resistance state. How do I set the GPIO of NRF52840 to the high resistance state,  please help me,thanks!

Parents
  • Hello,

    Do you mean high impedance / High Z?

    If so, then the default state of all GPIOs are high Z which is acheived by putting the GPIO in "Disconnected Input". 

    How did you change it from disconnected input? Did you use it in a peripheral (UART / SPI / I2C / ...)? In that case, I suggest that you disable whatever peripheral that is using that GPIO, if you can find an uninit() or definit() function. If not, you can put the GPIO settings register back to 0x00000002 manually. How do to that depends on what SDK you are using.

    Here is a description of the GPIO's configuration register: https://infocenter.nordicsemi.com/topic/ps_nrf52840/gpio.html?cp=4_0_0_5_8_1_9#register.PIN_CNF-0-31

    There exists API to configure this. Based on your case history, it looks like you are using the nRF5 SDK, so let me know if that is not the case this time.

    Try using nrfx_gpiote_in_uninit() or nrf_gpio_cfg_default() to clear the configuration of the pin that you want to set to disconnected input. 

    Best regards,

    Edvin

Reply
  • Hello,

    Do you mean high impedance / High Z?

    If so, then the default state of all GPIOs are high Z which is acheived by putting the GPIO in "Disconnected Input". 

    How did you change it from disconnected input? Did you use it in a peripheral (UART / SPI / I2C / ...)? In that case, I suggest that you disable whatever peripheral that is using that GPIO, if you can find an uninit() or definit() function. If not, you can put the GPIO settings register back to 0x00000002 manually. How do to that depends on what SDK you are using.

    Here is a description of the GPIO's configuration register: https://infocenter.nordicsemi.com/topic/ps_nrf52840/gpio.html?cp=4_0_0_5_8_1_9#register.PIN_CNF-0-31

    There exists API to configure this. Based on your case history, it looks like you are using the nRF5 SDK, so let me know if that is not the case this time.

    Try using nrfx_gpiote_in_uninit() or nrf_gpio_cfg_default() to clear the configuration of the pin that you want to set to disconnected input. 

    Best regards,

    Edvin

Children
No Data
Related