Question

I use PIC18F6622 and PICC compiler.

I use the Watch Dog Timer to regularly wake from sleep mode. The data sheet states that watch dog fire during power-managed modes exits the mode and usually it works just fine.

However, sometimes I see an unexpected reset. Using PICC's reset_cause() I found that the reason is WDT_FROM_SLEEP. What does that mean? Why is it causing a reset instead of wake-up??

Thanks a lot,

Lkanab.

Was it helpful?

Solution

An interrupt event may have woken the PIC up, then the WDT probably overflowed during run mode, which would cause a watchdog reset.

OTHER TIPS

You are entering your MCPU into SLEEP mode. In this mode the MCPU wait on event to wake-up form sleep. You didn't explain what kind of events/interrupts are enabled before your program go into SLEEP mode. Let say if you are waiting on OnPinChange (EEPROM write, ADC conversion ...) event and that is never heppend (or to late) so the Watch Dog time expire and reset the MCPU.

One solution: try to increase the Watch Dog Timer time interval.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top