This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

LE1 cann't enter interrupt function after RTC wake up

Hi all

I get LE1 enter sleep mode(PWRDWN = 0x04;)and use RTC to wake up,but LE1 cann't enter interrupt function after RTC wake up.

If I just use RTC to run ,LE1 can generate interrupt normally.

Anyone give me some advice?Thank you very much!

Attachment is my test code.

RTC wake up.rar

Parents
  • Hi,

    The RTC will first wakeup on a pre-start time (see page 97 in the datasheet) to make sure that the clock sources are running.

    Add this to your main while loop:

    
            LED3=!LED3;
            PWRDWN = 4;
            PWRDWN = 0;
            // Device will wake up on pre-TICK. Set to STANDBY until actually TICK occurs.
            // If this next line is commented out, Race condition will occur: the device will go into REG_RET without running the TICK routine!
            PWRDWN = 7;
            PWRDWN = 0;
    

    Note: Theres no need to init the RTC again in the while loop, as you've already init'ed it before going into the while loop.

    Best regards Håkon

Reply
  • Hi,

    The RTC will first wakeup on a pre-start time (see page 97 in the datasheet) to make sure that the clock sources are running.

    Add this to your main while loop:

    
            LED3=!LED3;
            PWRDWN = 4;
            PWRDWN = 0;
            // Device will wake up on pre-TICK. Set to STANDBY until actually TICK occurs.
            // If this next line is commented out, Race condition will occur: the device will go into REG_RET without running the TICK routine!
            PWRDWN = 7;
            PWRDWN = 0;
    

    Note: Theres no need to init the RTC again in the while loop, as you've already init'ed it before going into the while loop.

    Best regards Håkon

Children
No Data
Related