[PSR] set / get clock rate

lukacjo1 at fel.cvut.cz lukacjo1 at fel.cvut.cz
Sat Nov 10 13:54:13 CET 2018


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





More information about the PSR mailing list