Simple delay functions for TI Launchpad?

In Atmel Microcontrollers, there are simple delay functions such as __delay_ms() and __delay_us() found in utils\delay.h.

I am using a Tiva™ C Series TM4C1294 development board, with a TM4C1294NCPDT microcontroller. However, I can't find any libraries to do similar delay functions.

Will I have to write my own delay function? I know it's not that hard, but I'd rather use an existing library if there is is one.

Try this:

/* Delay cycles for 1 second */ SysCtlDelay(16000000u / 3u);

• What header file is this function located in? Sep 18, 2014 at 21:28
• If you're using CCS, CTRL + SHIFT + O should add the necessary header.
– Tim
Sep 18, 2014 at 22:38
• SysCtlDelay located in sysctl.h tivaware library. Oct 4, 2014 at 19:26

I test 1 second with this:

SysCtlDelay(SysCtlClockGet() / 3); // delay 1 second


The SysCtlDelay is implemented by assembly code

          SysCtlDelay():
000008f0:   1E40                subs       r0, r0, #1
000008f2:   D1FD                bne        SysCtlDelay
000008f4:   4770                bx         lr