Tool/software: Code Composer Studio
I was trying to use _delay_cycles() in mu code to generate 1 sec delay .
I am unable to generate the exact delay as I don't know how to calculate the value to be provided to _delay_cycles()
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.
Tool/software: Code Composer Studio
I was trying to use _delay_cycles() in mu code to generate 1 sec delay .
I am unable to generate the exact delay as I don't know how to calculate the value to be provided to _delay_cycles()
in microsec not accurace :(((
In my project use 2 func: uDelay and mDelay
/* uDelay - delay microsecunds */ void uDelay(unsigned int us) {while (us--) __delay_cycles(5);} // 8MHz on MSP430FR5959, 5 - Hand-picked value /* mDelay - delay milisecunds */ void mDelay(unsigned int ms) {while (ms--) __delay_cycles(8000);} // 8MHz on MSP430FR5959
**Attention** This is a public forum