Changing the MQX tick rate

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

Changing the MQX tick rate

1,696 Views
RWey
Contributor I

This is probably a simple question, but being new to MQX please find it in your hearts to forgive me.

 

I'm using MQX 3.8 along with Processor Expert and I'm having trouble changing the MQX tick rate.  It's easy enough to call the _time_set_ticks_per_second( 1000 ) function, and while querying with the associated "get" function shows the change, doing some timing tests shows the actual time is still at the default 200 tps.

 

If you look at the kernel function definition, the comment mentions:  "THIS MUST AGREE WITH THE ACTUAL INTERRUPT PERIOD...",  so the question is, how does one change the "actual interrupt period" so it agrees with the new 1mS tick rate ?

 

Thanks.

0 Kudos
4 Replies

471 Views
MarkP_
Contributor V

In twrk60n512.h is default:

/* ** The clock tick rate */

#ifndef BSP_ALARM_FREQUENCY

#define BSP_ALARM_FREQUENCY             (200)

#endif

 

Add own definition into user_config.h:

#define BSP_ALARM_FREQUENCY   1000  /* 1 ms tick */

~Mark

 

0 Kudos

471 Views
barbercolman
Contributor III

I am planning on changing the tick from 5 ms to 1 ms on a k60n512 project. Only one very short task will run every ms. Does anyone have experience to say if this will be a problem?

Thanks

0 Kudos

471 Views
c0170
Senior Contributor III

Hi barber colman,

 

can you be more explicit what's your use case?

 

Regards,

MartinK

0 Kudos

471 Views
RWey
Contributor I

Thanks Mark, that seems to make sense.

 

I'm wondering, however, why the tick rate is refered to as "tick rate" everywhere else, yet this critical definitions names it "

BSP_ALARM_FREQUENCY"  ?

 

Am I missing something.

0 Kudos