您好,
我用 driverlib的示例测试了看门狗,现在系统重置太快,无法对设备重新编程。 我们如何从这种情况中恢复?
下面是示例代码。 它每250毫秒重置一个位置,根据负载值,我发现这是奇怪的。 CPU以120MHz运行。
//
// Enable the Watchdog 0 peripheral
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG0);
//
// Wait for the Watchdog 0 module to be ready.
//
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_WDOG0))
{
}
//
// Check to see if the registers are locked, and if so, unlock them.
//
if(WatchdogLockState(WATCHDOG0_BASE) == true)
{
WatchdogUnlock(WATCHDOG0_BASE);
}
//
// Initialize the watchdog timer.
//
WatchdogReloadSet(WATCHDOG0_BASE, 0xFEEFEE);
//
// Enable the reset.
//
WatchdogResetEnable(WATCHDOG0_BASE);
//
// Enable the watchdog timer.
//
WatchdogEnable(WATCHDOG0_BASE);
//
// Wait for the reset to occur.
//
while(1)
{
}
此致,
-Mike