How to calculate the machine cycles to write a delay function with codewarrior?

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

How to calculate the machine cycles to write a delay function with codewarrior?

跳至解决方案
1,252 次查看
修華許
Contributor III

I use a FRDM-KE06Z board to develop a application.

I can't find any predefined like delay_ms() or delay()

Any good way to calculate the machine cycles that I can write a delay function easily?

标签 (1)
1 解答
1,061 次查看
BlackNight
NXP Employee
NXP Employee

You might have a look at the open source Wait Processor Expert component which is available on SourceForge, see

McuOnEclipse Releases on SourceForge | MCU on Eclipse

It comes with various busy wait routines:

pastedImage_1.png

If you are not using Processor Expert: you simply generate the code and use the WAIT1.c and WAIT1.h files in your project.

I hope this helps,

Erich

在原帖中查看解决方案

1 回复
1,062 次查看
BlackNight
NXP Employee
NXP Employee

You might have a look at the open source Wait Processor Expert component which is available on SourceForge, see

McuOnEclipse Releases on SourceForge | MCU on Eclipse

It comes with various busy wait routines:

pastedImage_1.png

If you are not using Processor Expert: you simply generate the code and use the WAIT1.c and WAIT1.h files in your project.

I hope this helps,

Erich