pmSetSpeed (Function) |
Top Previous Next |
This function is used to set the CPU execution speed to reduce the power consumption. The speed is selected in five steps (0..4) where 0 is slowest. However, when changing to another speed, a number of limitations exist.
Limitations: •If another function, which must operate at a higher speed than the one requested, is enabled, an error will be returned. Please see the return codes. •A voice call will temporarily switch to full speed (4) as long as the call is active. •When the on-board battery is being charged, the device will operate at full speed (4) until charging has terminated. •Connecting a programming cable will temporary switch to full speed (4) to enable communication with the RTCU IDE. The selected speed is resumed when the cable is removed. •Using gsmPower is only allowed at speed 3 or 4. Use gsmPowerLP for all other speeds. •When the speed is changed, all serial communication is interrupted, and the RTCU cannot receive any data that is transmitted to it during the change. This includes CAN, 1-Wire, RS232, and RS485. •Operating CAN at 1 Mbit is only allowed at speed 1 or higher. •1-Wire is only allowed at speed 4. •On-board Ethernet is only allowed at speed 4. •It is not possible for RS232 and RS485 to obtain all baud rates at all speeds. Below is an overview of which baud rates that can be used at the specific CPU execution speed.
Input: speed : INT 0 = Very slow (2 MHz clock). 1 = Slow (6 MHz clock). 2 = Medium (12 MHz clock). 3 = Fast (24 MHz clock). 4 = Very fast (48 MHz clock) (default at boot-up).
Returns: INT
Declaration: FUNCTION pmSetSpeed : INT;
Example: INCLUDE rtcu.inc |