Status Packet Decoder¶
Run the Status Packet Decoder MicroSim Fullscreen
You can include this MicroSim on your website using the following iframe:
<iframe src="https://dmccreary.github.io/robot-arm/sims/status-packet-decoder/main.html"
height="562px" width="100%" scrolling="no"></iframe>
Description¶
Click the bytes of a servo reply to see which field each one belongs to. Then classify six replies as a valid reading, a bad checksum, a servo-reported error or not a packet, by checking the header, length, checksum and error byte in order. Used in Chapter 4.
A reply from a servo is only a reading you can trust when four checks pass, in this order: the header is FF FF, the length byte equals the byte count minus 4, the checksum matches the one you work out, and the error byte is 0. The first check that fails decides the class.
Lesson Plan¶
Grade level: Middle school and up (age 12+). Time: 10 to 15 minutes.
- Name the fields. In Explore mode, click each byte of the sample reply
FF FF 01 04 00 18 05 DD. Find the two data bytes and work out why18 05means 1304 steps. - Six replies. For each reply, choose a class and press Check. You get one try for each reply, and 5 of 6 is mastery. You may click a byte to see its field name while you decide.
- Read the feedback. After each answer the four checks are listed with OK or FAILS, and the field that decided the class is outlined.
- Think about it. Reply 5 has a correct checksum. Why must your code still refuse to use it?
The data values in the six replies are illustrative. Reply 1 is the status packet worked through in Chapter 4.
Specification¶
The learning objective, evidence of mastery and content for this MicroSim are specified in Chapter 4: Serial and CAN Communication.