<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="http://forum.robosavvy.com/feed.php?f=5&amp;t=2576" />

<title>RoboSavvy Forum</title>
<subtitle>Robosavvy Forum: The largest online community of Humanoid Robot Builders</subtitle>
<link href="http://forum.robosavvy.com/index.php" />
<updated>2008-05-23T20:13:02+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=5&amp;t=2576</id>
<entry>
<author><name><![CDATA[MoSin]]></name></author>
<updated>2008-05-23T20:05:32+01:00</updated>
<published>2008-05-23T20:05:32+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15982#p15982</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15982#p15982"/>
<title type="html"><![CDATA[Re: Serial protocol]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15982#p15982"><![CDATA[
<blockquote><div><cite>JonHylands wrote:</cite><br /><blockquote><div><cite>MoSin wrote:</cite>when you say &quot;how you're talking to the bus&quot;, what do you mean by that jon??<br /></div></blockquote><br /><br />Whether you are connected to the bus from a PC through a USB interface like the one I sell, or through a CM-5 in toss mode, or directly using a micro-controller.<br /><br />- Jon</div></blockquote><br /><br />would there be a huge difference between a ucontroller and the CM-5??<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=667">MoSin</a> — Fri May 23, 2008 8:05 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Miamicanes]]></name></author>
<updated>2008-05-23T20:13:02+01:00</updated>
<published>2008-05-23T20:03:44+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15981#p15981</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15981#p15981"/>
<title type="html"><![CDATA[Serial protocol]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15981#p15981"><![CDATA[
Well, in case anyone's wondering, my eventual goal is to design an interface board for the SunSPOT. It's just about the most perfect application for a SunSPOT that you could dream up... they even have almost plug 'n play wireless firmware deployment (connect one SPOT to your PC, and once you get it configured, you can use it to wirelessly deploy new firmware to ANOTHER SPOT). The problem is, the current serial routines aren't quite up to the task of directly communicating with an AX12 at 1mbit/sec, even though the interface board ITSELF is a Mega88. So... here's my tentative plan:<br /><br />Phase 1:<br /><br />* Get a Mega168 to successfully send hardwired datagrams to an AX-12 (baby step #1)<br /><br />* Get it to successfully ping an AX-12 (baby step #2)<br /><br />* Get it to successfully poll the Bioloid's sensor module (baby step #3)<br /><br />Phase 2:<br /><br />* Create an interface board w/Mega168 and CP2103 usb-to-serial interface (from Sparkfun) that buffers a complete datagram, sends it to the AX12 bus at 1mbit/sec, receives the response, and sends it out the CP2103<br /><br />* Get it to work with the SunSPOT's sensorboard serial.<br /><br />Phase 3:<br /><br />* Get it to work via SPI instead of serial. At this point, I'll really, REALLY be wishing I had a SunSPOT protoboard that does nothing but directly expose the ARM9's SPI (I thought about trying to make one, but suspect that I'd never, EVER be able to get the high-density surface mount interboard connector hand-soldered to a PC board because it doesn't look like it would &quot;float&quot; into position via surface tension the way a SOIC or TQFP IC does.)<br /><br />* port it to the Mega88 interface board Sun sent me a few months ago &amp; I haven't really had a lot of time to play with yet<br /><br />I actually made a fair amount of headway last summer, but then I got massively sidetracked for a few weeks at work, and spent the last 3 months or so of 2007 working on my string of networked <a href="http://devnullfoo.com/xmaslights.mpg" class="postlink">RGB christmas lights</a> <img src="http://forum.robosavvy.com/images/smilies/icon_wink.gif" alt=";-)" title="Wink" /><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=456">Miamicanes</a> — Fri May 23, 2008 8:03 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[StuartL]]></name></author>
<updated>2008-05-23T19:53:36+01:00</updated>
<published>2008-05-23T19:53:36+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15978#p15978</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15978#p15978"/>
<title type="html"><![CDATA[Re: Serial protocol]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15978#p15978"><![CDATA[
<blockquote><div><cite>JonHylands wrote:</cite><br /><blockquote><div><cite>MoSin wrote:</cite>when you say &quot;how you're talking to the bus&quot;, what do you mean by that jon??<br /></div></blockquote><br /><br />Whether you are connected to the bus from a PC through a USB interface like the one I sell, or through a CM-5 in toss mode, or directly using a micro-controller.<br /><br />- Jon</div></blockquote><br /><br />Ok, I'll clarify my previous post:<br /><br />1) I cocked up on the 250us/500us thing, sorry about that.<br /><br />2) I was talking about direct from the microcontroller.  Certainly if you're sending from a PC via serial through the CM5 in toss mode all bets are off <img src="http://forum.robosavvy.com/images/smilies/icon_smile.gif" alt=":)" title="Smile" /><br /><br />Thanks to Jon for spotting my error without gloating <img src="http://forum.robosavvy.com/images/smilies/icon_biggrin.gif" alt=":D" title="Very Happy" /><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=645">StuartL</a> — Fri May 23, 2008 7:53 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[JonHylands]]></name></author>
<updated>2008-05-23T19:23:52+01:00</updated>
<published>2008-05-23T19:23:52+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15977#p15977</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15977#p15977"/>
<title type="html"><![CDATA[Re: Serial protocol]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15977#p15977"><![CDATA[
<blockquote><div><cite>MoSin wrote:</cite><br />when you say &quot;how you're talking to the bus&quot;, what do you mean by that jon??<br /></div></blockquote><br /><br />Whether you are connected to the bus from a PC through a USB interface like the one I sell, or through a CM-5 in toss mode, or directly using a micro-controller.<br /><br />- Jon<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=373">JonHylands</a> — Fri May 23, 2008 7:23 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[MoSin]]></name></author>
<updated>2008-05-23T15:02:53+01:00</updated>
<published>2008-05-23T15:02:53+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15970#p15970</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15970#p15970"/>
<title type="html"><![CDATA[Re: Serial protocol]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15970#p15970"><![CDATA[
when you say &quot;how you're talking to the bus&quot;, what do you mean by that jon??<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=667">MoSin</a> — Fri May 23, 2008 3:02 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[JonHylands]]></name></author>
<updated>2008-05-23T14:51:09+01:00</updated>
<published>2008-05-23T14:51:09+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15969#p15969</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15969#p15969"/>
<title type="html"><![CDATA[Re: Serial protocol]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15969#p15969"><![CDATA[
<blockquote><div><cite>StuartL wrote:</cite><br />The factory standard turnaround time for the servos is supposed to be 250uS.  At a bit rate of 1mbit a single byte will take approx 10uS to transmit.  If you got to a millisecond without receiving a single byte I think it's safe to assume something bad happened.<br /></div></blockquote><br /><br />Actually, that's not quite true. The control table registry defaults to 250, but the actual delay is 2 * value, or 500 us.<br /><br />However, depending on how you're talking to the bus, there can be far greater sources of latency than that.<br /><br />- Jon<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=373">JonHylands</a> — Fri May 23, 2008 2:51 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[StuartL]]></name></author>
<updated>2008-05-23T14:41:45+01:00</updated>
<published>2008-05-23T14:41:45+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15968#p15968</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15968#p15968"/>
<title type="html"><![CDATA[Re: Serial protocol]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15968#p15968"><![CDATA[
<blockquote><div><cite>Miamicanes wrote:</cite><br />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?<br /></div></blockquote><br /><br />The factory standard turnaround time for the servos is supposed to be 250uS.  At a bit rate of 1mbit a single byte will take approx 10uS to transmit.  If you got to a millisecond without receiving a single byte I think it's safe to assume something bad happened.<br /><br /><blockquote class="uncited"><div><br />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?<br /></div></blockquote><br /><br />I don't know about &quot;must&quot;, but we're not actually waiting at all between packets.  As soon as we get a valid reply the next packet is retrieved from the buffer and queued for transmission.  Turnaround time is probably pretty quick, maybe 8-64 cycles (wild guesses) so we're probably waiting a small number of microseconds before each transmission.<br /><br /><blockquote class="uncited"><div><br />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:<br /><br />0xff 0xff 0xfe 0xf0 0x69 <br />0xff 0xff 0x04 0x03 0x01 0x??<br />(timeout)<br /><br />... with no pause between the first and second group. Humor me for a moment and pretend the second line is the proper datagram for &quot;ping device #4&quot;, even though I probably butchered the length and/or checksum values <img src="http://forum.robosavvy.com/images/smilies/icon_wink.gif" alt=";-)" title="Wink" /><br /></div></blockquote><br /><br />Assuming the AX12 finds the start of the first packet I presume (though it is presumption) that it'll pick up the length and wait/checksum the packet before looking for the next frame-start.<br /><br /><blockquote class="uncited"><div><br />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:<br /><br />0xff, 0xff, 0xfe, 0x??, (20 bytes... command byte, 18 arg bytes, checksum byte<br /><br />would 0x?? be 0x14, 0x15, 0x16, or 0x18?<br /></div></blockquote><br /><br />I always remember the length field being the total frame length - 4.  i.e. Payload length, not frame length.<br /><br /><blockquote class="uncited"><div><br />does the checksum include the value of the length byte? the id byte? the two leading 0xff bytes?<br /></div></blockquote><br /><br />Jon's already picked this one up <img src="http://forum.robosavvy.com/images/smilies/icon_smile.gif" alt=":)" title="Smile" /><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=645">StuartL</a> — Fri May 23, 2008 2:41 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[JonHylands]]></name></author>
<updated>2008-05-23T10:07:22+01:00</updated>
<published>2008-05-23T10:07:22+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15964#p15964</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15964#p15964"/>
<title type="html"><![CDATA[Re: Serial protocol]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15964#p15964"><![CDATA[
<blockquote><div><cite>Miamicanes wrote:</cite><br />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?<br /></div></blockquote><br /><br />I generally set my response timeout at 20 ms. It really depends on how much potential latency there is between the master and the bus. If you're using an ATmega168 directly on the bus, there should be no latency, so probably 5-10 ms would suffice.<br /><br /><blockquote><div><cite>Miamicanes wrote:</cite><br />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?<br /></div></blockquote><br /><br />I generally wait a couple ms in that case.<br /><br /><blockquote><div><cite>Miamicanes wrote:</cite><br />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:<br /><br />0xff 0xff 0xfe 0xf0 0x69 <br />0xff 0xff 0x04 0x03 0x01 0x??<br />(timeout)<br /><br />... with no pause between the first and second group. Humor me for a moment and pretend the second line is the proper datagram for &quot;ping device #4&quot;, even though I probably butchered the length and/or checksum values <img src="http://forum.robosavvy.com/images/smilies/icon_wink.gif" alt=";-)" title="Wink" /><br /><br />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?<br /></div></blockquote><br /><br />No idea, sorry. <br /><br /><blockquote><div><cite>Miamicanes wrote:</cite><br />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:<br /><br />0xff, 0xff, 0xfe, 0x??, (20 bytes... command byte, 18 arg bytes, checksum byte<br /><br />would 0x?? be 0x14, 0x15, 0x16, or 0x18?<br /><br />does the checksum include the value of the length byte? the id byte? the two leading 0xff bytes?<br /><br />Thanks <img src="http://forum.robosavvy.com/images/smilies/icon_smile.gif" alt=":)" title="Smile" /><br /></div></blockquote><br /><br />The checksum is calculated on everything except the two leading 0xFF's...<br /><br />- Jon<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=373">JonHylands</a> — Fri May 23, 2008 10:07 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Miamicanes]]></name></author>
<updated>2008-05-22T21:21:47+01:00</updated>
<published>2008-05-22T21:21:47+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15957#p15957</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15957#p15957"/>
<title type="html"><![CDATA[Serial protocol]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2576&amp;p=15957#p15957"><![CDATA[
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?<br /><br />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?<br /><br />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:<br /><br />0xff 0xff 0xfe 0xf0 0x69 <br />0xff 0xff 0x04 0x03 0x01 0x??<br />(timeout)<br /><br />... with no pause between the first and second group. Humor me for a moment and pretend the second line is the proper datagram for &quot;ping device #4&quot;, even though I probably butchered the length and/or checksum values <img src="http://forum.robosavvy.com/images/smilies/icon_wink.gif" alt=";-)" title="Wink" /><br /><br />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?<br /><br />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:<br /><br />0xff, 0xff, 0xfe, 0x??, (20 bytes... command byte, 18 arg bytes, checksum byte<br /><br />would 0x?? be 0x14, 0x15, 0x16, or 0x18?<br /><br />does the checksum include the value of the length byte? the id byte? the two leading 0xff bytes?<br /><br />Thanks <img src="http://forum.robosavvy.com/images/smilies/icon_smile.gif" alt=":)" title="Smile" /><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=456">Miamicanes</a> — Thu May 22, 2008 9:21 pm</p><hr />
]]></content>
</entry>
</feed>