-
Hi! TBH, it is very difficult to troubleshoot this, at least to me, so if anyone have an idea what to do, I'd be very happy. :-) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I'm not 100% sure how to answer your question, or perhaps to address your underlying concern. The AVR ATmega Watchdog Timer (WDT) is a simple counter that can be configured on roll-over to a) reset the MCU, b) trigger an interrupt, c) trigger and interrupt and if the interrupt is unserviced reset the MCU on the next counter roll-over. The counter is incremented by an integrated oscillator, independent of any other oscillators in the MCU, which runs at nominally 128kHz. In Arduino FreeRTOS the WDT is configured to firstly interrupt at roll-over and then at the second roll-over then reset the MCU. If you keep the global interrupt disabled for extended times then you will find that your MCU is resetting, but really 15ms + 15ms at 16MHz is a very long time. There are issue and issue here on the Arduino delay function, and the FreeRTOS delay function. Perhaps they will cast some light on the question for you too? |
Beta Was this translation helpful? Give feedback.
-
@feilipu Either way I will have to see if I can work around it, somehow. Thanks for your help! (Background is that I try to run the same code on ESP32, Linux and Arduino aswell...just because that is even messier. :-) ) |
Beta Was this translation helpful? Give feedback.
I'm not 100% sure how to answer your question, or perhaps to address your underlying concern.
The AVR ATmega Watchdog Timer (WDT) is a simple counter that can be configured on roll-over to a) reset the MCU, b) trigger an interrupt, c) trigger and interrupt and if the interrupt is unserviced reset the MCU on the next counter roll-over. The counter is incremented by an integrated oscillator, independent of any other oscillators in the MCU, which runs at nominally 128kHz.
In Arduino FreeRTOS the WDT is configured to firstly interrupt at roll-over and then at the second roll-over then reset the MCU. If you keep the global interrupt disabled for extended times then you will find that your MCU …