<?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=2637" />

<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-06-17T21:07:10+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=5&amp;t=2637</id>
<entry>
<author><name><![CDATA[JonHylands]]></name></author>
<updated>2008-06-17T21:07:10+01:00</updated>
<published>2008-06-17T21:07:10+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2637&amp;p=16374#p16374</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2637&amp;p=16374#p16374"/>
<title type="html"><![CDATA[Mega168 -&gt; AX-12 serial problem]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2637&amp;p=16374#p16374"><![CDATA[
You can talk to the bus using the internal oscillator at 8 MHz.<br /><br />You don't say how you've got the ATmega168's Rx pin hooked up... Without that, we can't really help you...<br /><br />- Jon<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=373">JonHylands</a> — Tue Jun 17, 2008 9:07 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Miamicanes]]></name></author>
<updated>2008-06-17T15:50:54+01:00</updated>
<published>2008-06-17T15:50:54+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2637&amp;p=16370#p16370</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2637&amp;p=16370#p16370"/>
<title type="html"><![CDATA[Mega168 -&gt; AX-12 serial problem]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2637&amp;p=16370#p16370"><![CDATA[
OK, now that I've gotten outbound transmissions to work, I'm tackling the responses. Obviously, it's not working <img src="http://forum.robosavvy.com/images/smilies/icon_wink.gif" alt=";-)" title="Wink" /><br /><br />One possible issue I'm looking at is clock drift. Is the AVR's built-in 8MHz oscillator reliable enough to handle 1mbps double-speed USART transmission? Or do I really need to use a crystal, and possibly jack up the speed to 16MHz so I won't have to rely on double-speed mode?<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=456">Miamicanes</a> — Tue Jun 17, 2008 3:50 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Miamicanes]]></name></author>
<updated>2008-06-17T01:35:50+01:00</updated>
<published>2008-06-17T01:35:50+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2637&amp;p=16354#p16354</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2637&amp;p=16354#p16354"/>
<title type="html"><![CDATA[Mega168 -&gt; AX-12 serial problem]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2637&amp;p=16354#p16354"><![CDATA[
OK, it's working now. I forgot the damn NOT operation after adding up the values and taking the lower 8 bits. For future reference if anyone's interested or has the same problem...<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>.include &quot;m168def.inc&quot;<br /><br />.def rTemp = r16<br />.def rValue = r17<br /><br /><br />rjmp RESET<br /><br />.org 0x34<br />RESET:<br /><br />   ldi rTemp, HIGH&#40;RAMEND&#41;<br />   out SPH, rTemp<br />   ldi rTemp, LOW&#40;RAMEND&#41;<br />   out SPL, rTemp<br /><br />   sbi DDRB, 0<br />   sbi PORTB, 0<br /><br />   ldi r20, 0x40<br />   pausing:<br />      ser xh<br />      ser xl<br />      delaying:<br />         sbiw xh:xl, 1<br />         brne delaying<br />      dec r20<br />      brne pausing<br />; initialize the serial port<br />   ; set baudrate to 1mbps &#40;requires setting UCSR0A.U2X0 as well&#41;<br />   clr rTemp<br />   sts 0xc5, rTemp ; 0xc5 = UBRR0H<br />   sts 0xc4, rTemp ; 0xc4 = UBRR0L<br /><br />   ldi rTemp, 2 ; bit 1 is U2X0<br />   sts 0xc0, rTemp ; 0xc0 = UCSR0A<br /><br />   ldi rTemp, 8 ; bit 3 is TXEN0<br />   sts 0xc1, rTemp ; 0xc1 = UCSR0B<br /><br />   ldi rTemp, 6 ;&#40;8-bit, no parity, 1 stopbit&#41;<br />   sts 0xc2, rTemp ; 0xc2 = UCSR0C<br /><br />; send datagram to make buzzer in AX-S1 beep once<br />; 0xff 0xff 0x64 0x04 0x03 0x28 0x10 &#40;0x64 + 0x04 + 0x03 + 0x28 + 0x10&#41;<br /><br />   ser rValue<br />   rcall sendValue<br /><br />   ser rValue<br />   rcall sendValue<br /><br />   ldi rValue, 0xfe ; broadcast to everyone<br />   rcall sendValue<br />   <br />   ldi rValue, 0x04 ; 1 databyte to write + 3 = 4<br />   rcall sendValue<br /><br />   ldi rValue, 0x03 ; WRITE_DATA<br />   rcall sendValue<br /><br />   ldi rValue, 0x19 ; write to 0x19 &#40;LED&#41;<br />   rcall sendValue<br /><br />   ldi rValue, 0x1 ; value to write to 0x19 &#40;1 = on, 0 = off&#41;<br />   rcall sendValue<br /><br />   ldi rValue, 0xe0<br />   rcall sendValue<br /><br />   clr rTemp<br />   sts 0xc1, rTemp ; clear TXEN0 in UCSR0B<br /><br />LOOP:<br />   rjmp LOOP<br /><br />sendValue:<br />   cbi PORTB, 0<br />   lds rTemp, 0xc0 ; 0xc0 is UCSR0A<br />   sbrs rTemp, 5 ; bit 5 is UDRE0<br />   rjmp sendValue<br />   sts 0xc6, rValue ; 0xc6 is UDR0<br />   sbi PORTB, 0<br />   ret<br /><br /><br /></code></dd></dl><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=456">Miamicanes</a> — Tue Jun 17, 2008 1:35 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Miamicanes]]></name></author>
<updated>2008-06-17T00:03:51+01:00</updated>
<published>2008-06-17T00:03:51+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2637&amp;p=16352#p16352</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2637&amp;p=16352#p16352"/>
<title type="html"><![CDATA[Mega168 -&gt; AX-12 serial problem]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2637&amp;p=16352#p16352"><![CDATA[
A little while ago, I connected a Mega168 to an AX-S1 as follows:<br /><br />* bus ground to AVR ground (cm5's ground)<br /><br />* AVR TXD to bus data (cm5's data not connected to anything, AVR's TXD connected to AX-S1's data pin )<br /><br />* bus +9.6v to 5v regulator (cm5's output to regulator)<br /><br />and wrote a short program that basically initialized the USART to double-speed, 1mbps (UBRR0H:L = 0:0), no pairity, 1 stop bit, and sent the following datagram to the AX-S1:<br /><br />0xFF 0xFF (prelude)<br />0x64 (recipient = address 100)<br />0x04 (length = 2 argument bytes + 2)<br />0x03 (write data)<br />0x28 (buzzer frequency)<br />0x10 (16 = buzzer index)<br />0xA3 ((0x64 + 0x04 + 0x03 + 0x28 + 0x10) &amp;&amp; 0xff )<br /><br />Nothing happened. About an hour earlier, I verified that writing 0x10 to register 0x28 on the device with address=0x64 DID produce a tone using robot terminal. <br /><br />At this point, I'm trying to figure out where I went wrong, starting with the easy/obvious things...<br /><br />a) Did I get the datagram right, including the checksum?<br /><br />b) If the AVR is 5v, do I have to do anything special with the output of its TXD pin (not counting half-duplex switching, of course... right now I'm just trying to get an experiment involving a one-way broadcast that produces an observable result to work before moving on to worry about the half-duplex issues)<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=456">Miamicanes</a> — Tue Jun 17, 2008 12:03 am</p><hr />
]]></content>
</entry>
</feed>