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

Using timer how to make 5 sec delay in pca10040 board?

Hi,

I am using pca10040 board. i need to toggle a led in 5sec once. I tried to change the prescale value. But im not able to get that much time delay.

Can any one help me on this?

Parents
  • You can use shorts:

    NRF_TIMER2->SHORTS = (TIMER_SHORTS_COMPARE0_CLEAR_Enabled << TIMER_SHORTS_COMPARE0_CLEAR_Pos);
    

    This will clear the timer counter value on CC[0] compare. If not doing this the timer will count to the maximum value before it overflows.

Reply
  • You can use shorts:

    NRF_TIMER2->SHORTS = (TIMER_SHORTS_COMPARE0_CLEAR_Enabled << TIMER_SHORTS_COMPARE0_CLEAR_Pos);
    

    This will clear the timer counter value on CC[0] compare. If not doing this the timer will count to the maximum value before it overflows.

Children
Related