CPUClock

Temperature control version

Version 1.10


Background | Installation | Basic operation | The iconbar menu | The choices window | The status window | Contact | Versions | Licence

CPUTmpMon


Important: CPUClock is only of use on hardware that is capable of switching the CPU between two speed settings. This means hardware such as the OMAP3 BeagleBoard, the OMAP4 PandaBoard, the iMX6, or the IGEPv5.


Background

The following description uses extracts from a post by Jeffrey Lee in the ROOL forum (with permission).

RISC OS does several things to control the speed of the CPU:


Important caveat

Both CPUClock and CPUTmpMon rely for correct operation on the wimp multitasking and wimp polls occurring. If an application is single tasking then no wimp polling is occurring, and both CPUClock and CPUTmpMon will be suspended. Thus no temperature control will be possible during this time. If there is a danger of the cpu overheating during such a period, then you should reduce the cpu fast speed manually before starting the intensive single tasking process.


Installation

For a new installation, simply drag and drop the CPUClock application into the directory of your choice.

If you have a previous copy of CPUClock you have two choices.

CPUTmpMon is located within the CPUClock application so will be installed when CPUClock is installed.


Basic operation

To run the application, double click on it's icon in a filer window. Clicking on the iconbar icon with Select will open the CPU status window.

CPUClock will show the set values for the cpu fast and slow speeds, and will also show the current cpu speed (either the fast or slow speed depending on the cpu loading at the time). The actual cpu speeds used for the fast and slow speeds can be set, using a popup menu.

This version interacts with the application CPUTmpMon to obtain the CPU temperature, allowing automatic reduction in the CPU fast speed if the temperature rises too much. Once the temperature falls, the fast speed is increased again.

Note that there are four different versions of CPUTmpMon supplied within the CPUClock application, since the four boards (BB, PB, iMX6, IGEPv5) have very different hardware and different ways of acquiring the silicon temperature. When CPUClock first starts up, it interrogates the hardware, and runs the version of CPUTmpMon appropriate for that hardware. When using CPUTmpMon in this way, its icon (which shows the cpu temperature) will be placed on the iconbar in addition to the icon belonging to CPUClock.


The Iconbar Menu

A screen shot of the iconbar menu is shown right.

Info  –  A standard application info box, including a button to go to the web site to check for later versions.

Help...  –  Runs the help file (this one).

Status...  –  Opens the CPU clock speed status window (see below). Clicking on the iconbar icon with Select will also open the CPU status window.

Choices...  –  This opens the application choices window (see below).

CPUTmpMon  –  This leads to a submenu that allows you to Quit CPUTmpMon if it is running, or conversely to start CPUTmpMon if it is not running.

Quit  –  This terminates the application immediately.


The Choices... dialogue

The choices dialogue has a set of action buttons at the bottom of the window.

The actions available are:

Set
This will use the new settings with immediate effect, and they will be used until CPUClock is quit.
Save
This will use the new settings, as in Set above, and will also save the settings to disc, so they will be used when CPUClock is run in the future.
Cancel
Close the dialogue and ignore any changes made since it was opened.
The settings that can be changed are as follows.
Poll idle delay/cs
CPUClock checks the current speed of the cpu periodically, and writes the value under the iconbar icon, and in to the status window if it is open. The delay between checks can be adjusted using the bump arrors at the right. The value is in centiseconds. The default delay is 100 cs (1 s). Long delays may miss short bursts of cpu activity, while short delays may actually load the cpu.
Iconbar icon at right
When an application installs an icon on the iconbar, by default it is installed at the left end of the right hand side icons. Thus the position is variable. If you wish to keep an eye on the cpu speed, it might be useful to have the iconbar icon in a relatively constant position. If this is ticked, then the iconbar icon will be installed to the right of the normal application icons (some applications have a high priority for positioning, e.g. the task or display managers, and CPUClock does not install to the right of these). Note that CPUClock will need to be quit and restarted before the change will take place. You will be offered the option of restarting immediately, or waiting.

The remainder of the settings are concerned with how CPUClock interacts with the CPUTmpMon application, and how it controls the CPU speed.

Enable auto control
If this option is ticked then CPUClock will attempt to regulate the cpu temperature by reading temperature values from CPUTmpMon, and reducing the fast speed setting if the temperature exceeds the set maximum value. If it is unticked then CPUClock will simply monitor and display the cpu speed.

Additionally, if choices have previously been saved with auto temperature control enabled, then CPUClock will start CPUTmpMon automatically when it is itself started.

If the auto speed control is enabled, then the following settings will influence how the control will be actioned

Maximum temperature/°C
This value (in °C) sets the maximum cpu temperature that is allowed before the cpu speed will be reduced. The maximum working temperature for a particular cpu will be found in the reference manual for the board. However, as a rough guide, 65°C is probably a suitable upper limit. 60° would be even safer for long term use.
Differential/°C
This value (in °C) sets the number of degrees by which the temperature must fall below the maximum setting before the cpu speed will be increased again
Temperature read interval/s
This sets the interval in seconds that CPUTmpMon will wait between each reading of the cpu temperature

The final option applies when CPUClock is quit.

Auto quit CPUTmpMon
If this option is ticked, then when CPUClock is quit, either from its iconbar icon menu, or from the Task Manager, it will send a Wimp_QUIT message to CPUTmpMon, resulting in it terminating. CPUTmpMon itself has no menu, so cannot be quit directly, but must be quit from the Task Manager.

The CPU clock speed status window

The CPU clock speed can be set to a 'fast' and a 'slow' speed. The OS can switch between the two speeds depending upon how hard the CPU is working. The three display fields show information on the CPU clock speed. The top field shows the configured setting for the 'fast' speed. The middle field shows the corresponding setting for the 'slow' speed. The bottom field shows the actual clock speed of the cpu when it was last read. This will switch between the 'fast' and 'slow' setting as the work load of the cpu changes. By default the fast and slow settings will be the maximum and minimum speeds at which the cpu can be clocked, although the 'fast' speed may be temporarily reduced when in CPU temperature control mode.

Note that CPUClock updates the current speed value, by default, every 1 second using wimp NULL poll events. See Choices (above). If the wimp is not multitasking at that instant, e.g. processing an image, then the display cannot be updated. However, in general use you should see the speed being switched between 'fast' and 'slow' as you do things in the desktop.

The harder the CPU works, the warmer it will get. It might be useful at certain times of high ambient temperature to limit the speed of the CPU to keep its temperature down.

Clicking on the popup menu button to the right of the 'Fast' or 'Slow' fields will raise a menu listing the allowable CPU clock speeds. Selecting one of these speeds will reset the 'Fast' or 'Slow' setting as appropriate to this new value. This is a 'permanent' setting in the sense that it will remain in force until either specifically changed again, or the machine is rebooted.

Reducing the 'Fast' speed may be beneficial in high ambient temperature conditions. It is unlikely there will be any benefit in raising the 'Slow' speed, since this is used when the processor is idling.

In addition, with this version of CPUClock, the CPU temperature can be continuously monitored using CPUTmpMon, and the CPU speed throttled automatically to keep the temperature within safe limits. See Choices (above) and the next section.

Automatic control

If the status window is maximised, by clicking the icon at the far right of the title bar, more display fields are revealed. A screenshot is shown below.

CPU temperature
This gives the current value of the chip temperature, as determined by the CPUTmpMon application. This temperature will vary depending upon how hard the CPU is working. It should never be allowed to exceed the maximum working temperature for the chip. Note that occasionally the temperature displayed by CPUClock and CPUTmpMon may be slightly different in the decimal place. This is due to the different rounding functions in C and Basic.
Auto-set fast speed/MHz
This shows the fast speed that has been set by CPUClock when it is regulating the temperature of the CPU. Under normal conditions, it will be the same as the configured fast speed, shown at the top of the window. If the CPU temperature has risen sufficiently, such that CPUClock has reduced the fast speed, then this field will show the moderated fast speed setting, which will be lower than the configured setting.

PandaRO and CJE Micros RTC module

Case temperature
If you have a PandaRO machine, or a PandaBoard fitted with the CJE Micros RTC module, then this module also contains a temperature sensor. This sensor measures the temperature close to the board, which will be a function of the ambient case temperature. If your board is not fitted with such a device, then this field will either not be present, or remain blank, depending upon how successful CPUClock was in detecting whether the RTC module is present or not.

 

 


Contact

All communication about CPUClock should be directed to Chris Johnson (Email:chris@chris-johnson.org.uk). Suggestions for new features are always welcome.

Web site

Chris Johnson's web site is at http://www.chris-johnson.org.uk/index.html, with his RISC OS software at http://www.chris-johnson.org.uk/software/index.html.


Screenshots

All the screen shots in these pages were obtained using Snapper, a versatile screen capture application.

Snapper is available from http://www.chris-johnson.org.uk/software/snap.html


CPUClock is © Chris Johnson, 2012
Email:chris@chris-johnson.org.uk

This document last modified on 17th December 2015