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

Timer doesn't trigger if pin is held low

I'm wrapping up a job for a client and we are squashing the last few bugs, but I can't seem to understand one of them.  Pin 0.13 of our nRF52840 is pretty simple, just a button to GND, and our configuration is nrf_gpio_cfg_sense_input(BUTTON_PIN, NRF_GPIO_PIN_PULLUP, GPIO_PIN_CNF_SENSE_Low);  I also have a one second (1000ms) timer thatchecks the latch for the button pin.  Our device performs a unit of activity that includes I2S, SPI, and BLE, then waits until it is told to do so again.  When the device first resets, everything works perfectly and I can see the button press in the handler.  However, after an activity unit is executed, I no longer see the latch in the timer handler - it is always 0.  I checked the PIN_CFG, DIR, and DETECT registers to see if anything had changed, but they are the same values before and after the activity unit has run.  I was looking at the IN register to see if it goes low when the button is pushed, and when the unit is first reset, I see IN is 0 (Low) if I check it in the timer handler while holding down the button (like I expect).  However, after running an activity unit, if I hold down the button, I never enter the handler at all - it isn't until I let go of the button that the handler is hit, where I see that the latch is not set and IN is 1 (High).

The only thing I can think of is that we also turn on GPIOTE to sense a different pin during activity, but it is uninitialized after we use it, and I have tried resetting the pin 0.13 config after this to no avail.

I'm not sure what else to do at this point - I'm unaware of anything that can make a button prevent a timer handler from running, but only after a certain peripheral has been used.  Has anyone else seen this?  Even some direction on debugging would be helpful.  Thanks!

Related