MQX task tick

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

MQX task tick

跳至解决方案
2,505 次查看
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 项奖励
回复
1 解答
1,443 次查看
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 项奖励
回复
6 回复数
1,444 次查看
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 项奖励
回复
1,443 次查看
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 项奖励
回复
1,443 次查看
RichardR
Contributor IV

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

0 项奖励
回复
1,443 次查看
Mohsin455
Contributor IV

Yes,

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

 

Regards,

Mohsin

0 项奖励
回复
1,443 次查看
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 项奖励
回复
1,443 次查看
c0170
Senior Contributor III

Hi Mohsin455,

 

I might have not clarified it well enough :smileyhappy:

 

What you have written is correct.

 

Regards,

MartinK

0 项奖励
回复