Re: Pic24fj128ga406 Deep sleep not working
When exiting deep sleep, execution resumes at the reset vector.
Not at the next instruction after sleep instruction, or at the INT0 vector.
In your code, you check RCON/RCON2 bits after Sleep(), but this code will never execute. Instead you should probably do this right after reset. DSWAKE register may also be useful, if you want to know reason for wakeup.