Hello,
kaes wrote:
I have a application that runs in high-power mode and also in low-power mode (in this case, STOP3 mode). To enter in STOP3 mode, STOP instruction must be executed. In STOP3 mode, the only code that is executed is the body of the RTI that is raised cyclically at 8 ms. It has as clock source the 1KHz clock, that also is input in the COP watchdog. In the ISR of the RTI the watchdog counter is not cleared, so I would expect that after a time period the watchdog will reset the MCU. But nothing happens, as the watchdog is disabled. But all the configuration registers are in good shape.
There does seem to be a little confusion about the operation of Stop 3 mode.
Whilst stop mode is active, no code is being executed as the bus clock is disabled. You appear to be using the RTI counter as a wakeup source, with a timeout period of 8 milliseconds. The wakeup process will restore the bus clock so that further code may continue to execute. The ISR code for the RTI, will immediately execute. When this has finished, the program counter will be located at the instruction immediately following the STOP instruction that caused Stop 3 mode to be entered. Normal operation of the MCU will then continue until a further STOP instruction is encountered.
Whether COP timeout occurs, or not, will depend on what occurs between the execution of successive STOP instructions.
For some MCU types (e.g MC9S08AW) the COP timer is explicitly not available as a wakeup source, which means that the COP timer has to be in a disabled state whilst Stop mode is active. It would just not make sense for the COP timer to continue to run, since there is no code execution to go haywire.
Regards,
Mac