Quote Originally Posted by flotulopex View Post
Thank you Skimask,

I have now put a "SLEEP 10" command in my main loop to make some tests.

When I change the prescaler values in OPTION_REG, nothing changes; the SLEEP time stays around 10 seconds.

When I now activate the WDTCON register (with OPTION_REG) and put the prescaler to 1:32, my LED blinks almost every half second. Setting the rate at 1:64 doubles the 'pause' delay.

A.- Why is the prescaler in OPTION_REG not affecting the SLEEP time?

B.- According to all datasheets, it is not reliable to use WDT since the time may vary in an important scale. What is then the best way to make long delays with the PIC?
a) not sure, my best guess is that PBP handles it for you behind the scenes. Check your .lst file to see what's really happening.

b) WDT has about +/- 15% tolerance on the clock. If you want 15 minutes, you'll get between 12m45s to 17m15s, generally you'll usually be a lot closer than that. See Section 15.13.1, use Timer1 with an external crystal (2 crystals total, one for PIC, one for Timer1), but that option uses a bit more power.