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.

CCS/TM4C123GH6PM: TM4C123GH6PM

Part Number: TM4C123GH6PM
Other Parts Discussed in Thread: EK-TM4C123GXL

Tool/software: Code Composer Studio

Hi all,

       I am working on  TM4C123GH6PM board. In watchdog timer , the processor reset the board with particulator time value . At the same time , need to kick the dog ( restart the watchdog timer) from processor.

I am using below highlighted API for restart the watchdog . Is this correct ??

void watchdog(void)
{
/* Enable the peripherals used by this example. */
SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG0);

/* Set the period of the watchdog timer. */
WatchdogReloadSet(WATCHDOG0_BASE, SysCtlClockGet());

/* Enable reset generation from the watchdog timer. */
WatchdogResetEnable(WATCHDOG0_BASE);

/* Enable the watchdog timer. */
WatchdogEnable(WATCHDOG0_BASE);
}

int main(void)
{
watchdog();

while(1)

 {

                WatchdogReloadSet(WATCHDOG0_BASE, load value);                       /* Restart watchdog from processor */

                /* Another task in general */

                WatchdogIntClear(WATCHDOG0_BASE);

  }

 

Thanks in advance,

sankari.

  • Hello Sankari,

    That is not a proper way to use the Watchdog timer. You will want to use an interrupt to service the Watchdog.

    Have a look at the Watchdog example project in TivaWare for the correct usage with an interrupt service routine. You can find it at [Install Path]\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c123gxl\watchdog

    Have a look through that and let me know if you have any questions about the implementation.