Hello Mou,
If an 18 hour period is sufficient, declare the variable as unsigned int. If you need more than this,
use an unsigned long variable.
Is the code you are using exactly the same as Wiresim provided, using a flag to indicate that stop mode should be re-entered?
If you happened to be re-entering stop mode from within the ISR, there would be a definite problem, as I Indicated earlier. In this case, the ISR code would be called recursively on each wakeup (since there would not be an exit from the previous ISR call), and eventually the stack would overflow. I wonder if this might be your problem.
It is necessary to exit the ISR before re-entering stop mode.
Regards,
Mac
Message Edited by bigmac on
2008-04-08 09:10 AM