请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:TMS320F280049C 工具与软件:
TI的专家您好!μ A
最近在TMS320F280049C中配置看门狗的超时复位后、但一直没有生效。μ A
代码如下、麻烦帮忙看下是哪里出了问题?谢谢了!μ A
void Watchdog_Init(void)
{
//请参考技术手册216页对看门狗的详细说明
//超时时间计算:256*64 / INTOSC1(10MHz) * 512 = 0.8388608秒
WdRegs.WDCR.bit.WDCHK = 0x5;
WdRegs.WDCR.bit.WDPRECLKDIV = 15;//Watchdog Clock Pre-divider = 256
WdRegs.WDCR.bit.WDPS=7;//Watchdog Clock Prescaler = 64
//
// Connect the watchdog to the WAKEINT interrupt of the PIE
// Write to the whole SCSR register to avoid clearing WDOVERRIDE bit
//
EALLOW;
WdRegs.SCSR.bit.WDOVERRIDE =1;
WdRegs.SCSR.bit.WDENINT = 0;//to trigger a reset
EDIS;
//
// Enable the watchdog
//
EALLOW;
//WdRegs.WDCR.all = 0x0028;
WdRegs.WDCR.bit.WDDIS = 0;
EDIS;
//
// Enable WAKEINT in the PIE: Group 1 interrupt 8
// Enable INT1 which is connected to WAKEINT:
//
//PieCtrlRegs.PIECTRL.bit.ENPIE = 1; // Enable the PIE block
//PieCtrlRegs.PIEIER1.bit.INTx8 = 1; // Enable PIE Group 1 INT8
//IER |= M_INT1; // Enable CPU INT1
//EINT; // Enable Global Interrupts
//
// Reset the watchdog counter
//
ServiceDog();
}