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
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.
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
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