Knowledge Base

The HD8 with late Firmware revisions can respond to UV instructions that address the CPU device. Some of the responses are dependent on the hardware configuration.

Board Type

The board will respond to the following board-type poll:

  SPxPoll2      3,!CPU

by placing its board type identification number on U0 and U1. The response is a function of the type (model) of board and the number of connected XPice expansion boards (e.g. XBIO16XIRO16HIO16). The numbers can be fetched from U0 and U1 by the PushU instruction.

The following table defines the responses for the HD8 with varying amounts of expansion:

ConfigurationU0HD8
Controller alone0141
Controller+16XPice0142
Controller+32XPice0143
Controller+48XPice0144
Controller+64XPice0145

Note that you can discover in this way how much expansion has been added but not the type of expansion board.

Interpreting the number of XPice points can be a little tricky. For boards with segregated inputs and outputs, like XIRO16 and HIO16, each 8I/8O board corresponds to 16 XPice points. For the XBIO16, each bidirectional point corresponds to one input and one output (and appears as such on the SPLat/PC screen). That means one XBIO16 board gets counted as 32 XPice points although it only adds 16 I/O points to your configuration.

PWM base frequency

The HD8 can be supplied to special order with pulse width modulated (PWM) outputs in lieu of analog outputs. Normally the frequency of the PWM pulse train is 16kHz. The base frequency can however be altered using the instruction:

SPxCmd1          0,!CPU

with register U0 preset to a value between 0 and 7. The resulting PWM frequencies are given in the following table:

U0PWM frequency
016kHz (Default)
18kHz
24kHz
32kHz
41kHz
5500Hz
6250Hz
7125Hz

Any other value will result in a fatal runtime error.

Both PWM pins are affected. This feature is designed to be used with PWM output circuits such as DC motor speed controls or RC servos.

When used with an AnOut instruction, the resolution is 8 bits. With fAnOut it is 10 bits.

Modify SuperTimer 10mS clock interval

You can change the basic 10mS SuperTimer clock interval to some other value. Set U0 to the required value in mS and then execute a

         SPxCmd1         1,!CPU

This affects all timers that use the SuperTimer mechanism, which is any timer that can have a duration counter up to 16,777,215 (PausefSTTimeSinceWaitOnT, etc). If you set the interval to 1, the timing will run 10 times faster than normal. If you set it to 256, the timing will run 25.6 times slower than normal giving you a timing range of 49.7 days. Due to the resolution of the internal math, the re-scaling will produce an error of up to 0.2% at the slow end of the scale. The actual error will be the error produced by rounding 65,536/U0 to the nearest integer. If U0=0 it reverts to the default 10mS.

Note that it makes little sense to run the SuperTimers with a clock that is faster than the “loop time” of your program.