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

sample code for timer interrupt

Hi can i get an sample code for Timer interrupts. Since i am a beginner in interrupts.

Parents
  • Download nRF51_SDK_8.0.0\examples\peripheral\timer\main.c

    Timer initialization example nRF51_SDK_8.0.0\nRF51_SDK_8.0.0_5fc2c3a\examples\peripheral\timer\main.c nrf_drv_timer_init : Line 71

    to understand the Timer interrupt handler in the driver nRF51_SDK_8.0.0\nRF51_SDK_8.0.0_5fc2c3a\components\drivers_nrf\timer\nrf_drv_timer.c : TIMER0_IRQHandler : Line 281

Reply
  • Download nRF51_SDK_8.0.0\examples\peripheral\timer\main.c

    Timer initialization example nRF51_SDK_8.0.0\nRF51_SDK_8.0.0_5fc2c3a\examples\peripheral\timer\main.c nrf_drv_timer_init : Line 71

    to understand the Timer interrupt handler in the driver nRF51_SDK_8.0.0\nRF51_SDK_8.0.0_5fc2c3a\components\drivers_nrf\timer\nrf_drv_timer.c : TIMER0_IRQHandler : Line 281

Children
  • Hi, Aryan,

    Thank you for your response. I have learned timer_pca10028 example. When I try to graft the example to my code, the timer is behaving weird, the time interval is not the same as indicated but rather an uncontrolled infinite loop. Do you have clue about why this could happen?

    I am using SDK8.0.0 and SoftDevice S110 thus I change the timer_enable from timer0 to timer1 in nrf_config. Thanks in advance.

  • could you please open a new question with more details. What you do mean by behaving wierd? please explain in detail the behavior in a different question

  • Hi, Aryan, thanks for the reply. I have asked a question here. Please comment there if my words confuse you or you need any further information. Thanks.