Using the Watchdog Timer in XMC7000 family MCUs
Multi-counter WDT
Code Listing 2
Example program to configure MCWDT
Cy_GPIO_Inv(CYBSP_USER_LED1_PORT, CYBSP_USER_LED1_PIN);
}
if(MCWDT_INTR_MASKED_CTR1_INT_Msk & masked)
{
Cy_GPIO_Inv(CYBSP_USER_LED2_PORT, CYBSP_USER_LED2_PIN);
}
if(MCWDT_INTR_MASKED_CTR2_INT_Msk & masked)
{
Cy_GPIO_Inv(CYBSP_USER_LED3_PORT, CYBSP_USER_LED3_PIN);
}
Cy_MCWDT_ClearInterrupt(MCWDT_0_HW, masked);
}
3.8
Clearing the MCWDT
Clearing the MCWDT is performed by setting the CTR0_SERVICE[0] bit to '1' for Subcounter 0 and the
CTR1_SERVICE[1] bit to '1' for Subcounter 1. Both bits are located in the SERVICE register. The firmware must
consider reading the corresponding bit until it is '0' before it can be set to '1'.
Servicing of the MCWDT counter must be done regularly to ensure a stable software flow. Independent of
•
the software concept used, the runtime calculation of software components is crucial to define the limits of
the counter to be cleared. The window mode makes it even more complex because a minimum time period
needs to be determined before which the software is not expected to service the MCWDT. This minimum
period can be, for example, the minimum execution time of a low-priority main function, and it is relevant to
detect the abnormal situation such as the software continuously executing the MCWDT servicing routine
without any other code being executed.
The procedure is equal to the basic WDT in the window mode. See
•
when the watchdog counter can be cleared within a system with different tasks. The calculation of each
service moment must consider that in window mode, the clearing is not done before the counter reaches
the LOWER_LIMIT and must not reach the UPPER_LIMIT to avoid a FAULT and reset event.
3.8.1
Use case
This section describes an example of clearing the MCWDT using the use case discussed in
3.8.2
Example flow to clear the MCWDT
Figure 11
shows an example flow to clear the MCWDT.
Application Note
Figure 7
22 of 33
which shows an example of
3.7.1
Use case.
002-33887 Rev. *A
2022-05-25