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.

TMS320F28379D: Watchdog Timer

Part Number: TMS320F28379D

Hi,

About a month ago I have asked a question regarding the watchdog timer, but did not get a clear answer.

I have the below set registers. I have the watchdog timer disabled at first, then in SCSR the WDOVERRIDE is set to 0 and the watchdog interrupt is enabled. In this case is the watchdog timer disabled or enabled?

void InitWatchdog(void)
{
    asm(" EALLOW");                        // Enable EALLOW protected register access

//--- Disable the Watchdog Timer
    WdRegs.WDCR.all = 0x0068;
// bit 15-7      0's:    reserved
// bit 6         1:      WDDIS, 1=disable WD
// bit 5-3       101:    WDCHK, WD check bits, always write as 101b
// bit 2-0       000:    WDPS, WD prescale bits, 000: WDCLK=OSCCLK/512/1

//--- System and Control Register
    WdRegs.SCSR.all = 0x0000;
// bit 15-3      0's:    reserved
// bit 2         0:      WDINTS, WD interrupt status bit (read-only)
// bit 1         0:      WDENINT, 0=WD causes reset, 1=WD causes WDINT
// bit 0         0:      WDOVERRIDE, write 1 to disable disabling of the WD (clear-only)

    WdRegs.WDWCR.all = 0x0000;
// bit 15-9      0's:    reserved
// bit 8         0:      FIRSTKEY (read-only)
// bit 7-0       0x00:   MIN, minimum service interval - 0x00 is no minimum

    asm(" EDIS");                        // Disable EALLOW protected register access

//--- Enable the Watchdog interrupt
    PieCtrlRegs.PIEIER1.bit.INTx8 = 1;    // Enable WAKEINT (LPM/WD) in PIE group #1
    IER |= 0x0001;                        // Enable INT1 in IER to enable PIE group 1

} // end of InitWatchdog()

  • The way you have written your code, the WD is still disabled.

    WdRegs.WDCR.all = 0x0068;       // Disables WD

    WdRegs.SCSR.all = 0x0000;          // WD still remains disabled

    WdRegs.WDWCR.all = 0x0000;    // WD still remains disabled 

    Writing a 0 to WDOVERRIDE bit has no effect. See bit description in the TRM: If this bit is set to 1, the user is allowed to change the state of the Watchdog disable (WDDIS) bit in the Watchdog Control (WDCR) register. If the WDOVERRIDE bit is cleared, by writing a 1 the WDDIS bit cannot be modified by the user. Writing a 0 will have no effect. If this bit is cleared, then it will remain in this state until a reset occurs. The current state of this bit is readable by the user.

  • Great thanks sir. That was what I needed to know.