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.

LP-MSP430FR2476: Microsecond delay

Part Number: LP-MSP430FR2476

I have been using __delay_cycles which works well in the order of milliseconds. I have a 16 MHz MCLK. What is the precise way to generate microsecond delay?

Thanks

  • __delay_cycles will create cycle accurate delays so in your case an argument of 16 will result in a 1 us delay. There is of course no control over the instructions preceding or following that.

  • Actually you have that backwards, timers are much better for millisecond delays, while __delay_cycles() is good for microseconds. Note that __delay_cycles() is effectively a nop, and simply wastes time.

    If you are getting milliseconds of delay with __delay_cycles() with a reasonable argument, you might not have a 16 MHz clock.

**Attention** This is a public forum