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

nRF52 POFWARN issue

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

Parents
  • The error you are getting when you use NRF_POWER_THRESHOLD_V25 is a NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN error. It is happening because 2.5V is not a valid setting for the nRF52. The POFCON settings changed on the nRF52, although I don't see the defines updated in nrf_soc.h. Check out section 18.9.6 in the nRF52832_PS_v1.0. There are now more steps.

    Your interrupt is probably not firing because NRF_POWER_THRESHOLD_V21 is a 0. I'm surprised this didn't trigger an error as well.

Reply
  • The error you are getting when you use NRF_POWER_THRESHOLD_V25 is a NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN error. It is happening because 2.5V is not a valid setting for the nRF52. The POFCON settings changed on the nRF52, although I don't see the defines updated in nrf_soc.h. Check out section 18.9.6 in the nRF52832_PS_v1.0. There are now more steps.

    Your interrupt is probably not firing because NRF_POWER_THRESHOLD_V21 is a 0. I'm surprised this didn't trigger an error as well.

Children
No Data
Related