Help:Delay Function for time delay(S32K144)

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

Help:Delay Function for time delay(S32K144)

6,402 Views
victor_song_171
Contributor III

How could I edit a time delay function in S32K144_100Pin?

I want code a function for time delay ,just like delay_second() , delay_microsecond(), or just like that.

Tags (3)
0 Kudos
3 Replies

5,029 Views
Yunchuan
NXP Employee
NXP Employee

As ErichS‌ say, or you can use SDK  OSIF module , function void OSIF_TimeDelay(const uint32_t delay).

SysTick timer is used in this function,and SysTick interrupt will be enabled when you call this function, and will always run without another disable action.

0 Kudos

5,029 Views
BlackNight
NXP Employee
NXP Employee

Maybe you are looking for something like the McuWait module:

McuOnEclipseLibrary/McuWait.c at master · ErichStyger/McuOnEclipseLibrary · GitHub 

It offers functions to wait for a number of milli-seconds or microseconds:

McuWait_Waitms(1000);

McuWait_Waitus(50);

If using an ARM Cortex-M4, it uses the cycle counter (see Cycle Counting on ARM Cortex-M with DWT | MCU on Eclipse  and Measuring ARM Cortex-M CPU Cycles Spent with the MCUXpresso Eclipse Registers View | MCU on Eclipse ).

I hope this helps,

Erich

0 Kudos

5,030 Views
victor_song_171
Contributor III

Thank you.

but using the function mcuwait_waittime(delay_time),weawther all of the computing resource wait for the delay function done?

0 Kudos