Hello,
We are using a 500MHz c6424. While running a nanosecond delay function which is taken from the evm module, we noticed that the function makes the delay more than it is supposed to be. The function may not provide a properly nanosecond delay, but it helped us notice there is a problem with our execution time.
The function is :
void nsdelay(unsigned long int nsec)
{
volatile int nx = 0;
volatile int loop = (int)(nsec*8);
for (nx = 0; nx < loop; nx++);
}
The assembly view of the loop
When I take just the loop time in the function by toggling a GPIO pin (nsec = 1), the value is 660 nanoseconds. So i calculated aprox. cycle counts just for the loop with the help of the assembly viewing by Code Composer, it is 78 cycles. While running on 500Mhz, cycle per nanosecond is 2. So instead of doing the operation on 156 nanoseconds, it longs 660 nanoseconds, which indicates our DSP is running on aprox. 121Mhz instead of 500Mhz.
Realizing that, I immediately checked the PLL setup but there is no visible problem with PLL. Registers are set with the correct values. Do you have any ideas or recommendations for this situation? Thanks a lot...
Erman