Hi,
how can I make a delay over some microseconds or milliseconds? Do I have to create a function similar to this?
SysCtlDelay(F_CPU / 3000000 * nanoSeconds);
Or is there a better way?
Thank you!
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
how can I make a delay over some microseconds or milliseconds? Do I have to create a function similar to this?
SysCtlDelay(F_CPU / 3000000 * nanoSeconds);
Or is there a better way?
Thank you!
Hello user1597705,
Based on the system clock and the manner the code is placed in the Flash, it may be offset for delay. Better way is to either user a ROM_SysCtlDelay as it will have the same code fetch time and predictable execution unless interrupt is asserted.
Better way would be to use a WDT to fire a NMI which will always be serviced in a fixed amount of time and that can be factored into the wait time
Regards
Amit