Could anyone share with me an example for how to refresh watchdog please ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Could anyone share with me an example for how to refresh watchdog please ?

447 Views
mohammedaboelna
Contributor III

I need to implement APIs related to watchdog timer.

I could not find any notes or examples on the site.

Could you share please ?

Thanks in advance.

0 Kudos
1 Reply

361 Views
mjbcswitzerland
Specialist V

Hi

There are different watchdog types in the Kintis parts but this is how the majority of M4 based ones can be retriggered:

    if ((WDOG_STCTRLH & WDOG_STCTRLH_WDOGEN) != 0) {// if watchdog is enabled
        uDisable_Interrupt();                       // protect the refresh sequence from interrupts
            WDOG_REFRESH = WDOG_REFRESH_SEQUENCE_1;
            WDOG_REFRESH = WDOG_REFRESH_SEQUENCE_2;
            WDOG_TMROUTH = 0;
            WDOG_TMROUTL = 0;       // this sequence must be performed within 20 bus cycles (it should be protected against interrupts disturbing it)

        uEnable_Interrupt();
    }

Regards

Mark

0 Kudos