Nordic NRF51 POF 电压失效比较器

Power-fail comparator

The power-fail comparator (POF) can provide the CPU with an early warning of impending power failure. It will not reset the system, but give the CPU time to prepare for an orderly power-down.
The comparator features a hysteresis of VHYST, as illustrated in Figure 4. The threshold VPOF is set in register POFCON. If the POF is enabled and the supply voltage falls below VPOF, the POFWARN event will be generated. This event will also be generated if the supply voltage is already below VPOF at the time the POF is enabled, or if VPOF is re-configured to a level above the supply voltage.
If power-fail warning is enabled and the supply voltage is below VPOF the power-fail comparator will prevent the NVMC from performing write operations to the NVM. See NVMC — Non-volatile memory controller for more information about the NVMC.
Figure 4. Power-fail comparator (BOR = Brownout reset)

To save power, the power-fail comparator is not active in System OFF or in System ON when HFCLK is not running.

Does the NRF51822 support BOD (Brown-Out Detection) interrupt? Or is there a power-down holding register?
https://devzone.nordicsemi.com/f/nordic-q-a/46460/does-the-nrf51822-support-bod-brown-out-detection-interrupt-or-is-there-a-power-down-holding-register

Power-fail comparator
https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fpower.html&cp=3_1_0_17_3&anchor=unique_1736318573

POFWARN Example?
https://devzone.nordicsemi.com/f/nordic-q-a/2218/pofwarn-example/9361?focus=true#9362

代码实现

// 初始化配置
// enable pof
err_code = sd_power_pof_enable(POWER_POFCON_POF_Enabled);
APP_ERROR_CHECK(err_code);
// pof event is triggered in 2.1v
err_code = sd_power_pof_threshold_set(POWER_POFCON_THRESHOLD_V21);
APP_ERROR_CHECK(err_code);
// 添加事件回调处理
static void sys_evt_dispatch(uint32_t sys_evt)
{
	Motor_PowerEventHandler(sys_evt);
}
// 处理事件
void Motor_PowerEventHandler(uint32_t sys_evt)
{
	switch(sys_evt)
	{
		case NRF_EVT_POWER_FAILURE_WARNING:
		{
			NRF_LOG_PRINTF("[NRF_EVT_POWER_FAILURE_WARNING]\r\n");
			// disable pof
			// sd_power_pof_enable(POWER_POFCON_POF_Disabled);
		}break;
		default:
		{
		}break;
	}
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值