This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280049C: 看门狗复位功能不起作用

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE

TI的专家您好!

最近在TMS320F280049C中配置看门狗的超时复位后,但一直没有生效。

代码如下,麻烦帮忙看下是哪里出了问题?谢谢了!

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();
}