Sorry for the inconvenience happened to you!!
When the WDT timer mode is configured as Watchdog(w/interrupt) [ PSoC Creator ,.cydwr file-> Clocks tab-> Edit Clock-> Low frequency Clock-> Timer0 Mode] and the WDT interrupt is not cleared, then the WDT interrupt will generate continuously at every LFCLK cycle.
So when we select a 32 bit variable (uint32 interruptCnt) it increments upto =< 2^32 in 0.5*3 seconds( WDT interrupt interval) . Means the condition "if (interruptCnt <= LED_BLINK_5_TIMES)" will not satisfy after uint32 interruptCnt=10 and WDT interrupt will not clear in 0.5*3=1.5 seconds and device will reset.
But when we select a 16 bit variable (uint16 interruptCnt) it increments upto =< 2^16 in 0.5*3 seconds( WDT interrupt interval) and it might overflow and the condition "if (interruptCnt <= LED_BLINK_5_TIMES)" will satisfy after uint16 interruptCnt<=10 again in 1.5 seconds and WDT interrupt will clear in 0.5*3=1.5 seconds and device will not reset which is happening here.
To overcome this problem you can disable the WdtIsr after interruptCnt==11.
Please find the attached modified project attached with this response.
Thank you for reply Gyan but I didn't understand your explanation.
1 of 1 people found this helpful
Hope the project worked fine for you.
" When the variable is declared as uint8 , it overflows and becomes '0' within the period (0.5*3) and when it becomes '0' the LED blink condition also becomes true,and it will continuously blinks rather the interrupt causing system 'RESET' ".