SANPO USB to RS485
SANPO USB to RS485 lets a PC select one of RS485-1/2/3/4. The host appends a Channel, data length, and tail to the raw device command. The board forwards the raw command to the selected RS485 interface. This protocol is suitable for high-rate real-time control.
Use V47 or later firmware. To send unwrapped RS485 data directly, use RS485 Raw Passthrough. Raw passthrough requires at least 3 ms with no data between commands; use the SANPO wrapped protocol on this page for continuous high-rate control.
Connection and Communication Settings
A complete board normally exposes two USB serial ports. One controls RS485-1 and RS485-2, and the other controls RS485-3 and RS485-4. COM or /dev/ttyACM* numbering may not follow board silkscreen order. For first use, connect only one RS485 device to identify the correct port.
When opening the USB serial port, match the device bitrate, stop bits, parity, and data bits. These settings apply to both RS485 channels controlled by the current port. Factory defaults are 4 Mbps, one stop bit, no parity, and eight data bits. See RS485 Raw Passthrough to save default settings.
Select an RS485 Channel
Interfaces controlled by the current USB port |
Channel |
Target |
|---|---|---|
RS485-1, RS485-2 |
|
RS485-1 |
RS485-1, RS485-2 |
|
RS485-2 |
RS485-3, RS485-4 |
|
RS485-3 |
RS485-3, RS485-4 |
|
RS485-4 |
Either USB port |
|
Both RS485 channels controlled by the current port |
Transmit Frame
Each USB frame contains:
Field |
Length |
Description |
|---|---|---|
Raw RS485 data |
0 to 60 bytes |
Complete command defined by the device manufacturer |
Channel |
1 byte |
RS485 interface number |
Data length |
1 byte |
Raw-data length, excluding Channel, length, and tail |
Tail |
2 bytes |
Fixed |
Send a 17-byte Unitree motor command on Channel 2:
FE EE 11 00 00 00 00 00 00 00 00 00 00 00 00 18 7C 02 11 0D 0A
02 is the Channel, and 11 is hexadecimal for 17 bytes.
Unitree GO-M8010 Example
Example: USB to RS485 Unitree motor
Windows:
python usb2rs485_unitree_sine_demo_v4.py --port COM9 --motors 1 --channel 2
Linux:
sudo python3 usb2rs485_unitree_sine_demo_v4.py --port /dev/ttyACM0 --motors 1 --channel 2
Update the serial port, RS485 channel, and motor ID to match the wiring. The example defaults to 4 Mbps, one stop bit, no parity, and eight data bits.
Troubleshooting
Symptom |
Action |
|---|---|
No USB serial port |
Check the cable, driver, and connector, then reconnect the board |
Command is sent on both RS485 channels |
Channel |
Device does not reply |
Check serial settings, Channel, device ID, command length, checksum, A/B wiring, and device power |
USB port is busy |
Close other serial or host applications using the port |