Hello,
I am using nRF52832 with S132 and SDK_11.0.0. I am facing issue with using power fail warning POFWARN. below is my code snap.
void POWER_CLOCK_IRQHandler(void)
{
if(NRF_POWER->EVENTS_POFWARN == 1)
{
RED_LED_ON;
APP_LOG("POWER FAIL EVENT\r\n");
NRF_POWER->EVENTS_POFWARN = 0;
}
}
err_code = sd_power_pof_enable(POWER_POFCON_POF_Enabled << POWER_POFCON_POF_Pos);
APP_ERROR_CHECK(err_code);
err_code = sd_power_pof_threshold_set(POWER_POFCON_THRESHOLD_V25 << POWER_POFCON_THRESHOLD_Pos);
APP_ERROR_CHECK(err_code);
NVIC_ClearPendingIRQ(POWER_CLOCK_IRQn);
NVIC_SetPriority(POWER_CLOCK_IRQn, APP_IRQ_PRIORITY_HIGH);
NVIC_EnableIRQ(POWER_CLOCK_IRQn);
I am getting error = 0x2005 with sd_power_pof_threshold_set(). Also If I use sd_power_pof_threshold_set(NRF_POWER_THRESHOLD_V21); then it gives no error. Why it behave such a way?
Also i don't get void POWER_CLOCK_IRQHandler(void) interrupt when my voltage goes below 2.1 V.
Thanks Bipin Patel