标签:
nRF9E5 Watchdog 看门狗
void CLRWDT(void)//初始化及喂狗
{
while ((REGX_CTRL & 0x10));
REGX_MSB = 0x0f;
REGX_LSB = 0xff; //看门狗定时值
REGX_CTRL = 0x08; //写入看门狗
}
--------------------------------------------------------------------------------------------------


16.5 Watchdog
The watchdog is activated on the first write to its control register SFR 0xAD. It can not be disabled by any other means than a reset. The watchdog register is loaded by writing a 16-bit value to the two 8-bit data registers (SFR 0xAB and 0xAC) and then the writing the correct opcode to the control register. The watchdog will then count down towards 0 and when 0 is reached the complete microcontroller will be reset To avoid the reset, the software must load new values into the watchdog register sufficiently often.
16.6 Programming Interface to Watchdog and Wakeup Functions
RTC timer GPIO wakeup and Watchdog are controlled via SFRs 0xAB, 0xAC and 0xAD.Typical sequences are:
Write: Wait until REGX_CRTL.4 == 0 (i.e. not busy)
Write REGX_MSB, Write REGX_LSB, Write REGX_CTRL
Read: Wait until REGX_CRTL.4 == 0 (i.e. not busy)
Write REGX_CTRL, Wait until REGX_CRTL.4 == 0 (i.e. not busy)
Read REGX_MSB, Read REGX_LSB
系统分类:
单片机 | 用户分类:
嵌入式系统开发 | 来源:
整理 | 【推荐给朋友】 | 【添加到收藏夹】