SPLat Logo

SPx communications instructions

NOTICE: Our web site is being updated, but is currently experiencing extreme slowness due to host issues. Please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map
SPLat will be shut down for the Christmas Holiday season from Friday 20 December 2024 through Tuesday 7 January 2025. We will check emails periodically and will continue to process orders but at a slower pace. Santa hat

SPx communications instructions

This chapter details the generic SPx communications instructions. These are the basic instructions that control command and data communications between the UV register pair inside the SPLat processor and SPx peripherals.

These are generic instructions. Most peripherals will eventually get their own specific instructions as well. Those instructions will be synthesised by SPLat/PC using the generic SPx communications instructions in this chapter, the generic UV transfer instructions and regular SPLat instructions.

The SPx communications instructions all combine an implied command to a peripheral with a set amount of data. There are 5 instructions for outgoing commands and data and 4 to interrogate (poll) the peripheral for incoming data. Each instruction deals with a different amount of data. One of the 9 instructions supports 128 command codes, while the rest support 16 codes. A small number are reserved for fixed system related use.

When the SPLat processor executes an SPx communications instruction, it composes and sends a message to the peripheral. The message will contain the peripheral address (which is an instruction argument), a command code (which is also an instruction argument) and some data. The data comes from UV as prescribed by the instruction itself. Once the processor has sent the message, it waits for a response from the peripheral. The addressed peripheral will always respond, even if the message is not one it supports (in the event of a program bug). The normal response will always contain a prescribed amount of data, which the processor will save in UV. There is also a mechanism for error handling, i.e. an abnormal response or no response.

There are instructions for transferring 0, 1, 2 or 4 bytes of data, plus one in either direction for variable length data blocks (1 to 20 bytes).

The following sections describe the communications instructions. The instruction is summarized in the section heading. The following nomenclature is used:

Mnemonic cc,aaaa [In] or [Out]

Mnemonic is the key word recognised by the SPLat development environment (SPLat/PC or SPLat/IDE).

cc is the command code. This can be a number between 0 and 127 in the instruction that has 0 bytes of data and between 0 and 15 in the remaining instructions. Each command code cc results in a different response in the peripheral.

aaaa is the 16-bit peripheral address. This selects a particular peripheral as the target for the instruction. Addresses are allocated by us and will normally be locked into the Firmware driving the peripheral.

[In] or [Out] denotes which direction the resulting data will flow. [Out] means data is transferred from UV to the peripheral. [In] means it is transferred from the peripheral to UV.

U(n) denotes byte n of U, counting from 0, i.e. the 20 bytes of the U register are designated U(0) through U(19).