• AVR Freaks

Hot!Pic24fj128ga406 Deep sleep not working

Author
vd
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2015/08/16 10:33:13
  • Location: 0
  • Status: offline
2020/06/24 21:05:08 (permalink)
0

Pic24fj128ga406 Deep sleep not working

Respected All,
I am using pic24fj128ga406 controller.
I face problem pic controller not wake after deep sleep with INT0 external interrupt.
In normal i get INT0 interrupt but to wake from deep sleep it not work.
Please suggest solution & if i miss any configuration.
Waiting for valuable reply.
Below is my code
DSWAKE = 0;
RCONbits.DPSLP = 0;
DSWAKEbits.DSINT0 = 1;
DSWAKEbits.DSMCLR = 1;
DSCONbits.WAKEDIS = 0;
EX_INT0_InterruptEnable(); 
DSCONbits.DSEN = 1;
Nop();
Nop();
Nop();
Nop();
Nop();
DSCONbits.DSEN = 1;
Sleep();
if(RCONbits.DPSLP)
{
RCONbits.DPSLP = 0;
}
DSCONbits.DSEN = 0;
RCON2 = 0;
RCONbits.DPSLP = 0;
#1

1 Reply Related Threads

    mbrinks
    Starting Member
    • Total Posts : 13
    • Reward points : 0
    • Joined: 2011/05/03 04:57:32
    • Location: Denmark
    • Status: offline
    Re: Pic24fj128ga406 Deep sleep not working 2020/07/09 07:03:12 (permalink)
    4 (1)
    Hello vd
     
    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.
     
    Best Regards,
    Michael
    #2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5