Addressing on the servo bus
Also available in: Català · Castellano
The idea
On the SO-101 arm, the Feetech STS3215 servos share a half-duplex serial bus: a single data line, and the servos take turns to talk. Each servo has an ID stored in its EEPROM, which survives without power.
The packet
FF FF | ID | LEN | INST | parameters | CHK
LEN= number of parameters + 2.CHK= bitwise NOT of the sumID + LEN + INST + parameters(low byte).
Example: PING to servo 1 → FF FF 01 02 01 FB, because ~(1 + 2 + 1) = 0xFB.
Rules
- Every servo hears every packet; only the one with that ID replies.
- ID 254 = broadcast: all of them execute it and none replies.
- Valid IDs are 0 to 253; in practice the limit is set by the power supply and the bus speed.
- A new servo ships with ID 1. Two servos with the same ID reply at once and collide; that’s why you connect only one at a time when configuring them.
In the demo
Tick “two servos with ID 1” to see the collision, try the broadcast and an ID that nobody has (timeout).
Common questions
Why half-duplex? It saves wires: one line for everyone. The trade-off is that they can’t talk at the same time.
Interactive demo
Related concepts
How chips talk (UART, I2C, SPI, CAN)
A bus is a set of shared wires. Each protocol has its own way of deciding who talks, to whom and when: UART point to point, I2C by address, SPI with a select wire and CAN by message ID.
How motors work
Current inside a magnetic field = force. Three families depending on what switches the current: brushes (DC), a controller that counts steps (stepper) or electronics that read the rotor (brushless).