This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

GPIO sense interval?

Dear Nordic Developer Zone,

I'm using nrf51822 EK testing the GPIO sense function. The code I'm using is based on what a nordic employee has posted elsewhere in this dev Zone.

I configured PIN 0 as input sensing for low level. It worked but couldn't work as fast as I wanted it to. By that I mean I can only trigger it again after waiting for another 2 seconds. If not doing so, the LED toggling wouldn't trigger.

I checked the datasheet but ended with no info for that.

Anyone knows whats happening?

Here is my code. main.c

Thanks.

Regards,

Tony

Parents
  • Yes your problem is here ..

    | (NRF_GPIO_PIN_NOPULL << GPIO_PIN_CNF_PULL_Pos)
    

    The evaluation kit doesn't have pullup resistors on the buttons so when you release the button the voltage is just drifting slowly back up towards Vdd from 0 .. which in my experience takes about 1-2 seconds. You need NRF_GPIO_PIN_PULLUP.

    If you import the boards.h include and use the 'BUTTON_PULL' define, it works for all boards because it's defined appropriately there for each one.

  • Yeah, it worked. But it stimulates me thinking what if I want to use not the buttons but a general GPIO pin then how should I config that pin. From what I've known, those pins don't have pull_up/down resistors connected.

Reply
  • Yeah, it worked. But it stimulates me thinking what if I want to use not the buttons but a general GPIO pin then how should I config that pin. From what I've known, those pins don't have pull_up/down resistors connected.

Children
No Data
Related