Clock Frequency Control

Top  Previous  Next

Some devices support clock frequency (PLL) control. When the PLL is on, the system is running at the highest possible frequency. When the PLL is off, the system is running at a reduced frequency. For example, the EM1000 can run at 88.4736MHz (PLL on) or 11.0592MHz (PLL off).

To find out if your device allows frequency control and what particular frequencies it can operate on, refer to this device's platform documentation (for example, EM1000's is here).

The clock frequency affects all aspects of device operation that rely on this clock. Naturally, program execution speed, too, depends on the clock frequency. Serial port baudrates (see ser.baudrate) in the UART mode (ser.mode= 0- PL_SER_MODE_UART) also depend on the main clock. Finally, the frequency of the square wave generated by the beep. object depends on the main clock as well. The period of the on_sys_timer event of the sys. is not affected by the PLL mode.

 

note_tip-wt

There is a way to set the baudrate in the clock-independent (and, actually, platform-independent) way — see ser.div9600 property for details (example of use can be found in the Serial Settings topic). For the beep object, you just have to set the beep.divider correctly depending on the current PLL mode.

 

For PLL control, the sys. object has a sys.currentpll read-only property and sys.newpll method. See PLL Management topic- it explains how to switch the PLL on and off.

After the external reset (see sys.resettype), devices with PLL control may boot with the PLL on or off. Refer to the "Platform-dependent Programming Information" topic inside your device's platform specifications section for more information.