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

Pullup/pulldown GPIOTE

Hi!

I'm reading the PS for nRF52832 and I can't find a clear answer on the following question.

If I set up a GPIO channel with pull-up/pull-down in the PIN_CNF[n] register and then want to use that channel as a GPIO task/event (GPIOTE). Does the GPIOTE logic some how remove my pull-up/pull-down setting or is it still active?

The reason I ask is that I understand that GPIOTE logic changes for example the GPIO configured DIR..

Best regards

  • Hello bitFrost

    The nrf_drv_gpiote_in_init will overwrite the pull config of your gpio pin. The function takes in three attributes, pin number, configuration of the pin and event handler. It is in the configuration struct the pull must be defined. If you look at line 495 in nrf_drv_gpiote.c you can see the function configures the pin with the pull specified in the config struct.

    So to keep your pin configuration, make sure the config struct you forward to it has the right settings.

    Best regards

    Jørn Frøysa

  • Hi Jørn! My question was not about the SDK but the hardware. Will enabling the GPIOTE on one pin disable (or in any other way change) the configured pull-up/pull-down configuration on that pin? But I think I got the answer from the code you pointed me to. Thank you

  • GPIOTE hardware is related to the generation of events and execution of tasks, and doesn't change configuration of pins. All pin configuration changes are done in software via the GPIO module.

  • According to nRF52832_PS_v1.2 (section 21.3) GPIOTE will (when enabled on that pin) override the DIR setting in GPIO. So I was wondering if anything else in PIN_CNF[x] was overridden or disabled, for example the PULL fields.

  • You are of course absolutely right. This was a oversight on my part and I apologize. I have looked into it and if you enable event on a input pin configured with pull-up it should not affect the pull-up. If tasks are enabled for an input pin we believe it will disconnect the pull-up as the output configuration of GPIOTE takes precedence.