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.

Accurate timing using OSAL on CC2540

Other Parts Discussed in Thread: CC2540

For a project that uses the CC2540, I need to perform ADC conversions periodically (every 4ms). It doesn't matter if there is some jitter in the time between conversions as long as it averages out to 4ms (+/- 10us).

I could use one of the available timers to generate a periodic interrupt to achieve this but that would prevent me from entering a low power mode between conversions so ideally I would like to use the OSAL ( which users the 32.768kHz sleep timer) to schedule a periodic task (every 4ms) but am not sure if it is possible to get the accuracy I require using this method as the BLE stack obviously has highest priority.

Can anyone tell me if what I want to do is feasible using the OSAL to schedule the task?

  • I don't know if I'm right but, anyway, if you use the OSAL timer, the stack will not enter the PM3 neither, because every time is going to have an OSAL event (if I have understood well you will program them to be done each 4 milliseconds) to attend.

    So I would do this with the timer 1 or 3 interrupts. Am I right, TI folks?

     

    PS: and I would not use the OSAL timer (the 2nd one) for ANYTHING that includes a continuous or cyclic action since I've suffered from severe time inconsistences when doing so. It is used for several things in the stack so avoid it if you can.