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.

TMS320F28035: Watchdog interrupt

Part Number: TMS320F28035


I have a tricky bug that is not reproducible in a larger project.
The reset source is a watchdog reset.

I have seen in the user guide (page: 87) that I can configure the watchdog to call an interrupt and not just perform a reset. I would like to use this to analyse the stack to perhaps get an idea of where the problem is.

I have inserted the line in the init routine for this:

SysCtrlRegister.SCSR.AsWord = 0x02; //  Items.WD_ENINT = 1; // enable Watchdog interrupt

static void InitWatchDog(void)
{
  EALLOW();

  // Setup WatchDog
  // set check bits and set prescale to max, set disable to 0 (enable watchdog),
  // keep WDFLAG bit as is
  // Watchdog period is set to Oscillator Cycletime (10MHz, 100nsec) * 512 * 64 * 256
  //                          = 100 nsec * 512 * 64 * 256 = 851.97 msec
  // 512: osc divide, 64: wd prescaler (max, used here), 256: 8-bit WD counter, 6: PLL multiplier (WD runs at ext. Clk rate)
  // -> WD decrements every 512*64*6 = 32768*6 = 196608 cycles
  Watchdog.WDCR.AsWord = (WDCHK_MASK | WDPS_512_64);
  SysCtrlRegister.SCSR.AsWord = 0x02; //  Items.WD_ENINT = 1; // enable Watchdog interrupt
  EDIS();
}

The debugger shows the value 0x07 for SYSCTRL.SCSR, which seems to be correct.

For testing the interrupt, i call an method with infinte loop after some secs. 

But now nothing happed, not even a reset.

i checked every ISR (also NOTUSED and NMI_ISR), but non of them is called.

I think I'm missing some enable, but I don't know which one

Please help. Thanks

  • Hi ,

    This looks like a problem with the Watchdog ISR setup.

    Did you enable the interrupt in interrupt controller that you want to get triggered by watchdog interrupt. If you have any other Interrupts working in your example please check if the configuration is done correctly

    Thanks!

  • I have also set up the corresponding defines,

    [DSP2803x_SWPrioritisedIsrLevels.h]

    #define INT1PL 1 // Group1 Interrupts (PIEIER1)
    [...]
    #define G18PL 1//5 // WAKEINT (WD/LPM)

    and also define the interrupt
    interrupt void WAKEINT_ISR(void) // WD/LPM
    {
    [...]
    }

    but I neglected to enable the interrupt in the setup method in main... (wasn't my best day yesterday)

    Thanks for the quick answer

    (closed)