MQX task tick

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

MQX task tick

Jump to solution
1,813 Views
Mohsin455
Contributor IV

Hi,

 

      I am using MQX 3.8 and TWRK60N512. The tick rate is set to 5ms in the mQX. I want to know what happens when the I use _time_delay(1) as the task tick is 5ms.

 

So what is the minimum delay I can use with _time_delay() when the tick rate is 5ms ?

 

Thanks,

Mohsin

 

0 Kudos
Reply
1 Solution
751 Views
c0170
Senior Contributor III

Hi Mohsin455,

 

Minimum resolution is 5ms if it's set to 5ms (BSP ALARM FREQ = 200). When you pass number below 5 as an argument in this case, you'll get the minimum resolution.

 

Regards,

MartinK

View solution in original post

0 Kudos
Reply
6 Replies
752 Views
c0170
Senior Contributor III

Hi Mohsin455,

 

Minimum resolution is 5ms if it's set to 5ms (BSP ALARM FREQ = 200). When you pass number below 5 as an argument in this case, you'll get the minimum resolution.

 

Regards,

MartinK

0 Kudos
Reply
751 Views
Mohsin455
Contributor IV

Hi MartinK,

 

                     Thnaks for your reply. So it might be that we get lower than 5ms depending on when we are calling _time_delay(1) i.e. if we call _time_delay(1) just before the next tick then it will occur when the next tick happens.

 

Also what if we give anything above 5 and below 10 ? Does it work in similar way (i.e. it only delays till the next tick).

 

PLease confirm ?

 

Thanks,

Mohsin

0 Kudos
Reply
751 Views
RichardR
Contributor IV

_time_delay will suspend for at least the amount of time you specify.

0 Kudos
Reply
751 Views
Mohsin455
Contributor IV

Yes,

          But only when the tick rate the >=  the amount you specify.

 

Regards,

Mohsin

0 Kudos
Reply
751 Views
RichardR
Contributor IV

It should always delay for AT LEAST as long as you specify in _time_delay, it may well be longer, depending on the system tick, other tasks running, etc.

0 Kudos
Reply
751 Views
c0170
Senior Contributor III

Hi Mohsin455,

 

I might have not clarified it well enough :smileyhappy:

 

What you have written is correct.

 

Regards,

MartinK

0 Kudos
Reply