µTasker Forum

µTasker Forum => NXPTM M522XX, KINETIS and i.MX RT => Topic started by: frank on January 08, 2010, 10:36:28 PM

Title: Microsec delay function
Post by: frank on January 08, 2010, 10:36:28 PM
Is there a microseconds delay function in uTasker ?. I am looking for a simple delay function something like,

delay ( microseconds )
Title: Re: Microsec delay function
Post by: mark on January 08, 2010, 11:12:45 PM
Hi Frank

Yes there is a simple delay called

extern void fnDelayLoop(unsigned long ulDelay_us)

This is simply a tuned loop (corrects approximately to respect the processor speed) and so gives approx delays in the us region (if interrupt occur the loop takes a little longer). You will have to check to see what is the longest delay possible since it is processor and clock dependent.

If you need very accurate delays it is best to use a timer (PIT or DMA timer). There are example of the interface routines in ADC_Timers.h.

Regards

Mark