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.

Timing duration of a button press (Project Zero, CC2650)

Other Parts Discussed in Thread: BLE-STACK

I've been trying to figure out how to time a button press in project zero. At first I was trying to use the OSAL timer, until after some time I found a post that said this cannot be used with the CC26xx. Then I moved on to the Util Clock, which seems great for periodic interrupts, but there doesn't seem to be a way to query how long it has been running for.

If I can figure out the clocks/timers, my plan is to have an interrupt on both edges of the button pin, Start the timer on the rising edge, then stop it and read it on the falling edge. If it exceeds it's period then it will act based on the timer callback.

I'm really not sure what to do now or where else to look for the functionality I require. Could someone please point me in the right direction and give me some advice on how to achieve my goal? 

  • Hi Craig,

    If I understand what you are trying to do correctly, you should be able to find an example of what you want to do in the SensorTag project in the BLE-Stack V2.2.0. It makes a similar use of Util Clock to see how long a button is pressed for and then react accordingly.

    -Nathan