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.

Compiler/F28M35H52C: programming the c28 WDT

Part Number: F28M35H52C


Tool/software: TI C/C++ Compiler

Do you have an example of how to program the C28 WDT?

Thanks,

Pat

  • Are you referring to the NMI watchdog on the C28? No, we don't have an example for it. Are you having trouble configuring it?

    Whitney

  • Yes, can you give me some guidance. Thanks

    Pat

  • For a general demonstration of the functionality, you could put something like this in main() (I just modified the blinky example to start):

        // Register an NMI ISR
        EALLOW;
        PieVectTable.NMI = &nmisr;
        EDIS;
        
        // Enabled the NMI and force the CLOCKFAIL flag to trigger an NMI.
        // NMI appears to be already enabled, but I'll set the bit again just in case.
        EALLOW;
        NmiIntruptRegs.NMICFG.bit.NMIEN = 1;
        NmiIntruptRegs.NMIFLGFRC.all = 0x0002;
        EDIS;

    And then in the ISR you clear the flag (or not if you want to see the reset):

    __interrupt void nmisr()
    {
        // Clear the CLOCKFAIL flag and the NMI flag to stop the counter.
        // Comment out the clearing of the flag to observe a reset of the C28.
        EALLOW;
        NmiIntruptRegs.NMIFLGCLR.all = 0x0003;
        EDIS;
    }

    Was there something in particular that you were having trouble with?

    Whitney