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.

CCS/TMS320F28069: Watchdog reset unexpectedly

Part Number: TMS320F28069

Tool/software: Code Composer Studio

I wanted to enable watchdog in my application. But the watchdog reset the CPU while executing a normal flow. I service dog in the end of loop but the counter reaches its max value in between. I tried to increase the prescaler (WDCR) but I cant see the same in register lookup while debugging. What is happening wrong?

void Watchdog_config (void)   
 {
     EALLOW;
     SysCtrlRegs.WDCR = 0x28;                                 // WRIValue write to enable modification
     SysCtrlRegs.WDCR |= 0X07;                                       //Watchdog prescaler
    SysCtrlRegs.WDKEY = 0x0055;
    SysCtrlRegs.WDKEY = 0x00AA;
    EDIS;
}

  

  • Hello,

    You'll need to combine the second and third lines of your function into a single write (WDCR = 0x0x2F). The WDCHK field of the WDCR register needs to be written with 101b every time you write to the register. The WDCHK register always reads back 0, so when you do the read-modify-write to change the prescaler, you end up writing a 0 to WDCHK which immediately sends a reset.

    Whitney