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.

TMS320F28335: WDT Software Reset Problem

Part Number: TMS320F28335
Other Parts Discussed in Thread: C2000WARE

Hi, I tried to write a code block that whenever software hits that code block, program is going to be soft reset and program counter will start from top of main function.

Here is the code block :

EALLOW;
SysCtrlRegs.SCSR = BIT1;
EDIS;

EALLOW;
SysCtrlRegs.WDCR = 0x0020; //Enables Watchdog and triggers software watchdog due to the [3:5] bit are different than 1-0-1 sequence.
EDIS;

/*The code below is also triggers softreset.*/

EALLOW;
SysCtrlRegs.WDKEY = 0x0011;
SysCtrlRegs.WDKEY = 0x0000;
EDIS;

In debug mode, program is going on performing afterwards and never triggers the reset.

  • HI, 

    Have you taken a look at the watchdog example provided in C2000ware example?

    Do note in Table 1- 29  Watchdog Reset Key Register (WDKEY) Field Descriptions the only valid values are 0xAA and 0x55.

    Writing any value other than 0x55 or 0xAA causes no action to be generated. If any value other than 0xAA is written after 0x55, then the sequence must restart with 0x55.

    Please read the chapter 1.3.4 Watchdog Block in SPRUI07 for more information on how to use the watchdog.

    Regards,

    Ozino

  • I just understood as If I write any value except than 0x55- 0xAA key sequence, Reset sequence will be performed.

  • What the statement means is that any other value written besides x55 and xAA there will be no action generated.

    Writing 0x55 followed by 0xAA to WDKEY causes the WDCNTR bits to be cleared.

  • Writing 0 to WDCR will cause an immediate watchdog reset.

  • Stephen if you read the register description for the WDCR register in Table 1-30 you will notice that writes to WDCHK bits (5-3) must be 1,0,1 or else writing any other value causes an immediate device reset or watchdog interrupt to be taken. Note that this will happen even if the watchdog module is disabled. These three bits always read back as zero (0, 0, 0). This feature can be used to generate a software reset of the DSP.

    If you need sample code I strongly recommend taking a look at the watchdog examples provided in C2000Ware.