time_delay_ticks in mqx

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

time_delay_ticks in mqx

跳至解决方案
2,656 次查看
antonychen2008
Contributor II

my system is based on kl26 and mqx . tick is1ms . when I use time_delay_ticks(240000),the real delay time is 7 or 8 minutes. could you help me. thanks

0 项奖励
回复
1 解答
2,418 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Antony:

The default system tick in MQX is 5ms. This is the smallest unit of the time that clocks the scheduler.

It is not possible to have a delay shorter than 5 milliseconds without modifying the BSP. Each BSP can have a different value in the Macro "#define BSP_ALARM_FREQUENCY 200". This macro defines the number of ticks per second. This means each tick is 5 milliseconds.

time_delay is for some time sensitive situation, if you need precise time, you can use hardware timer. I attached a document to describer its usage.

Have a nice day!

Regards

Daniel

在原帖中查看解决方案

0 项奖励
回复
2 回复数
2,419 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Antony:

The default system tick in MQX is 5ms. This is the smallest unit of the time that clocks the scheduler.

It is not possible to have a delay shorter than 5 milliseconds without modifying the BSP. Each BSP can have a different value in the Macro "#define BSP_ALARM_FREQUENCY 200". This macro defines the number of ticks per second. This means each tick is 5 milliseconds.

time_delay is for some time sensitive situation, if you need precise time, you can use hardware timer. I attached a document to describer its usage.

Have a nice day!

Regards

Daniel

0 项奖励
回复
2,418 次查看
antonychen2008
Contributor II


Thanks your document

0 项奖励
回复