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.)
Solved! Go to Solution.
Clocks tool contains "Module Clocks" view with list of peripherals and all available clock sources for each peripheral. This might help to predict impact.
Regards
Marek
Hi David,
MCUXpresso Config Tools contains Clocks tool, that can help you configure clocks and display result in graphical form (clock diagram). The Clocks tool is available on the MCUXpresso web, as a standalone tool or also integrated in MCUxpresso IDE.
Regards
Marek
This might tell me how to set up the clock for a specific speed, but it is of no help in determining the peripheral impact of any speed change.
Clocks tool contains "Module Clocks" view with list of peripherals and all available clock sources for each peripheral. This might help to predict impact.
Regards
Marek