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.


2 Answers 2


Try this:

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

  • \$\begingroup\$ What header file is this function located in? \$\endgroup\$
    – tgun926
    Sep 18, 2014 at 21:28
  • \$\begingroup\$ If you're using CCS, CTRL + SHIFT + O should add the necessary header. \$\endgroup\$
    – Tim
    Sep 18, 2014 at 22:38
  • 1
    \$\begingroup\$ SysCtlDelay located in sysctl.h tivaware library. \$\endgroup\$ 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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.