Hello,
I am currently using the GPIOTE Driver (nrf_drv_gpiote) to detect external interrupts from a sensor on a custom board using the nRF51822 with the S130 v2.0.0 SoftDevice and SDK 11. I currently have the interrupts setup to use the GPIOTE IN_EVENT instead of the PORT event because I need to detect fast changing signals that are missed when using the PORT events. I have been looking through other posts on the Devzone and I am aware that using the IN_EVENT over the PORT event will increase the current consumption which is fine during normal operation. The problem I am having is that when I attempt to enter and Idle/Low-Power state (not System Off), I can't seem to reduce the current from the ~1mA that I am seeing after the interrupt triggers the IN_EVENT.
I have tried everything I can think of but no matter what I do I can't reduce the current consumption. I have tried:
- Using
nrf_drv_gpiote_in_event_disable(pin)
to disable the interrupt - Using
nrf_drv_gpiote_in_uninit(pin)
to uninitialize the module for the pin - Using
NRF_POWER->TASKS_LOWPWR = 1
to turn off the HFCLK (suggested by Ole here) - Using
NRF_CLOCK->TASKS_HFCLKSTOP = 1
to stop the HFCLK - Using every combination of the above
I am using NRF_CLOCK_LF_SRC_XTAL
as my clock source and I am certain that the GPIOTE IN_EVENT is causing the increased current consumption. When I enter the idle state mentioned above, I am calling sd_app_evt_wait()
until I leave the idle state.
Is there anything I can do to reduce the current consumption after a GPIOTE IN_EVENT is triggered?
Any help anyone can offer is greatly appreciated.
Thanks!
-Cory