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.

Clock Confusion

Guru 15580 points

I am confused about the settings of the Clock Manager settings and the fact that they don't appear to correlate to the correct PRD ticks setting for my PRD object.

Here is the Clock Manager settings window. Note that the Microseconds/Int is set to 100.

And here is my SWMonitorPRD setting window. Note the period (ticks) is set to 125 which implies that the PRD should be kicked off every 12.5ms....

 

However, if I measure that actual period of the PRD it is 125ms instead of 12.5ms, 10 times the expected value. I performed the measurement by inserting the following code at the beginning of the function that is pending on the SEM shown above (SWMonitorSem).

while(1){

SEM_pend(&SWMonitorSem, SYS_FOREVER);

current_time = CLK_gethtime();

delta_time = current_time - previous_time;

previous_time = current_time;

CPUcycles = delta_time * CLK_cpuCyclesPerHtime();

/* calculate absolute time in milliseconds */

TimeAbsolute = CPUcycles / GBL_getFrequency(); 

....and here are the results:

CPUcycles = 4.695054e+07

TimeAbsolute = 156.5018

....which verifies that the period is actually 156 ms instead of 12.5 or 125ms. Am I misinterpreting something? Why is the PRD period off by a factor of 10+?
Thx,
MikeH