As of August 2007, boards with dialect 20 or later will not support TSP. Please refer to Xwire instead. If you need a board with TSP you can reFLash a dialect 20 board back to an earlier dialect.
TSP programming is mainly about sending messages to the TSP device using TSP instructions. Each message type corresponds to an instruction type. Messages/instructions fall into the following general categories:
Put
A Put sends data to the TSP device.
Get
A Get requests data from the TSP device. The device should then return the requested data.
Housekeeping & control
This is a catch-all for anything that is neither a Put nor a Get.
Because the TSP communications is relatively slow, it takes a significant amount of time to fulfill any instruction that communicates with the TSP device. Put instructions take time to send a message. Get instructions may take even longer because they not only send a message to the TSP device, but also have to wait for a reply. The TSP driver in SPLat has been designed so that when the driver is idle, one Put or Get can be executed by your SPLat program and the driver will take care of the rest. Your program can go on and do something else. However, if your program attempts a second Put or Get, it will be blocked until the first one is completed.
For this reason we have provided an instruction, TSPBranch, that allows you to test the status of the TSP driver. You can discover if it is idle, or busy sending out a Get or Put or awaiting a response from a Get. You can also discover if it has received the data requested in a Get. Finally you can discover if it has an error condition, usually caused by the TSP device failing to respond to a message. In the case of a Get the only way to access the resultant data is to execute a TSPBranch. It is the TSPBranch instruction that copies the received data, when available, into the U register where your program can access it.
SPLat cannot directly handle an address value over 32,767 (7FFF hex, 15 bits). As some TSP devices like SitePlayer have addresses up to 65,537 (FFFF hex) we have created two versions of each of the instructions that address byte, word or long memory variables. These are distinguished by an L (Low range) or H (High range) on the end of the instruction mnemonic. The low range instructions use the value of the address argument directly. The high range instructions add 32,768 (8000 hex) to the address argument.