I need a 30 second hardware based interrupt for a Nordic BLE nrf52832 chip running S132 Softdevice. I would like to use RTC2. This will be used to run a short BLE ad scan every 30 seconds.
Is there some way to get a slow TRUE hardware based, 30 second interrupt using RTC2?
It seems that 8hz is the slowest frequency for RTC.
SLOW RTC...
Is there a setting that will slow the RTC interrupt down such that I can get a 30 second period interrupt?
TRIGGER MECHANISM...
I am able to define a trigger interrupt occurring every 30 seconds, but it appears that the RTC2 handler is still receiving an interrupt at 8hz. I want to avoid an 8hz interrupt with a switch block that looks for trigger event, as this would consume more power -- than a "true" 30 second hardware based interrupt.
//Set compare channel to trigger interrupt after #of seconds.
// channel=0
// value=8hz * 30 seconds.
// true= enable trigger interrupt.
err_code = nrf_drv_rtc_cc_set(&mtag_rtc_sleep, 0, (8*30), true);
APP_TIMER...
I could use an app_timer to get a 30 second interrupt. But I have a hunch that beneath the covers, the RTC1 interrupt is occurring at 8hz, and simply invoking my defined handler every 30 seconds using a clock variable in a low-level app_timer handler that is being invoked at 8hz.
Whereby app_timer may not be providing a "true" 30 second hardware based interrupt. And it will consume more power.
Or is my concern over power usage a moot point?
Thanks,
Ken Huebner
Software Engineer
Huebner Design