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

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

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

Jump to solution
633 Views
修華許
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?

Labels (1)
1 Solution
442 Views
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

View solution in original post

1 Reply
443 Views
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