You are mixing CPU clock and operating system clock. CPU clock determines quickly the CPU executes instructions, whereas system clock (tick) determines how often the OS executes scheduler and similar things.

10. listopadu 2018 13:54:13 SEČ, lukacjo1@fel.cvut.cz napsal:
Hello.

I can't set system clock rate to specific values, resp. I am
not sure how to interpret returned values.
Sample code:


int ticksPerSecond = 80; //396000000;
int status = sysClkRateSet(ticksPerSecond);
if (status == OK)
{
printf("rate set: OK\n");
}
else
{
printf("rate set: ERROR\n");
}
int rate = sysClkRateGet();
printf("sysClkRateGet: %d\n",rate);

char ch = getchar();


A default value returned from sysClkRateGet() is 60 for the board simulator,
resp. 50 for the default simulator (vxsim0).

The range of possible rate values is 1 to 5000 for the board simulator,
resp. 2 to 100 for the default simulator (vxsim0).

I would expect to set the rate to a value such as 396 000 000 (that
is the board's cpu clock rate). Am I wrong?

Thanks for reply.

Lukac
PSR mailing list
PSR@rtime.felk.cvut.cz
You can unsubscribe from the list at https://rtime.felk.cvut.cz/mailman/listinfo/psr