Hi,
i´m working with TMS750LS1224 hercules launchpad, and i would like to know if is there a function like HAL_Dalay(ms) that can be used?
And if exist, this work when using the freeRTOS?
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.
Hi,
i´m working with TMS750LS1224 hercules launchpad, and i would like to know if is there a function like HAL_Dalay(ms) that can be used?
And if exist, this work when using the freeRTOS?
Thanks!
Hi Anderson,
You can generate the delay function in two ways:
One way is using __delay_cycles function and other way is using RTI peripheral.
1. __delay_cycles is a intrinsic in our code generation tools.
There are some limitation using this intrinsic as explains in the compiler readme file.
===================================================================
The __delay_cycles intrinsic inserts code to consume precisely the number of
specified cycles with no side effects. The number of cycles delayed must be
a compile-time constant.
NOTE: Cycle timing data is based on 0 wait states. Results will vary with
additional wait states. The implementation does not account for dynamic
prediction. Lower delay cycle counts may be less accurate given pipeline
flush behaviors.
===================================================================
Actually i tested this function using 220Mhz CPU clock(GCLK) with argument of 10000 cycles i passed
Actually, based on above values, the delay expected should be (10000/220Mhz) 45.45uS right but i got the delay of 160us. Which is because of the wait cycles of the flash, as you can see the below pic the wait states are not zero for flash when clock is 220Mhz
It is 3 for data and 1 for address.
And when i changed input operand value to the 1000 instead of 10000 then i got the 16us. So, my suggestion to use this function is just calculate practical delay with some high value and then scale it down to the required value.
For more details refer below thread:
2. The other way is using RTI function:
for this method please refer below thread:
--
Thanks & regards,
Jagadish.