TI中文支持网
TI专业的中文技术问题搜集分享网站

系统时钟与WDG1同时钟域,依然需要等待?

系统时钟与WDG1同时钟域,依然需要等待?

ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG0);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG1);

/* Running at 16MHz == PIOSC */
if(ROM_WatchdogLockState(WATCHDOG1_BASE) == true)
{
ROM_WatchdogUnlock(WATCHDOG1_BASE);
}

ROM_WatchdogReloadSet(WATCHDOG1_BASE, ROM_SysCtlClockGet());
ROM_WatchdogResetEnable(WATCHDOG1_BASE);
ROM_WatchdogStallEnable(WATCHDOG1_BASE);
WatchdogIntRegister(WATCHDOG1_BASE,WatchdogB_IntHandler);
ROM_WatchdogIntTypeSet(WATCHDOG1_BASE,WATCHDOG_INT_TYPE_INT);
ROM_WatchdogIntEnable(WATCHDOG1_BASE);
ROM_WatchdogEnable(WATCHDOG1_BASE);
ROM_WatchdogLock(WATCHDOG1_BASE);

/* Running at 80MHz == PLL/2.5 */
ROM_SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_16MHZ);

if(ROM_WatchdogLockState(WATCHDOG0_BASE) == true)
{
ROM_WatchdogUnlock(WATCHDOG0_BASE);
}
ROM_WatchdogReloadSet(WATCHDOG0_BASE, ROM_SysCtlClockGet());
ROM_WatchdogResetEnable(WATCHDOG0_BASE);
ROM_WatchdogStallEnable(WATCHDOG0_BASE);
WatchdogIntRegister(WATCHDOG0_BASE,WatchdogA_IntHandler);
ROM_WatchdogIntTypeSet(WATCHDOG0_BASE,WATCHDOG_INT_TYPE_INT);
ROM_WatchdogIntEnable(WATCHDOG0_BASE);
ROM_WatchdogEnable(WATCHDOG0_BASE);
ROM_WatchdogLock(WATCHDOG0_BASE);

上半配置单独运行不能过,下半配置单独运行没问题.为什么呢?仿真也不能读取WDG1的寄存器.另外ROM里缺失了WatchdogIntRegister函数吗?

xyz549040622:

仿真的时候,应该是不能开狗的吧。

JingQuan Li:

回复 xyz549040622:

WDG0都能仿真,WDG1为什么不能呢.

赞(0)
未经允许不得转载:TI中文支持网 » 系统时钟与WDG1同时钟域,依然需要等待?
分享到: 更多 (0)