Note: Speed Modes are not available for Kinetis and ColdFire+ family MCUs. Please use the Clock configurations instead.
The CPU component supports up to three different speed modes. The three speed modes is a Processor Expert specific concept which (among all the other PE features and concepts) ensures the portability of the PE projects between different CPU models.
In fact, the three speed modes are a generalization of all the possible CPU clock speed modes used for power-saving that can be found in most of the modern microcontrollers. In the area of embedded systems, power saving and power management functions are so important that we could not neglect the proper HW- independent software implementation of these functions.
Therefore, for keeping the portability (HW independence) of PE projects, we recommend not to program the CPU speed functions manually, but use these three CPU Component speed modes instead:
- High speed mode - this mode is selected after reset and must be enabled in the project. This speed mode must be the fastest mode of the main CPU clock.
- Low speed mode - this mode is usually used for another PLL or main prescaler settings of the main CPU clock.
- Slow speed mode - this mode is usually used for the slowest possible mode of the main CPU clock.
Switching Speed Modes at Runtime
The modes can be switched in the runtime by the following CPU component methods:
- SetHighSpeed
- SetLowSpeed
- SetSlowSpeed
If a speed mode is enabled in the CPU Component properties, the corresponding method is enabled automatically.
It is highly recommended to disable interrupts before switching to another speed mode and enable them afterwards.
Speed Modes Support in Components
Using the component property CPU clock/speed selection, it is possible to define the speed modes supported by the component.
Some components allow to set two values of the CPU clock/speed selection property:
- Supported - The CPU clock/speed selection group contains properties defining which speed modes are supported for the component.
- Ignored - The speed mode settings are ignored and there are no action is performed when a speed mode is changed, that is the peripheral continues to run with the same configuration for all speed modes. No speed mode handling code is generated for this component. The component timing values are valid only for high-speed mode.
The following features are available for high-level components, if the CPU clock/speed selection is not set to ignored:
- During the design, all the timing-related settings for such a component are checked to be correct in all the speed modes that the component supports and the component is enabled in these modes.
- If the speed mode is changed, the current timing components are preserved (recalculated to be the same in the new speed mode), except the timing that is set at runtime from interval.
If the CPU speed mode is changed to a mode that the component does not support for any reason, the component is disabled right after the CPU speed mode is changed. Otherwise the component is enabled. - Before or after the speed mode is changed, the BeforeNewSpeed and AfterNewSpeed event functions are called.
Copyright 2013 Freescale Semiconductor, Inc.
PROCESSOR EXPERT is trademark of Freescale Semiconductor, Inc.