- Any relation between both facts?But if WDT is enabled then LCD flickers every few milli seconds.
The problem was solved. I used Timer2 interrupt for 10 ms. The WDT was set to reset every 18 ms. Timer2 was made to clear WDT every 10 ms. So if microcontroller stucks and WDT is not cleared by timer2 and WDT resets then microcontroller resets.
e.g. the code execution is caught in an endless loop. In this case, the timer interrupt can be expected to continue and the WDT will never end the condition
Slow actions should be executed in a state machine that returns to the main loop while waiting for a timer to expire
The only problems I am facing is UART hangs sometimes and MCU hangs sometimes due to EMI. Now just tell me if using Timer interrupt to clear WDT works in these situations. According to me when there is an timer interrupt then PC jumps to ISR. So, if MCU is hanged due to EMI then if there is a timer interrupt which runs independently then PC has to jump to ISR but as program execution is hanged PC will not change and hence ISR will not get executed and hence WDT is not cleared and so WDT overflows and resets the micro-controller. Am I right?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?