<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=4&amp;t=5566&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2014-01-16T17:54:47+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=5566&amp;mode</id>
<entry>
<author><name><![CDATA[ntw]]></name></author>
<updated>2014-01-16T17:54:47+01:00</updated>
<published>2014-01-16T17:54:47+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65252#p65252</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65252#p65252"/>
<title type="html"><![CDATA[Re: RS232 echo]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65252#p65252"><![CDATA[
Zabrakło ustawienia bitu  UCSRC|=(1&lt;&lt;URSEL);<br />Teraz działa.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2322">ntw</a> — 16 sty 2014, o 17:54</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[xor]]></name></author>
<updated>2014-01-16T17:12:50+01:00</updated>
<published>2014-01-16T17:12:50+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65240#p65240</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65240#p65240"/>
<title type="html"><![CDATA[Re: RS232 echo]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65240#p65240"><![CDATA[
<div class="quotetitle">Janadamis napisał(a):</div><div class="quotecontent"><br />Co to robi w kodzie funkcji?[syntax=c]#include &lt;util/setbaud.h&gt;[/syntax]Zawsze umieszczamy na samej górze kodu.<br /></div><br /><br />Akuratnie tę inkluzję umieszczać można w środku kodu i to nie raz. Cytuję za manualem avrlibc: &quot;Including this header file causes no other side effects so it is possible to include this file more than once (supposedly, with different values for the BAUD parameter), possibly even within the same function.&quot; <a href="http://nongnu.org/avr-libc/user-manual/group__util__setbaud.html"  class="postlink">http://nongnu.org/avr-libc/user-manual/group__util__setbaud.html</a><br />Tak na marginesie użycie tych makr uwalnia od pamiętania wzoru na UBRR i zastanawiania się, który z nich jest prawidłowy i dlaczego <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";-)" title="Puszcza oko" />.<br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: 10 minutach ]</span></strong><br /><br /><div class="quotetitle">ntw napisał(a):</div><div class="quotecontent"><br />(1&lt;&lt;RXCIE)<br /></div><br /><br />To chyba niepotrzebne?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1774">xor</a> — 16 sty 2014, o 17:12</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[ntw]]></name></author>
<updated>2014-01-16T16:34:42+01:00</updated>
<published>2014-01-16T16:34:42+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65239#p65239</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65239#p65239"/>
<title type="html"><![CDATA[Re: RS232 echo]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65239#p65239"><![CDATA[
zmieniłem<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2322">ntw</a> — 16 sty 2014, o 16:34</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Janadamis]]></name></author>
<updated>2014-01-16T16:33:42+01:00</updated>
<published>2014-01-16T16:33:42+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65238#p65238</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65238#p65238"/>
<title type="html"><![CDATA[Re: RS232 echo]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65238#p65238"><![CDATA[
Ok 8Mhz a zmieniłeś fusebity czy tylko w opcjach wpisałeś 8Mhz? Domyślnie każdy ma 1Mhz.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=288">Janadamis</a> — 16 sty 2014, o 16:33</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[ntw]]></name></author>
<updated>2014-01-16T16:32:23+01:00</updated>
<published>2014-01-16T16:32:23+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65236#p65236</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65236#p65236"/>
<title type="html"><![CDATA[Re: RS232 echo]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65236#p65236"><![CDATA[
taktowanie 8Mhz<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2322">ntw</a> — 16 sty 2014, o 16:32</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Janadamis]]></name></author>
<updated>2014-01-16T16:32:28+01:00</updated>
<published>2014-01-16T16:29:58+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65235#p65235</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65235#p65235"/>
<title type="html"><![CDATA[Re: RS232 echo]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65235#p65235"><![CDATA[
Tak na początek to:<br />Jakie masz ustawione taktowanie uC?<br />Zapamiętaj że nigdy nie definiujemy taktowania w kodzie!!<br />[syntax=c]#define F_CPU 8000000UL[/syntax]<br /><br />Co to robi w kodzie funkcji?<br />[syntax=c]#include &lt;util/setbaud.h&gt;[/syntax]<br />Zawsze umieszczamy na samej górze kodu.<br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: 2 minutach ]</span></strong><br /><br />Ledwo co zacząłem pisać a tu już wyprzedzony. <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=288">Janadamis</a> — 16 sty 2014, o 16:29</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[ntw]]></name></author>
<updated>2014-01-16T16:29:51+01:00</updated>
<published>2014-01-16T16:29:51+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65234#p65234</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65234#p65234"/>
<title type="html"><![CDATA[Re: RS232 echo]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65234#p65234"><![CDATA[
Rozumiem zagadnienie ale z lenistwa nie chce mi się tego zmieniać, bede o tym pamietał pisząc tu kolejne posty <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2322">ntw</a> — 16 sty 2014, o 16:29</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2014-01-16T16:25:43+01:00</updated>
<published>2014-01-16T16:25:43+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65233#p65233</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65233#p65233"/>
<title type="html"><![CDATA[Re: RS232 echo]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65233#p65233"><![CDATA[
pierwsze co to WYWAL proszę to z kodu:<br /><br /><span style="color: #FF0000"><em>#define F_CPU 8000000UL</em></span><br /><br />szczególnie na naszym forum - ok ? bo tępię to jak nie wiem - to jest jedna z najgorszych niestety bzdur powielana przez początkujących na bazie przykładowych kodów z rozmaitych dziwnych blogów czy stron w internecie <img src="https://forum.atnel.pl/images/smilies/icon_e_sad.gif" alt=":(" title="Smutny" /><br /><br />obejrzyj ten fragment poradnika uważnie od tego momentu a zrozumiesz w czym rzecz:<br /><br /><!-- m --><a class="postlink" href="http://www.youtube.com/watch?feature=player_detailpage&amp;v=UhcyBpM57vo#t=2946" >http://www.youtube.com/watch?feature=pl ... 7vo#t=2946</a><!-- m --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 16 sty 2014, o 16:25</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[ntw]]></name></author>
<updated>2014-01-16T16:19:18+01:00</updated>
<published>2014-01-16T16:19:18+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65231#p65231</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65231#p65231"/>
<title type="html"><![CDATA[RS232 echo]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5566&amp;p=65231#p65231"><![CDATA[
Witam, mógłby ktoś sprawidzić, czy poprawnie jest napisany kod. Używam atmegi 8.<br />Chcę ustawić 8 bit, 1 bit przerwy, baud 9600<br /><br />[syntax=c]#include &lt;stddef.h&gt;<br />#define F_CPU 8000000UL<br />#include &lt;avr/io.h&gt;<br />#include &lt;stdio.h&gt;<br />#include &lt;avr/interrupt.h&gt;<br />#include &lt;util/delay.h&gt;<br /><br /><br /><br />void usart_inicjuj()<br />{<br /><br />#define BAUD 9600<br />#include &lt;util/setbaud.h&gt;<br /><br /><br />UBRRH = UBRRH_VALUE;<br />UBRRL = UBRRL_VALUE;<br />#if USE_2X<br />UCSRA |= (1 &lt;&lt; U2X);<br />#else<br />   UCSRA &amp;= ~(1 &lt;&lt; U2X);<br />#endif<br /><br /><br />UCSRC = (1&lt;&lt;URSEL) | (1&lt;&lt;UCSZ1) | (1&lt;&lt;UCSZ0); <br />UCSRB = (1&lt;&lt;TXEN) | (1&lt;&lt;RXEN) | (1&lt;&lt;RXCIE);<br />}<br /><br /><br /><br />uint8_t receive_uart()<br />{<br />while (!(UCSRA &amp; (1&lt;&lt;RXC)));<br />return UDR;<br /><br />}<br /><br /><br />void sent_uart(uint8_t byte)<br />{<br />while (!(UCSRA &amp; (1&lt;&lt;UDRE)));<br />UDR=byte;<br />}<br /><br /><br /><br />int main(void)<br />{<br /><br /> usart_inicjuj();<br /> while(1)<br /> {<br /> sent_uart(receive_uart());<br /> }<br /><br /><br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2322">ntw</a> — 16 sty 2014, o 16:19</p><hr />
]]></content>
</entry>
</feed>