Home/Support/Support Forum/increase cpu speed
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

increase cpu speed

+1 vote
I am trying to increase the clock speed of the CPU by using the Dynamic C in-line function to modify the GCSR as follows:
WrPortI(0x00, Epoint, 0x0C); // Bits 4:2 of the GCSR xxx011xx should be osc/2 for cpu & pclk
// Epoint is a null pointer of type char

This compiles but does not work - any suggestions????
asked Dec 6, 2019 in Rabbit by Consultofactus New to the Community (1 point)

Please log in or register to answer this question.

1 Answer

0 votes
Try using this to start:

WrPortI(GCSR, &GCSRShadow, (GCSRShadow & ~0x1C) | 0x0C);

You should always make use of the shadow register when calling WrPortI() so that any other code calling WrPortI() will maintain your changes. And you should only touch the bits you want to change -- the "& ~0x1C" preserves other bits (xxx000xx) and "| 0x0C" sets the appropriate bits (xxx011xx).

You could also have your code print out the value of GCSRShadow before making that change. What are those bits set to before you try to change them?

Which product are you using? What speed are you trying to attain? Could you make use of existing APIs to configure GCSR (like set_cpu_power_mode() for Rabbit 6000)?

Default configuration for each product is to run at full speed, with the clock doubler enabled if the RAM and flash support it.
answered Dec 6, 2019 by TomCollins Veteran of the Digi Community (1,833 points)