What is affected by changing the reference clock? Topic is solved

If you have a simple question and just want an answer.
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

What is affected by changing the reference clock?

Post by DemoniacMilk »

I am currently trying to adjust a clock for a serial interface.
As I can only get 25Mhz or 16,6MHz and nothing in between, I am thinking of adjusting the reference clock.
What would be affected by that? I am thinking of timers, is there anything else?


View Solution
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

The clocks in an xcore are as follows:
Screen Shot 2016-09-19 at 12.51.59.png
(from https://www.xmos.com/download/private/A ... rc1%29.pdf)

Note that XS2 (xcore200) doesn't have standby mode, but the rest is accurate.

Changing the reference clock will affect a lot of stuff - basically anything connected to CLKBLK 0 which by default everything is including timers and ports. You can find out from the code what the speed is using:
PLATFORM_REFERENCE_HZ
and compensate for any use of timers by scaling delays, but slow down the ref clock too much and ports might start behaving differently too. Pretty much all of the software IP written assumes 100MHz ref clock.

You know you can clock a clockblock from the 500MHz clock divided by 2n?
void configure_clock_xcore(clock clk, unsigned char divide);


That may get you closer to what you want without changing ref clock values..
You do not have the required permissions to view the files attached to this post.
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

Post by DemoniacMilk »

Awesome, thank you.
I did not know I can use the system clock to drive ports.