This is what the code example above does.i need to do another function that basicly flashes a led on for 50ms then off again aprox every second.
If you need it to sleep longer just set the prescaler for the watchdog timeout period in WDTCON to 65536, then set the 2nd prescaler in OPTION_REG to 1:128.
Then it will sleep a lot longer, but it's not going to be able to blink your LED every 1 second. It will be sleeping for the entire 270 second period. If you need even longer, then you could let it sleep for ~270 seconds, wakeup, increment a variable, then go back to sleep.
Bookmarks