Hi, hoping someone can maybe give me a snippet of code or point out what I'm doing wrong in my watch dog timer code.
Here's what I did using Atmega88, internal 8MHz, GCC compiler... I want my processor to execute a small piece of code, sleep for 8 seconds, wake up, re-execute the same thing, sleep for 8 seconds, etc, (doing this for power considerations, code works fine with delays but I need to put the thing to sleep...)
WDTCSR |= (1<<WDE)|(1<<WDCE)|(1<<WDP3)|(1<<WDP0); //initialize a 8 second timeout/reset
[instructions to be repeatedly executed to transmit data points here]
SMCR |= 0b00000100;
SMCR |= 1<<SE;
It seems like the code stops executing after it sets the bits in the WDTCSR register but IDK.... How do I do what I want to do? What'd I do wrong? I read everything in the atmega88p datasheet, no help, All I know is that I need to set some bits to reset. My WDTON fuse is turned off as well.
I try not to ask too many questions on here unless I'm totally stumped so thanks guys...