How to permanently set the clock speed or GCDR so that 6700 boots at 12MHz?

I would really like to know where we (users) can permanently set the main clock multiplier GCDR so that it boots and runs at 12MHz.
I see the register settings in the doc, but that implies an already running Rabbit - that is, unless the registers are loaded from NVRAM?

We got a response from Digi sw support as follows:

"Regarding GCDR, it looks like BIOSLIB/StdBios.c calls _getDoublerSetting() in BIOSLIB/CPUPARAM.LIB to get the starting value for GCDR. During startup, it measures clock speed to calculate the proper value for GCDR. The customer could hard-code a value in _getDoublerSetting() if necessary.

If they want to change the clock speed of the module for some reason, they might want to set PLL_DEFAULT_PLL_SPEED_MHz in their project settings. The default is a value of 325 which corresponds to a CPU speed of 162.5 MHz (PLL / 2)."

We used this based on the example:
long sf[14];
int clkdbl;

printf("Startup CPU freq = %ld

β€œ, get_cpu_frequency());
clkdbl = (GCDRShadow & 0x1F) != 0;
printf(” - initial clock doubler is %s
", clkdbl ? β€œON” : β€œOFF”);
printf("b. div4, doubler OFF: CPU freq = %ld

", sf[1] = get_cpu_frequency());

1 Like