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

POFWARN Example ?

nRF51822

I'm interested in setting up the the POFCON to enable me to get a POFWARN interrupt when the battery voltage drops below 2.7V.

The softdevice is enabled at the time of these calls.

The first two calls are fine - (pof_enable and pof_threshold). But the ClearPending causes an App_Error - err_code = 0x2001 which looks to be an SoC error / SVC handler missing.

err_code = sd_power_pof_enable(POWER_POFCON_POF_Enabled);
APP_ERROR_CHECK(err_code);

err_code = sd_power_pof_threshold_set(POWER_POFCON_THRESHOLD_V27);
APP_ERROR_CHECK(err_code);
	
err_code = sd_nvic_ClearPendingIRQ(POWER_CLOCK_IRQn);
APP_ERROR_CHECK(err_code);

err_code = sd_nvic_SetPriority(POWER_CLOCK_IRQn, NRF_APP_PRIORITY_HIGH);
APP_ERROR_CHECK(err_code);

err_code = sd_nvic_EnableIRQ(POWER_CLOCK_IRQn);
APP_ERROR_CHECK(err_code);

I have defined the POWER_CLOCK_INT Handler as below ...

void POWER_CLOCK_IRQHandler() { LEDState(BLUE_1SEC_BLINK); }

Any suggestions on what I may be doing wrong - or examples that I could reference ?

Thanks ! -Tim

Parents Reply Children
No Data
Related