Minimum period for MQX Timer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Minimum period for MQX Timer

2,913 Views
JaimeR
Contributor III
What's the minimum period suggested for a periodic MQX Timer?
6 Replies

845 Views
Jairo
Contributor III
The minimum timer interval is 1 tick, and it's equivalent to 5ms

845 Views
bistrulli
Contributor I

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

0 Kudos

845 Views
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). 

845 Views
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 Kudos

845 Views
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);

 

 

845 Views
bistrulli
Contributor I

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

0 Kudos