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

<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-30T08:09:06+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=5&amp;t=2595</id>
<entry>
<author><name><![CDATA[le fatumbi]]></name></author>
<updated>2008-05-30T08:09:06+01:00</updated>
<published>2008-05-30T08:09:06+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2595&amp;p=16072#p16072</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2595&amp;p=16072#p16072"/>
<title type="html"><![CDATA[USART Question]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2595&amp;p=16072#p16072"><![CDATA[
<blockquote><div><cite>bergere wrote:</cite><br />So UDR0 is just 4 the motors and the UDR1 for the communication between CM-5 and &quot;Terminal&quot;<br /></div></blockquote><br /><br />Note that UDR1 is used also for zigbee option.<br /><br />You have to manage corresponding i/o pins to select output interface (zigbee/terminal). That should be well initialized by default if you didn't change PORTD configuration.<br /><br />I concerns these pins:<br /><br />Switch to output direction and  to true (1) state these pins to select pc direction:<br />BIT_ZIGBEE_RESET        PortD4;<br />BIT_ENABLE_RXD_LINK_PC  PortD5;<br />BIT_ENABLE_RXD_LINK_ZIGBEE PortD6;<br /><br />switch this one to input direction:<br />BIT_LINK_PLUGIN  Port_D7;<br /><br />a very fast configuration that works : (wrote inAda)<br /><dl class="codebox"><dt>Code: </dt><dd><code>   -------------------------<br />   -- Initialize_Pc_Rs232 --<br />   -------------------------<br /><br />   procedure Initialize_Pc_Rs232 is<br />      BIT_ZIGBEE_RESET           : constant Pin := Port_D4;<br />      BIT_ENABLE_RXD_LINK_PC     : constant Pin := Port_D5;<br />      BIT_ENABLE_RXD_LINK_ZIGBEE : constant Pin := Port_D6;<br />      BIT_LINK_PLUGIN            : constant Pin := Port_D7;<br />   begin<br /><br />      -- Init Port<br />      -- Set output Zigbee and pc control pins;<br />       Switch_Output&#40;BIT_ZIGBEE_RESET&#41;;<br />      -- &#40;switch_Ouput writes 1 in corresponding DDRx&#41;<br />       Switch_Output&#40;BIT_ENABLE_RXD_LINK_PC&#41;;<br />       Switch_Output&#40;BIT_ENABLE_RXD_LINK_ZIGBEE&#41;;<br />       Switch_Input&#40;BIT_LINK_PLUGIN&#41;; --&#40;no pull up&#41;<br />      -- &#40;switch_Input writes 0 in corresponding DDRx&#41;<br /><br />       -- Select pc connection<br />       Output&#40;BIT_ZIGBEE_RESET, true&#41;;<br />       -- &#40;'ouput' writes value in corresponding PORTx&#41;<br />       Output&#40;BIT_ENABLE_RXD_LINK_PC, true&#41;;<br />       Output&#40;BIT_ENABLE_RXD_LINK_ZIGBEE, true&#41;;<br /><br />       -- Init USART 1<br />       Set&#40;UBRR1H, 0&#41;;<br />       Set&#40;UBRR1L, 34&#41;;--Default_Bdr : 56700 bds;<br />       -- &#40;note we disabled interrupt before all initializations... in case of...&#41;<br /><br />       Set&#40;UCSR1C, 16#06#&#41;; -- 8bits, 1 stop, no parity<br /><br />      Set&#40;UCSR1A, 16#02#&#41;;--  Receive Data Bit 8<br /><br />      Set_Bit&#40;UCSR1B, RXCIE1_Bit, false&#41;;-- RxD interrupt disabled<br />      Set_Bit&#40;UCSR1B, RXEN1_Bit, true&#41;;  --  Rx enable<br />      Set_Bit&#40;UCSR1B, TXCIE1_Bit, false&#41;;-- TxD interrupt disabled<br />      Set_Bit&#40;UCSR1B, TXEN1_Bit, true&#41;;  --  Tx enable<br /><br />   end Initialize_Pc_Rs232;<br /></code></dd></dl><br /><br />For a good unitary test, without any doubt on your terminal conf, you can link Rx and Tx together and control that this echoes well... telling the result to a DEL...)<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1012">le fatumbi</a> — Fri May 30, 2008 8:09 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[bergere]]></name></author>
<updated>2008-05-28T10:07:15+01:00</updated>
<published>2008-05-28T10:07:15+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2595&amp;p=16056#p16056</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2595&amp;p=16056#p16056"/>
<title type="html"><![CDATA[USART Question]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2595&amp;p=16056#p16056"><![CDATA[
So UDR0 is just 4 the motors and the UDR1 for the communication between CM-5 and &quot;Terminal&quot;.<br /><br />Thx 4 Help<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=818">bergere</a> — Wed May 28, 2008 10:07 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[limor]]></name></author>
<updated>2008-05-27T16:34:20+01:00</updated>
<published>2008-05-27T16:34:20+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2595&amp;p=16051#p16051</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2595&amp;p=16051#p16051"/>
<title type="html"><![CDATA[USART Question]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2595&amp;p=16051#p16051"><![CDATA[
I trust you are referring to CM5 ?<br /><br />In this case one UART is used to communicate with the AX12 servos and the other, to communicate with PC/Zigbee/Bluetooth.<br /><br />For this type of setup you can find some working example code posted here previously. see the <a href="http://robosavvy.com/site/index.php?option=com_openwiki&amp;Itemid=&amp;id=robotis_bioloid" class="postlink">Bioloid Wiki</a> for links.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=2">limor</a> — Tue May 27, 2008 4:34 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[bergere]]></name></author>
<updated>2008-05-26T13:55:25+01:00</updated>
<published>2008-05-26T13:55:25+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2595&amp;p=16030#p16030</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2595&amp;p=16030#p16030"/>
<title type="html"><![CDATA[USART Question]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2595&amp;p=16030#p16030"><![CDATA[
Hello again,<br /><br />I want to transmit Data via USART. This works fine for UDR1 on my Atmega128. I was surprised that works without any initialisation.<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>void TxD81&#40;byte bTxdData&#41;<br />&#123;<br />  while&#40;!&#40;bit_is_set&#40;UCSR1A,5&#41;&#41;&#41;;<br />  UDR1 = bTxdData;<br />&#125;</code></dd></dl><br /><br />But if i try to use UDR0 it doesn´t work. So i want to initialise UDR0.<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>void USART_Init&#40; unsigned int ubrr &#41;<br />&#123;<br />   /*   Activate USART Transmitter                  */<br />    UCSR0B |= &#40;1&lt;&lt;TXEN0&#41;;<br /><br />   /*   Set 1 Stop Bit                            */<br />    UCSR0C &amp;= ~&#40;1&lt;&lt;USBS0&#41;;      <br />   <br />   <br />   /*   Activate Asynchronus Transfermode            */<br />   UCSR0C &amp;= ~&#40;1&lt;&lt;UMSEL0&#41;;<br />   <br />   /*     Choose Frame Format                                   */<br />   UCSR0C |= &#40;1&lt;&lt;UCSZ00&#41;;             <br />   UCSR0C |= &#40;1&lt;&lt;UCSZ01&#41;;<br />   UCSR0B &amp;= ~&#40;1&lt;&lt;UCSZ02&#41;;<br /><br />   /*   Synchronisation             */<br />    UBRR0H = 0x00;<br />    UBRR0L = 0x22;<br />&#125;</code></dd></dl><br /><br />My UDRR is 34 for Asynchronous Transfer Mode.<br /><br />Question Number 1: Why i havn´t to initalise UDR1???<br />Question Number 2: Is this Initialisation correct? Or do i forgot something?<br />Question Number 3: Maybe UDR0 isn´t Used for Transmitting Data because i found that his UBRRL isn´t correctly defined in the iom128.h file.<br /><br />For example:<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>/* USART0 Baud Rate Register High */<br />#define UBRR0H    _SFR_MEM8&#40;0x90&#41;<br /><br />/* USART0 Control and Status Register C */<br />#define UCSR0C    _SFR_MEM8&#40;0x95&#41;<br /><br />/* USART1 Baud Rate Register High */<br />#define UBRR1H    _SFR_MEM8&#40;0x98&#41;<br /><br />/* USART1 Baud Rate Register Low*/<br />#define UBRR1L    _SFR_MEM8&#40;0x99&#41;<br /><br />/* USART1 Control and Status Register B */<br />#define UCSR1B    _SFR_MEM8&#40;0x9A&#41;<br /><br />/* USART1 Control and Status Register A */<br />#define UCSR1A    _SFR_MEM8&#40;0x9B&#41;<br /><br />/* USART1 I/O Data Register */<br />#define UDR1      _SFR_MEM8&#40;0x9C&#41;<br /><br />/* USART1 Control and Status Register C */<br />#define UCSR1C    _SFR_MEM8&#40;0x9D&#41;</code></dd></dl><br /><br />You can see that there isnt defined the UBRRL and many other things. But in the Atmega 128 Documentation they are listed. For example <br />||$09 ($29)|| UBRR0L USART0 Baud Rate Register Low<br />But it isn´t defined in the iom128.h. Why?<br /><br />OK I hope you understand my problem despite my bad english.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=818">bergere</a> — Mon May 26, 2008 1:55 pm</p><hr />
]]></content>
</entry>
</feed>