<?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=15601&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2017-06-15T22:27:06+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=15601&amp;mode</id>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2016-06-16T07:15:15+01:00</updated>
<published>2016-06-16T07:15:15+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162408#p162408</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162408#p162408"/>
<title type="html"><![CDATA[Re: Problem z UART na Atmega 32A.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162408#p162408"><![CDATA[
Trzeba było wziąć notę od normalnej stareńkiej ATmegi32 bez A i proszę - zajrzyj sobie<br /><!-- m --><a class="postlink" href="http://www.atmel.com/images/doc2503.pdf" >http://www.atmel.com/images/doc2503.pdf</a><!-- m --><br /><br /><a href="https://obrazkiforum.atnel.pl/54/f35a587e87e8f130bb6b10ea05646dc8.jpg"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/54/f35a587e87e8f130bb6b10ea05646dc8.jpg" alt="Obrazek" /></a><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 16 cze 2016, o 07:15</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Patrix354]]></name></author>
<updated>2016-06-16T06:56:23+01:00</updated>
<published>2016-06-16T06:56:23+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162407#p162407</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162407#p162407"/>
<title type="html"><![CDATA[Re: Problem z UART na Atmega 32A.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162407#p162407"><![CDATA[
<a href="https://obrazkiforum.atnel.pl/14168/b8d15ccb7139fa200bfa21355f9a9284.png"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/14168/b8d15ccb7139fa200bfa21355f9a9284.png" alt="Obrazek" /></a><br /><br />O to chodziło to było w nocie.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=14168">Patrix354</a> — 16 cze 2016, o 06:56</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2016-06-16T05:35:47+01:00</updated>
<published>2016-06-16T05:35:47+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162405#p162405</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162405#p162405"/>
<title type="html"><![CDATA[Re: Problem z UART na Atmega 32A.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162405#p162405"><![CDATA[
<span style="color: #FF0000">Czytałeś co wyżej napisałem i o co prosiłem na czerwono ?</span><br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: 1 minucie ]</span></strong><br /><br /><div class="quotetitle">Patrix354 napisał(a):</div><div class="quotecontent"><br />W funkcji inicjalizacyjnej były rejestry UBRR0H i UBRR0L a te rejestry nie są nigdzie opisane<br /></div><br />A jak myślisz do czego są takie rzeczy jak noty aplikacyjne PDF ? do procków<br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: 5 minutach ]</span></strong><br /><br />Jeśli procek ma tylko jeden uart szczególnie te starsze jak ATmega32 to oczywiste jest, że nie numeruje się rejestrów UART'a czyli nie ma<br /><br />UBRR0H i UBRR0L tylko UBRRH i UBRRL<br /><br />gdy mamy nowsze procki posiadające dwa albo i więcej UARTów to wtedy jest numeracja np:<br /><br />UBRR0H, UBRR0L i UBRR1L, UBRR1L odpowiednio dla UART0 oraz UART1 .... tak samo z innymi rejestrami jak np UDR0 czy UDR1 itd<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 16 cze 2016, o 05:35</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Patrix354]]></name></author>
<updated>2016-06-16T05:23:30+01:00</updated>
<published>2016-06-16T05:23:30+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162404#p162404</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162404#p162404"/>
<title type="html"><![CDATA[Re: Problem z UART na Atmega 32A.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162404#p162404"><![CDATA[
Po wpisaniu <br /><br />#include&lt;avr/io.h&gt; <br /><br />zniknęła część błędów ale to nie wszystko,  ponieważ w nocie był błąd. <img src="https://forum.atnel.pl/images/smilies/icon_e_surprised.gif" alt=":o" title="Zdziwiony" /><br />W funkcji inicjalizacyjnej były rejestry UBRR0H i UBRR0L a te rejestry nie są nigdzie opisane. Wystarczyło wymazać zero.  <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=14168">Patrix354</a> — 16 cze 2016, o 05:23</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2016-06-15T22:43:03+01:00</updated>
<published>2016-06-15T22:43:03+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162399#p162399</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162399#p162399"/>
<title type="html"><![CDATA[Re: Problem z UART na Atmega 32A.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162399#p162399"><![CDATA[
po pierwsze obejrzyj pan DOKŁADNIE to:<br /><br /><!-- m --><a class="postlink" href="http://mirekk36.blogspot.com/2015/07/eclipse-start-plus-pierwszy-program.html" >http://mirekk36.blogspot.com/2015/07/ec ... ogram.html</a><!-- m --><br /><br />i zapoznaj się jak się tworzy pierwsze programy w Eclipse i jak się je konfiguruje bo ewidentnie coś spaprałeś po drodze<br /><br /><span style="color: #FF0000"><span style="font-size: 150%; line-height: normal">Po drugie POPRAW proszę formatowanie kodu w pierwszym poście - toż masz instrukcję na forum jak to robić: <!-- l --><a class="postlink-local" href="http://forum.atnel.pl/topic7402.html" >topic7402.html</a><!-- l --></span></span><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 15 cze 2016, o 22:43</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[HomoChemicus]]></name></author>
<updated>2016-06-15T22:34:01+01:00</updated>
<published>2016-06-15T22:34:01+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162398#p162398</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162398#p162398"/>
<title type="html"><![CDATA[Re: Problem z UART na Atmega 32A.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162398#p162398"><![CDATA[
W main masz &quot;#include &lt;avr/io.h&gt;&quot;?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=10470">HomoChemicus</a> — 15 cze 2016, o 22:34</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Patrix354]]></name></author>
<updated>2017-06-15T22:27:06+01:00</updated>
<published>2016-06-15T22:18:17+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162397#p162397</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162397#p162397"/>
<title type="html"><![CDATA[Problem z UART na Atmega 32A.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15601&amp;p=162397#p162397"><![CDATA[
Robiłem pierwszy test UARTa na Atmega 32A, wszystko było dobrze do momentu kompilacji.<br /><br />Wyskoczyły mi takie błędy:<br /><br />[syntax]make all <br />'Building file: ../Main.c'<br />'Invoking: AVR Compiler'<br />avr-gcc -Wall -Os -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -std=gnu99 -funsigned-char -funsigned-bitfields -mmcu=atmega32 -DF_CPU=8000000UL -MMD -MP -MF&quot;Main.d&quot; -MT&quot;Main.d&quot; -c -o &quot;Main.o&quot; &quot;../Main.c&quot;<br />In file included from ../Main.c:2:0:<br />c:\program files\atmel\avr tools\avr toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/MyLib/UART.h: In function 'USART_Init':<br />c:\program files\atmel\avr tools\avr toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/MyLib/UART.h:18:2: error: 'UBRR0H' undeclared (first use in this function)<br />c:\program files\atmel\avr tools\avr toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/MyLib/UART.h:18:2: note: each undeclared identifier is reported only once for each function it appears in<br />c:\program files\atmel\avr tools\avr toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/MyLib/UART.h:19:2: error: 'UBRR0L' undeclared (first use in this function)<br />c:\program files\atmel\avr tools\avr toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/MyLib/UART.h:20:2: error: 'UCSRB' undeclared (first use in this function)<br />c:\program files\atmel\avr tools\avr toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/MyLib/UART.h:20:14: error: 'TXEN' undeclared (first use in this function)<br />c:\program files\atmel\avr tools\avr toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/MyLib/UART.h: In function 'USART_Transmit':<br />c:\program files\atmel\avr tools\avr toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/MyLib/UART.h:25:13: error: 'UCSRA' undeclared (first use in this function)<br />c:\program files\atmel\avr tools\avr toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/MyLib/UART.h:25:25: error: 'UDRE' undeclared (first use in this function)<br />c:\program files\atmel\avr tools\avr toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/MyLib/UART.h:26:2: error: 'UDR' undeclared (first use in this function)<br />make: *** &#91;Main.o&#93; Błąd 1[/syntax]<br /><br />Chodzi o to, że sprawdzałem w nocie i zrobiłem teoretycznie wszystko dobrze, nie wiem jak jest w praktyce <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /><br /><br />Kod pliku Main.c:<br /><br />[syntax=c]#include &lt;util/delay.h&gt;<br />#include &lt;MyLib/UART.h&gt;<br /><br />int main(void)<br />{<br />USART_Init( __UBRR );<br /><br />while(1)<br />{<br /> USART_Transmit( 'A' );<br /> _delay_ms(1000);<br />}<br /><br />return 0;<br />}[/syntax]<br /><br />Kod pliku UART.h:<br /><br />[syntax=c]#ifndef UART_H_<br />#define UART_H_<br /><br />#define UART_BAUD 9600  <br />#define __UBRR ((F_CPU+UART_BAUD*8UL) / (16UL*UART_BAUD)-1)<br /><br />#include &lt;stdint.h&gt;<br /><br />void USART_Init( uint16_t _UBRR)<br />{<br />/*Set baud rate */<br />UBRR0H = (uint8_t)(_UBRR&gt;&gt;8);<br />UBRR0L = (uint8_t)_UBRR;<br />Enable transmitter */<br />UCSRB = (1&lt;&lt;TXEN);<br />}<br /><br />void USART_Transmit( char data )<br />{<br />/* Wait for empty transmit buffer */<br />while ( !( UCSRA &amp; (1&lt;&lt;UDRE)) );<br />/* Put data into buffer, sends the data */<br />UDR = data;<br />}<br /><br />#endif /* UART_H_ */[/syntax]<br /><br />Jak to naprawić?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=14168">Patrix354</a> — 15 cze 2016, o 22:18</p><hr />
]]></content>
</entry>
</feed>