AnsweredAssumed Answered

Changing CPU clock speed on K22

Question asked by David Pfaltzgraff on Mar 18, 2018
Latest reply on Mar 19, 2018 by Marek Trmac

I have an application built on the K22 processor that uses FreeRTOS. On power-up it checks for power on the USB connector. If USB is connected, it runs in high speed mode to support USB transfers. But if there is no USB, it comes up at a lower speed to conserve power. The question is: If the program comes up in high speed and then later detects that the USB is disconnected, what is involved in moving to the lower speed?

 

The interfaces implemented are SPI, I2C, two UARTs and the timer. It's OK if the SPI and I2C run at a different rates as they are self clocked, but the timer and UARTs must maintain the same time relationship. For example, the UARTs must remain at 9600 baud and the timer used for the FreeRTOS tic timer must keep the same interrupt interval.

 

Is it as simple as finding the appropriate initialization routines and re-running them?

 

Note that although going through a power-up reset might work, that is not acceptable from the user's viewpoint. Also, transients during the change can be tolerated. (Finally, this is only in going from high to low speed. Once in low speed mode, reconnecting the USB has no effect.)

Outcomes