Hi all,
I want to use gpiote module of nrf52832 in in_out mode.
This means I want to config a gpio pin as output in open-drain mode like other MCUs while this pin can also sense the bus if it goes high or low.
Can nrf52832 support this.
Hi all,
I want to use gpiote module of nrf52832 in in_out mode.
This means I want to config a gpio pin as output in open-drain mode like other MCUs while this pin can also sense the bus if it goes high or low.
Can nrf52832 support this.
Hi Believer
This can be done, yes.
It is possible to enable the input buffer on the GPIO pins even in output mode, which allows you to read the state of the pins also when the pin is configured in the output direction.
Best regards
Torbjørn
Hi Ovrebekk,
Thank you for letting me know it's possible.
Can you show me exactly how to do it?
I have searched a lot in nrf lib but there's no option for me to enable the input buffer.
Best regards,
Hi
If the lib doesn't support it there is always the hardware registers ;)
I tested it myself by configuring the pin directly through the PIN_CNF[n] register:
NRF_P0->PIN_CNF[BSP_LED_0] = GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos |
GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos |
GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos;
Best regards
Torbjørn
Hi
If the lib doesn't support it there is always the hardware registers ;)
I tested it myself by configuring the pin directly through the PIN_CNF[n] register:
NRF_P0->PIN_CNF[BSP_LED_0] = GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos |
GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos |
GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos;
Best regards
Torbjørn
Hi Ovrebekk,
Thank you so much for your support.
Your solution works very well.
Best regards,
Awesome!
Best of luck with your project
GPIO_PIN_CNF_DRIVE_S0S1 I would think it should be GPIO_PIN_CNF_DRIVE_S0D1 unless this possibility does not exist.