This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Delay Using C

Hi,
I want to know how to generate delays using C. I am using 89c51, 11.0592 crystal.

Parents

  • There have been some good past threads on the subject if you search the knowledgebase.

    For short delays (on the order of microseconds), you can use some Keil extensions to insert NOP instructions into your code.

    For slightly longer delays, you'll probably want to use a timer to measure the delay.

    For even longer delays, where you don't want to tie up the processor while waiting, you'll need a timer tick interrupt and some sort of software timer queue structure. The timer interrupt will signal the occurrence of an event (however that is to be done in your system) and set up the timer for the next event.

    There's no one standard C language call that will do this for you.


Reply

  • There have been some good past threads on the subject if you search the knowledgebase.

    For short delays (on the order of microseconds), you can use some Keil extensions to insert NOP instructions into your code.

    For slightly longer delays, you'll probably want to use a timer to measure the delay.

    For even longer delays, where you don't want to tie up the processor while waiting, you'll need a timer tick interrupt and some sort of software timer queue structure. The timer interrupt will signal the occurrence of an event (however that is to be done in your system) and set up the timer for the next event.

    There's no one standard C language call that will do this for you.


Children