This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Use RTOS and xTimerCreate() ,Timer faster than the actual(SDK12,52832)

Timer for defining 20ms cycle:

// Create timers.
m_test_timer = xTimerCreate("TEST",
                               20,
                               pdTRUE,
                               NULL,
                              test_timeout_handler);

I found eight cycles, fast 6ms

Parents
  • Assuming you have the below optimum value for nRF port

    #define configTICK_RATE_HZ 1024

    The RTC will generate 1024 ticks a second which is 1/1024 = 0.976 ms per tick (little less than 1ms)

    xTimerCreate takes number of ticks as argument. So 20 means 20 RTOS ticks. One RTOS tick in our port is 0.976ms because we cannot generate an accurate 1ms tick using the RTC (as we cannot have non integral prescalar). So for 20 ticks you will get 20*0.9765 = 19.5ms.

Reply
  • Assuming you have the below optimum value for nRF port

    #define configTICK_RATE_HZ 1024

    The RTC will generate 1024 ticks a second which is 1/1024 = 0.976 ms per tick (little less than 1ms)

    xTimerCreate takes number of ticks as argument. So 20 means 20 RTOS ticks. One RTOS tick in our port is 0.976ms because we cannot generate an accurate 1ms tick using the RTC (as we cannot have non integral prescalar). So for 20 ticks you will get 20*0.9765 = 19.5ms.

Children
No Data
Related