Hi All, This is the ROBOTIS Technical Support Team,
I would like to share how the Byte Stuffing work in DYNAMIXEL with very simple example.
According to the explanation on Byte Stuffing in e-Manual, it says
Processing Order of Transmission
- Generate basic form of Packet and afterwards Byte Stuffing(0xFD)
- Inspection range : Everything within the Instruction field to the Parameter field (not the CRC)
- Processing method : When the pattern “0xFF 0xFF 0xFD” appears, add Byte Stuffing (0xFD) (If “0xFF 0xFF 0xFD” already exists, add a 0xFD to change it to “0xFF 0xFF 0xFD 0xFD”)
Here is the brief example I did for you to understand the DYNAMIXEL Byte Stuffing.
- To produce the example simply, I linked Goal Position (Extended Position Control Mode(Multi-turn)) and Goal Current by Indirect Address
The rule of constructing packet is Littile Endian, which put the LSB first and MSB if simply describing. The address 224 to 229 reference the corresponding address of Indirect Address.
Let’s send 0XFF | 0XFF | 0XFF | 0XFF | 0XFD | 0X01and see how the packet structure is actually constructed.
- As e-Manual described, you can see
FDis actually stuffed between “Header” look-like packets in order to avoid embarrassing situation by the hader look-like !