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

APP_TIMER_TICKS problem

I want to convert APP_TIMER_TICKS ms to us.

So i'm using this function.

#define APP_TIMER_MIN_TIMEOUT_TICKS     33                    /**< Minimum value of the timeout_ticks parameter of app_timer_start(). */

#define APP_TIMER_TICKS_US(US)                             \
            ((uint32_t)ROUNDED_DIV(                        \
            (US) * (uint64_t)APP_TIMER_CLOCK_FREQ,         \
            1000000 * (APP_TIMER_CONFIG_RTC_FREQUENCY + 1)))

And, the value of APP_TIMER_CONFIG_RTC_FREQUENCY is

// <o> APP_TIMER_CONFIG_RTC_FREQUENCY  - Configure RTC prescaler.
 
// <0=> 32768 Hz 
// <1=> 16384 Hz 
// <3=> 8192 Hz 
// <7=> 4096 Hz 
// <15=> 2048 Hz 
// <31=> 1024 Hz 

#ifndef APP_TIMER_CONFIG_RTC_FREQUENCY
#define APP_TIMER_CONFIG_RTC_FREQUENCY 1
#endif

Also this is main code.

		//start timer
		uint32_t err_code = app_timer_create(&m_user_app_tmr, APP_TIMER_MODE_REPEATED,user_app_timer_handler);
	
		err_code = app_timer_start(m_user_app_tmr, APP_TIMER_TICKS_US(100), NULL);
	  APP_ERROR_CHECK(err_code);

And, I want to timer period 100us(0.1ms).

I tried to modify APP_TIMER_MIN_TIMEOUT_TICKS, but it was not working.

How to I solve this problem>?

Thanks

Parents Reply Children
No Data
Related