Minimum period for MQX Timer

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Minimum period for MQX Timer

4,469 次查看
JaimeR
Contributor III
What's the minimum period suggested for a periodic MQX Timer?
6 回复数

2,401 次查看
Jairo
Contributor III
The minimum timer interval is 1 tick, and it's equivalent to 5ms

2,401 次查看
bistrulli
Contributor I

is it possible to set periodic timer with period less then 5ms?

0 项奖励
回复

2,401 次查看
Kyle_Apollo
Contributor II

We got it down to 1 tick = 1mS, by modifying the BSP_tick_frequency in the BSP (dont hold me to that exact name, but it is something to that effect).  By changing it from 200 (default) to 1000, you increase your resolution 5 fold.  To get uS resolution, you have to bypass MQX and use hardware interrupts (at least this is what we were told by our FAE, using the coldfire V1 core). 

2,401 次查看
Kafre
Contributor III

I've been looking for the name of the tick frequency parameter for a while, could you drop me a clue of where to find it, please?

0 项奖励
回复

2,401 次查看
anthony_huereca
NXP Employee
NXP Employee

It's the BSP_ALARM_FREQUENCY parameter, which is set in <mqx_dir>\mqx\source\bsp\<board_name>\<board_name>.h

 

The ticks are then set up in the BSP initialization, located at <mqx_dir>\mqx\source\bsp\<board_name>\init_bsp.c

    kernel_data->TIMER_HW_REFERENCE = (BSP_SYSTEM_CLOCK / BSP_ALARM_FREQUENCY);       _time_set_ticks_per_sec(BSP_ALARM_FREQUENCY);    _time_set_hwticks_per_tick(kernel_data->TIMER_HW_REFERENCE);    _time_set_hwtick_function(_bsp_get_hwticks, (pointer)NULL);

 

 

2,401 次查看
bistrulli
Contributor I

Thank you so much Kyle, I'll try it soon.

0 项奖励
回复