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.

CC2540 use PM2 mode and Timer1 at the same time

Other Parts Discussed in Thread: CC2540

Hello all.

My application with CC2540 needs both PM2 low power mode and Timer1 operation. Timer1 should count up per 0.1msec.

But I think when CC2540 is under PM2, it cannot operate any 32MHz Oscillators.

So do you have any suggestions to use PM2 and Timer1 simultaneously?

  • This is not possible - if you want to use Timer 1, you need to be in active or idle mode.

    What do you need Timer 1 for? Are you sure you can't use the sleep timer instead?

  • Hello hec,

    Thank you for your prompt reply!

    I need Timer1 to measure the time, and it need an accuracy of 0.1msec.

    I have tried using Sleep timer instead of Timer1, but it didn't work well.

    To use Sleep timer, I changed OSAL_TIMERS_MAX_TIMEOUT value, and added some codes in the halSleepTimerIsr function.

    Are there anything wrong? Or do I need to do something else?

  • The sleep timer has sufficient accuracy (0.03 ms) for your needs, and you should use that.

    I do not know enough about OSAL to tell how you should do this in combination with the BLE stack running OSAL. Hopefully, one of my colleagues can help you with this. If you don't get any answers more here, try starting a new thread in this forum where you describe in a little more detail what you are trying to accomplish, what you did, and in what way it failed.

  • Hello hec,

    OK. I'll start a new thread and describe more detail.

    Thanks!