This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C2511: Why does T4 causes to exit PM2

Other Parts Discussed in Thread: CC2511

Dear forum,

I run with my code into the situation, that PM2 is not only exit due to sleep timer (as I want to), but also due to T4. I can reproduce this definitly with my code. When I set IEN1 = 0x00; which disables the T4 interrupt PM2 is exit after sleep timer expires only. When I set IEN1 = 0x10; which enables the  T4 interrupt PM2 is exit immediately! This is against the description in the datasheet which states that only the sleep timer or external port interrupts are able to exit PM2.

I tried to cut out the relevant code to be able to post them, but then I cannot reproduce then the effect anymore. So it seems to be a combination of other things or a timing issue.

What cirmumstances can cause the T4 will exit PM2? Sure I can simply disable the T4 interrupt before enterring PM, but I would like to understand the behaviour of the CC2511.

I found a sentence which I do not understand in the datasheet in chapter 12.1.3 "Power management control" pg. 74 which reads:

"Since an interrupt can occur before the device has actually entered PM{1 - 3}, it is necessary to clear the MODE bits before returning from all ISRs associated with interrupts that can be used to wake the device from PM{1 - 3}."

Probably this is a hint to my problem, but I do not know what I have to do to follow the recommendation.

 

Any comment to my problem is highly appreciated.

regards

spachner

  • spachner said:

    I run with my code into the situation, that PM2 is not only exit due to sleep timer (as I want to), but also due to T4. I can reproduce this definitly with my code. When I set IEN1 = 0x00; which disables the T4 interrupt PM2 is exit after sleep timer expires only. When I set IEN1 = 0x10; which enables the  T4 interrupt PM2 is exit immediately! This is against the description in the datasheet which states that only the sleep timer or external port interrupts are able to exit PM2.

    What cirmumstances can cause the T4 will exit PM2? Sure I can simply disable the T4 interrupt before enterring PM, but I would like to understand the behaviour of the CC2511.

    A comment in the datasheet on page 75 suggests "All interrupts not to be used to wake up from power modes must be disabled before setting SLEEP.MODE != 00."  There is a time between when the code would set SLEEP.MODE=PM{1-3} and setting PCON.IDLE=1 which interrupts could come in.
    It could be due to this timing window that you may be seeing an exit immediately.

    Do you know what the Timer 4 control and status registers are during this time?

     

    spachner said:

    I found a sentence which I do not understand in the datasheet in chapter 12.1.3 "Power management control" pg. 74 which reads:

    "Since an interrupt can occur before the device has actually entered PM{1 - 3}, it is necessary to clear the MODE bits before returning from all ISRs associated with interrupts that can be used to wake the device from PM{1 - 3}."

    Probably this is a hint to my problem, but I do not know what I have to do to follow the recommendation.

    I believe the various interrupt service routines associated with interrupts that can wake the processor should include SLEEP.MODE=00.

  • Hi Spachner.

    Brandon is partly right, but the window is actually longer than that. There is actually a small window after the PCON.IDLE bit is set that where a T4 interrupt will prevent the device from entering PM2.
    The safest workaround is to disable all interrupts except those used to wake the device prior to setting PCON.IDLE. 

    When the sleep.mode bits are different from 0, sleeptimer interrupts are dusabled. This however takes three clock cycles which is why you need the three NOPs in the code between setting sleep.mode bits and setting pcon.idle. To catch interrupt occuring in these three clock cycles it is recommended to clear the mode bits in the assosiated ISRs.

    Please also note that there is a errata note on the CC2511 and use of power modes. This comes with code as well,

    http://www.ti.com/litv/pdf/swrz014c

    Rgds,

    Kjetil