by Miamicanes » Thu May 22, 2008 9:21 pm
by Miamicanes
Thu May 22, 2008 9:21 pm
Suppose a controller I've made based on an Atmel Mega168 has just transmitted a valid datagram to the Dynamixel serial bus that's supposed to return a response. How long MUST I wait for that response after the final bit of the checksum byte has been transmitted before I can legitimately assume that something went wrong, there isn't going to BE a response, and I should go ahead and handle it as a communications error?
Likewise, after I've received all the bytes of a response datagram and validated the final checksum byte, how long MUST I wait before I can legitimately send the first byte of the next datagram?
Also, is the parse strategy followed by the AX12's controller defined for ambiguous situations where a valid datagram (header to checksum) is found IN THE MIDDLE of what's allegedly an even longer datagram? For example, take the following sequence of bytes:
0xff 0xff 0xfe 0xf0 0x69
0xff 0xff 0x04 0x03 0x01 0x??
(timeout)
... with no pause between the first and second group. Humor me for a moment and pretend the second line is the proper datagram for "ping device #4", even though I probably butchered the length and/or checksum values
WOULD device #4 even interpret the ping datagram? Or, upon realizing it was told to expect 0xf0 bytes and timed out before then, would it dump the entire buffer as invalid? Would it simply dump everything up to the NEXT 0xff 0xff... sequence it found in the buffer (line 2), then parse it again? Would it even HAVE to time out, or would it realize it had a valid datagram on its hands (addressed to it, proper length, valid checksum) by virtue of recursively parsing the entire buffer after each and every new byte were appended to the end?
Also, if someone could refresh my memory (it's been about 7 months since the last time I worked on this), if I send the following bytes:
0xff, 0xff, 0xfe, 0x??, (20 bytes... command byte, 18 arg bytes, checksum byte
would 0x?? be 0x14, 0x15, 0x16, or 0x18?
does the checksum include the value of the length byte? the id byte? the two leading 0xff bytes?
Thanks
Suppose a controller I've made based on an Atmel Mega168 has just transmitted a valid datagram to the Dynamixel serial bus that's supposed to return a response. How long MUST I wait for that response after the final bit of the checksum byte has been transmitted before I can legitimately assume that something went wrong, there isn't going to BE a response, and I should go ahead and handle it as a communications error?
Likewise, after I've received all the bytes of a response datagram and validated the final checksum byte, how long MUST I wait before I can legitimately send the first byte of the next datagram?
Also, is the parse strategy followed by the AX12's controller defined for ambiguous situations where a valid datagram (header to checksum) is found IN THE MIDDLE of what's allegedly an even longer datagram? For example, take the following sequence of bytes:
0xff 0xff 0xfe 0xf0 0x69
0xff 0xff 0x04 0x03 0x01 0x??
(timeout)
... with no pause between the first and second group. Humor me for a moment and pretend the second line is the proper datagram for "ping device #4", even though I probably butchered the length and/or checksum values
WOULD device #4 even interpret the ping datagram? Or, upon realizing it was told to expect 0xf0 bytes and timed out before then, would it dump the entire buffer as invalid? Would it simply dump everything up to the NEXT 0xff 0xff... sequence it found in the buffer (line 2), then parse it again? Would it even HAVE to time out, or would it realize it had a valid datagram on its hands (addressed to it, proper length, valid checksum) by virtue of recursively parsing the entire buffer after each and every new byte were appended to the end?
Also, if someone could refresh my memory (it's been about 7 months since the last time I worked on this), if I send the following bytes:
0xff, 0xff, 0xfe, 0x??, (20 bytes... command byte, 18 arg bytes, checksum byte
would 0x?? be 0x14, 0x15, 0x16, or 0x18?
does the checksum include the value of the length byte? the id byte? the two leading 0xff bytes?
Thanks