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

GPIO pin configuration parameters

Hi,

 

I am using nRF52840 S140 V7.0.1. I have few queries on GPIO configurations.

 

Below are my PULLUP/PULLDOWN macros.

 

As per my understanding

 

1) In below settings, pin is configured as PULLDOWN. So by default pin will be in low state. If there is change in pin from Low to High then only wake-up.

    {FMD_WAKEUP_PIN, APP_BUTTON_ACTIVE_HIGH, BUTTON_PULLDOWN, button_event_handler}, // Pull-Down, Active High

 

2) In below settings, pin is configured as PULLDOWN. So by default pin will be in low state. If there is change in pin from High to Low then only wake-up.

    {FMD_WAKEUP_PIN, APP_BUTTON_ACTIVE_LOW, BUTTON_PULLDOWN, button_event_handler}, // Pull-Down, Active Low

 

I could not find much explanation about Active High/Low in app_button_cfg_t structure. Correct me if I am wrong in my understanding.

 

Thanks & Regards

Vishnu Beema

  • Hi,

    1)

    The pin is pulled low meaning it's pulled down to GND i.e 0. The event handler will be called when the pin is high, i.e it's active HIGH.

    2)

    The pin is pulled low i.e GND. The event handler will be called when the pin is low i.e it's active LOW. 

    regards

    Jared

  • Thank you for your inputs.

  • Hi,

     

    Sorry for confusion and further queries. Currently I don’t have CRO to see the level on pin.

     

    Below is button_event_handler() code.

    Because of GPIOTE_CONFIG_IN_SENSE_TOGGLE(), I will be receiving interrupt for both High to Low and Low to High.

    Since I configured BUTTON_PULLDOWN, I connected P1.01 to VDD for getting interrupts.

     

    My confusion / queries are

     

    1) For below configuration, by default P1.01 will be low. When I connect pin P1.01 to VDD, I am getting interrupt but button_action is 0. Does that mean, level on pin is low. Actuall I am connecting P1.01 to VDD where pin level should be High. When I remove P1.01 from VDD I will get one more interrupt with button_action as 1. Hear ideally I am disconnecting from VDD and pin level will be 0.

     

    Whether buttion_action is different from actual pin level.

     

    {FMD_WAKEUP_PIN, APP_BUTTON_ACTIVE_LOW, BUTTON_PULLDOWN, button_event_handler}, // Pull-Down, Active Low

     

    2) For above configuration, when will debounce logic will execute. Is it from High to Low or Low to High or both.

     

    Thanks & Regards

    Vishnu Beema