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

  • 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.

Reply
  • 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.

Children
No Data
Related