SPLat Logo

SPx register model

NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map

SPx register model

The SPx register model holds the key to programming SPx peripherals. It is consistently used across external SPx Peripherals, Onboard SPx Peripherals, UV SPice and Virtual SPx Peripherals. It is also used for SPiceX add-ons, but in a slightly different way (See SPiceX communications instruction). The register model is illustrated in the accompanying diagram.

SPx register and instruction model

The key element in the SPx register model is two registers called U and V. U is a 20-byte register (251 bytes in 32-bit controllers with firmware built after 10 January 2020) that is used to pass data between the SPLat processor and the peripheral. V is a 1-byte register that is used mainly as a byte counter (indicating how many bytes are to be moved). We frequently refer to the pair as "the UV registers" or simply "UV".

Several important concepts underpin the UV-based SPx model:

  1. All traffic between the traditional SPLat registers (far left on the diagram) and the peripherals is funneled through UV.
  2. There are two distinct groups of SPLat instructions associated with UV. One for transferring data between the SPLat registers and UV (UV transfer instructions), and one for communicating between UV and the peripherals (SPx communications instructions). The communications instructions result in messages being sent to the peripheral and resulting responses from the peripheral.
  3. There is a fixed number of instructions in each group. They do not vary in number, form or content. The ultimate outcomes of those instructions depends entirely on the peripheral. Hence, instruction "Foo" addressed to peripheral A means something quite different from instruction "Foo" addressed to peripheral B.
  4. Traffic (messages) from UV out to a peripheral contain data and implied commands that will trigger actions in the peripheral. The SPLat processor does not know what those actions are. However, for a given outgoing message type, every peripheral must respond with a return message of an exactly prescribed form. That means that when the SPLat sends out a message, it knows in advance exactly what the format of the response will be, exactly how much data it will contain and exactly what to do with the data. And what it does is always to place it in UV in a prescribed manner.

Unlike the other registers which are copied for each task, there is just one set of UV registers provided in SPLat/OS.