Application Note
24 of 33
002-33887 Rev. *A
2022-05-25
Using the Watchdog Timer in XMC7000 family MCUs
Multi-counter WDT
3.8.3
Example program to clear the MCWDT
shows an example program to clear the MCWDT.
Code Listing 3
Example program to clear the MCWDT
int main(void)
{
:
for(;;)
{
Cy_MCWDT_Unlock(MCWDT_0_HW);
Cy_MCWDT_ResetCounters(MCWDT_0_HW, CY_MCWDT_CTR0, 0u);
Cy_MCWDT_Lock(MCWDT_0_HW);
}
}
3.9
MCWDT fault handling
The four faults are combined into a single fault report. This report includes the data of which fault is triggered,
so the fault handler can record the correct fault cause. Different MCWDT instances have independent fault
reports, so they can be handled by different processors.
The initialization of fault reporting is shown in
. As an example, Fault structure 1 is
used.
For details of the fault setting procedure, see the “Fault Report Structure” section in AN2
34226 listed in
The fault is handled within a FAULT report handler. The MCWDT provides the following four FAULT sources:
•
Lower limit Fault Subcounter 0
•
Upper limit Fault Subcounter 0
•
Lower limit Fault Subcounter 1
•
Upper limit Fault Subcounter 1
The Fault status can be read from the related Fault structure.
3.9.1
Use case
This section describes an example of the MCWDT fault handling using the use case discussed in