How to confirm core freq

whoyoume
Posts: 23
Joined: Fri Sep 07, 2018 2:42 am

How to confirm core freq

Postby whoyoume » Tue Sep 25, 2018 11:18 pm

Hello All.

Could anybody tell me how?

I use DevKitC, and I hope 240MHz.

Thank you.

whoyoume
Posts: 23
Joined: Fri Sep 07, 2018 2:42 am

Re: How to confirm core freq

Postby whoyoume » Wed Sep 26, 2018 2:53 pm

Thank you people, I've got it using a code shown below.

register uint32_t t0, t;
register uint32_t n = 64000;
register uint8_t* pdata = new uint8_t[n];
uint32_t usec0 = micros();
asm volatile ("rsr %0, ccount" : "=r"(t0));
register uint32_t k = 0;
for(; k < n; k++) {
pdata[k] = (uint8_t)((*preg >> 11) & 0xff);
}
asm volatile ("rsr %0, ccount" : "=r"(t));
uint32_t usec = micros();
delete [] pdata;

printf("%u (%u, %u)\n", t - t0, t0, t);
printf("%u (%u, %u) usec\n", usec - usec0, usec0, usec);

Who is online

Users browsing this forum: No registered users and 75 guests