This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to start and stop a timer in S110?

I use NRF51822 and s110. I want to know how to start and stop a timer, to get the time that the timer run. whitch API should I use int S110?

Parents
  • You can get current timer value by triggering CAPTURE task for any Capture/Compare register.

    NRF_TIMER2->TASKS_CAPTURE[1] = 1; // trigger TASKS_CAPTURE for Capture/Compare register 1.
    time = NRF_TIMER2->CC[1]; // Get current timer value
    
Reply
  • You can get current timer value by triggering CAPTURE task for any Capture/Compare register.

    NRF_TIMER2->TASKS_CAPTURE[1] = 1; // trigger TASKS_CAPTURE for Capture/Compare register 1.
    time = NRF_TIMER2->CC[1]; // Get current timer value
    
Children
Related