Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
usp:usp_spec [2012/10/18 18:18] – [USP configuration file] mnovak | usp:usp_spec [2012/12/04 19:31] – admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== USP serial protocol ====== | ====== USP serial protocol ====== | ||
- | USP is a serial communication protocol. The protocol is register based with 4 basic commands. Each protocol message contains Command ID, 2 levels | + | USP is a serial communication protocol. The protocol is register based with 4 basic commands. Each protocol message contains Command ID, 1 or 2 bytes of ModuleID used for device |
- | The protocol is designed for communication between one master and multiple slaves. Typically the host (master) communicates with a device(slave) over serial connection. The connection can be wired: RS232, RS485, Ethernet or wireless: Zig-Bee, 802.11(Wi-Fi) etc. | + | The protocol is designed for communication between one master and multiple slaves. Typically the PC host (master) communicates with a device(slave) over serial connection. The connection can be wired: RS232, RS485, Ethernet or wireless: Zig-Bee, 802.11(Wi-Fi) etc. |
+ | |||
+ | ===== Terminology ===== | ||
+ | |||
+ | * Master - the device issuing commands. Master is running USP client software. Master is identified by | ||
+ | * Slave - the device listening for USP commands. Slave is running USP server software. | ||
===== Default RS232 and RS485 interface Communication Parameters ===== | ===== Default RS232 and RS485 interface Communication Parameters ===== | ||
Line 18: | Line 23: | ||
===== Generic Command format ===== | ===== Generic Command format ===== | ||
All commands are referenced from the Master to the Slave where the Master is the host PC or an embedded controlling program, which issues the commands to the slave - PIC microcontroller based module which carries out the command. The format of the commands is described below. | All commands are referenced from the Master to the Slave where the Master is the host PC or an embedded controlling program, which issues the commands to the slave - PIC microcontroller based module which carries out the command. The format of the commands is described below. | ||
+ | |||
==== Master -> Slave Command Format ==== | ==== Master -> Slave Command Format ==== | ||
^ | ^ | ||
- | ^ Command Word 1 (required) | + | ^ Command Word 1 (required) |
^ Command Word 2 (Optional) | ^ Command Word 2 (Optional) | ||
^ Command Word 3 (Optional) | ^ Command Word 3 (Optional) | ||
Line 36: | Line 42: | ||
^ | ^ | ||
- | ^ Response Word 1 (required) | + | ^ Response Word 1 (required) |
^ Response Word 2 (Optional) | ^ Response Word 2 (Optional) | ||
^ Response Word 3 (Optional) | ^ Response Word 3 (Optional) | ||
Line 57: | Line 63: | ||
===== Addressing ===== | ===== Addressing ===== | ||
- | Addess of the slave is carried in each packet in fields | + | Addess of the slave is carried in each packet in fields |
The use of addreses is application dependent but should adhere to the following rules: | The use of addreses is application dependent but should adhere to the following rules: | ||
*Address 0 is the address of the device directly attached to the master | *Address 0 is the address of the device directly attached to the master | ||
*Address 255 is the broadcast address, all devices will execute the command | *Address 255 is the broadcast address, all devices will execute the command | ||
- | *In multi-layer network the Slave module ID-Hi is the layer closer to the master | + | *In multi-layer |
===== Timeouts ===== | ===== Timeouts ===== | ||
Line 362: | Line 368: | ||
< | < | ||
- | Command | + | Command |
</ | </ | ||
Line 368: | Line 374: | ||
List of commands: | List of commands: | ||
^ Config name ^ Parameters | ^ Config name ^ Parameters | ||
- | | SR | DeviceID | + | | SR | ModuleID |
- | | GR | DeviceID | + | | GR | ModuleID |
- | | SB | DeviceID | + | | SB | ModuleID |
- | | GB | DeviceID | + | | GB | ModuleID |
| DELAY | Value((ms)) | | DELAY | Value((ms)) | ||