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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2014-12-20T21:42:12+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=42&amp;t=9702&amp;mode</id>
<entry>
<author><name><![CDATA[kicajek]]></name></author>
<updated>2014-12-20T21:42:12+01:00</updated>
<published>2014-12-20T21:42:12+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109728#p109728</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109728#p109728"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109728#p109728"><![CDATA[
<div class="quotetitle">jacekk232 napisał(a):</div><div class="quotecontent"><br />Taki zapis jest poprawny<br /></div><br />...oczywiście; poprzednio źle się wyraziłem - każdą liczbę , nie tylko jedynkę da się przesunąć lecz taki zapis jest troszkę zagmatwany.<br />Czytelniej by było:<br />[syntax=c]... (1&lt;&lt;UCSZ1)|(1&lt;&lt;UCSZ0)[/syntax]<br />W tym ustawieniu masz 8 bit danych - chyba dobrze.<br /><br />Pozdr.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=826">kicajek</a> — 20 gru 2014, o 21:42</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[beq1993]]></name></author>
<updated>2014-12-20T20:57:52+01:00</updated>
<published>2014-12-20T20:57:52+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109722#p109722</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109722#p109722"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109722#p109722"><![CDATA[
Czyli co może być problemem?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7205">beq1993</a> — 20 gru 2014, o 20:57</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[jacekk232]]></name></author>
<updated>2014-12-20T20:43:57+01:00</updated>
<published>2014-12-20T20:43:57+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109719#p109719</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109719#p109719"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109719#p109719"><![CDATA[
Taki zapis jest poprawny<br />[syntax=c](3&lt;&lt;UCSZ0)[/syntax]<br /><br />UCSZ0 ma wartość jeden więc (3&lt;&lt;1) przesunie nam liczbę trzy o jedno miejsce w lewo <br />0b00000011&lt;&lt;1 = 0b00000110<br /><br />W rezultacie ten zapis ustawi nam bity UCSZ1 i UCSZ0.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=204">jacekk232</a> — 20 gru 2014, o 20:43</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kicajek]]></name></author>
<updated>2014-12-20T20:33:23+01:00</updated>
<published>2014-12-20T20:33:23+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109716#p109716</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109716#p109716"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109716#p109716"><![CDATA[
<div class="quotetitle">beq1993 napisał(a):</div><div class="quotecontent"><br />Ten kod jest poprawny czy nie? Wydaje mi się że tak<br /></div><br />...nie wiem czy jest poprawny, ale spróbuj sobie to rozpisać binarnie - wyjdzie Ci taki koszmarek.<br />Być może jest to prawidłowy zapis, tylko na ogół chcąc coś zapisać do danego rejestru podajemy na którym miejscu ma znaleźć się jedynka a nie trójka. To jest tylko mój tok rozumowania; niekoniecznie poprawny.<br /><br />Pozdr.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=826">kicajek</a> — 20 gru 2014, o 20:33</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[beq1993]]></name></author>
<updated>2014-12-20T20:15:02+01:00</updated>
<published>2014-12-20T20:15:02+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109710#p109710</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109710#p109710"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109710#p109710"><![CDATA[
Tak jak już napisałem używam ATmega16a. A połączenia to TXO&gt; PD0, RXD&gt;PD1 i nRES&gt;PD7. Oczywiście zmieniłem w pliku KAmodBTM222.h<br />[syntax=c]#define BT_nRES_DIRDDRD<br />#define BT_nRES_PORT PORTD<br />#define BT_nRES_PINPD7[/syntax]<br /><br />[syntax=c]UCSRC = (1&lt;&lt;URSEL)|(1&lt;&lt;USBS)|(3&lt;&lt;UCSZ0);[/syntax]<br />Ten kod jest poprawny czy nie? Wydaje mi się że tak.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7205">beq1993</a> — 20 gru 2014, o 20:15</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kicajek]]></name></author>
<updated>2014-12-20T19:55:46+01:00</updated>
<published>2014-12-20T19:55:46+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109705#p109705</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109705#p109705"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109705#p109705"><![CDATA[
Witam<br />Ten zapis:<br />[syntax=c]UCSRC = (1&lt;&lt;URSEL)|(1&lt;&lt;USBS)|(3&lt;&lt;UCSZ0);[/syntax]<br />wygląda dziwnie - 3&lt;&lt;UCSZ0 - ale to tak &quot;wzrokowo&quot;<br /><div class="quotetitle">beq1993 napisał(a):</div><div class="quotecontent"><br />Dodam że używany prze zemnie uC to ATmega16a<br /></div><br /><br />Pozdr.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=826">kicajek</a> — 20 gru 2014, o 19:55</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Piotrek_P]]></name></author>
<updated>2014-12-20T19:53:30+01:00</updated>
<published>2014-12-20T19:53:30+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109704#p109704</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109704#p109704"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109704#p109704"><![CDATA[
Kolego <strong>beq1993</strong>. Zadając pytanie należało by podać jakiego procka używasz, i jakiś schemat jak masz to połączone.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=290">Piotrek_P</a> — 20 gru 2014, o 19:53</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[beq1993]]></name></author>
<updated>2014-12-20T19:36:29+01:00</updated>
<published>2014-12-20T19:36:29+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109699#p109699</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109699#p109699"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109699#p109699"><![CDATA[
Trochę pokombinowałem. Wszystko sprawdziłem i wszystko jest dobrze zlutowane i na dobrych PIN'ach, ale program niestety nadal nie działa. Ma ktoś jeszcze jakieś propozycje na ten temat?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7205">beq1993</a> — 20 gru 2014, o 19:36</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kicajek]]></name></author>
<updated>2014-12-17T23:04:58+01:00</updated>
<published>2014-12-17T23:04:58+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109262#p109262</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109262#p109262"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109262#p109262"><![CDATA[
Witam<br /><div class="quotetitle">beq1993 napisał(a):</div><div class="quotecontent"><br />...Czy na pewno wszystko dobrze przylutowałem, do dobrych Pinów?<br /></div><br />...takie pytanie na forum  <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /> <br />W oryginalnym main.c podane są PIN'y PD1, PD0 i PB1 - nie wiem jak podłączyłeś a jak masz w programie.<br /><br />Pozdr.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=826">kicajek</a> — 17 gru 2014, o 23:04</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[beq1993]]></name></author>
<updated>2014-12-17T21:27:49+01:00</updated>
<published>2014-12-17T21:27:49+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109239#p109239</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109239#p109239"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109239#p109239"><![CDATA[
Dobra teraz już wszystko ogarnąłem w Eclipse. Program się kompiluje i nie wywala żadnych ostrzeżeń. Tylko nadal jest ten sam problem program staje na wyświetleniu &quot;Initialization&quot;. Czy na pewno wszystko dobrze przylutowałem, do dobrych Pinów? <br />Jeszcze raz wstawię kody po wszystkich przeróbkach: <br />Main.c<br />[syntax=c]#include &lt;avr/io.h&gt;<br />#include &lt;stdio.h&gt;<br />#include &quot;BTM/KAmodBTM222.h&quot;<br />#include &quot;LCDB/HD44780B.h&quot;<br />#include &lt;util/delay.h&gt;<br /><br /><br /><br /><br />int main(void)<br />{<br />        PORTB = 8;<br />        char Pin&#91;5&#93;, Buffer&#91;16&#93;;<br />        LCD_Initialize();<br />        LCD_GoTo(0,0);<br />        LCD_WriteText(&quot;**** KAmodBT ***&quot;);<br />        LCD_GoTo(0,1);<br />        LCD_WriteText(&quot;Wait for BTM222 &quot;);<br /><br />        _delay_ms(3000);<br /><br />        LCD_GoTo(0,1);<br />        LCD_WriteText(&quot; Initialization &quot;);<br /><br /><br />        // Initialize communication<br />        if (KAmodBT_Initialize()!=BT_OK)<br />        {<br />                LCD_GoTo(0,1);<br />                LCD_WriteText(&quot;  Init. error!  &quot;);<br />                while(1);<br />        }<br /><br /><br /><br />        // Enter BTM222's AT mode<br />        if (KAmodBT_EnterATMode()!=BT_OK)<br />        {<br />                LCD_GoTo(0,1);<br />                LCD_WriteText(&quot; AT mode error! &quot;);<br />        }<br /><br />        LCD_GoTo(0,1);<br />        LCD_WriteText(&quot;  Setting name  &quot;);<br /><br /><br />        // Set module's name (seen by host device)<br />        if (KAmodBT_SetName(&quot;KAmodBTM222 demo&quot;)!=BT_OK)<br />        {<br />                LCD_GoTo(0,1);<br />                LCD_WriteText(&quot;Set name failed!&quot;);<br />        }<br /><br /><br />        LCD_GoTo(0,0);<br />        LCD_WriteText(&quot;                &quot;);<br />        LCD_GoTo(0,1);<br />        LCD_WriteText(&quot;                &quot;);<br /><br /><br />        // Read module's PIN (default '1234') and display it<br />        KAmodBT_GetPin(Pin);<br />        sprintf(Buffer, &quot;Pin: %s&quot;, Pin);<br />        LCD_GoTo(0,0);<br />        LCD_WriteText(Buffer);<br /><br />        // Read module's name and display it to check if it was written correctly.<br />        KAmodBT_GetName(Buffer);<br />        LCD_GoTo(0,1);<br />        LCD_WriteText(Buffer);<br /><br /><br />        //Reset module<br />        KAmodBT_Reset();<br />        _delay_ms(3000);<br /><br /><br />        // Send some text once a second.<br />        while(1)<br />        {<br />                KAmodBT_SendBuffer(&quot;KAmodBTM222 demo\n\r&quot;);<br />                _delay_ms(1000);<br />        };<br /><br />}[/syntax]<br />KAmodBTM222.c:<br />[syntax=c]#define BT_UART_DELAY 15<br /><br />#include &quot;KAmodBTM222.h&quot;<br />#include &lt;avr/io.h&gt;<br />#include &lt;util/delay.h&gt;<br />#include &lt;stdint.h&gt;<br />#include &lt;string.h&gt;<br />#include &lt;avr/io.h&gt;<br />#include &lt;stdio.h&gt;<br /><br />#define USART_BAUD 19200ul<br /><br />#define USART_UBBR_VALUE ((F_CPU/(USART_BAUD&lt;&lt;4))-1)<br /><br />//***************************************************************************************************************<br />// USART functions<br /><br />void USART_vInit(void)<br /><br />{<br />UBRRH = (uint8_t)(USART_UBBR_VALUE&gt;&gt;8);<br />UBRRL = (uint8_t)USART_UBBR_VALUE;<br /><br />UCSRC = (1&lt;&lt;URSEL)|(1&lt;&lt;USBS)|(3&lt;&lt;UCSZ0);<br /><br />UCSRB = (1&lt;&lt;RXEN)|(1&lt;&lt;TXEN);<br />}<br /><br /><br />void USART_vSendByte(uint8_t u8Data)<br /><br />{<br />while((UCSRA&amp;(1&lt;&lt;UDRE)) == 0);<br />UDR = u8Data;<br />}<br /><br /><br />uint8_t USART_vReceiveByte()<br /><br />{<br />while((UCSRA&amp;(1&lt;&lt;RXC)) == 0);<br />return UDR;<br />}<br /><br /><br /><br />// USART_vSendBuffer sends string with delays of del ms between characters<br />void USART_vSendBuffer(char * buffer, int del)<br />{<br />int i = 0;<br />while(buffer&#91;i&#93;!=0) { USART_vSendByte(buffer&#91;i&#93;); _delay_ms(del); i++; }<br />}<br /><br />// USART_vReceiveBuffer gets string with delays of del ms between characters<br />void USART_vReceiveBuffer(char * buffer, int del)<br />{<br />int i = 0;<br />while (1)<br />{<br />buffer&#91;i&#93; = USART_vReceiveByte();<br />if ((buffer&#91;i&#93;=='\r') | (buffer&#91;i&#93;=='\n'))<br />{<br />buffer&#91;i&#93;=0;<br />return;<br />}<br />_delay_ms(del);<br />i++;<br />}<br />}<br /><br />//***************************************************************************************************************<br /><br /><br /><br />//***************************************************************************************************************<br />// Functions for KAmodBTM222<br />//***************************************************************************************************************<br /><br /><br />// Initialization of communication interface (UART + module's reset)<br />int KAmodBT_Initialize()<br />{<br />// Configure nRES<br />BT_nRES_DIR = BT_nRES_DIR | (1 &lt;&lt; BT_nRES_PIN);<br />BT_nRES_PORT |= (1 &lt;&lt; BT_nRES_PIN);<br /><br />// Initialize USART<br />USART_vInit();<br /><br />return BT_OK;<br />}<br /><br /><br />// Function for enabling module's AT mode and some more<br />int KAmodBT_EnterATMode()<br />{<br />char buf&#91;32&#93;;<br /><br />// Send +++ for AT mode enabling<br />USART_vSendBuffer(&quot;+++\r&quot;, 50);<br />USART_vReceiveBuffer(buf, BT_UART_DELAY);<br /><br /><br />//Disable echo, it speeds up communication, because, you don't have to wait for echo<br />USART_vSendBuffer(&quot;ATE0\r&quot;, 50);<br />USART_vReceiveBuffer(buf, BT_UART_DELAY);<br /><br />if (strcmp(buf, &quot;OK&quot;)==0) return BT_OK; else return BT_ERR;<br />}<br /><br />/*<br />void KAmodBT_RestoreDefaults()<br />{<br />USART_vSendBuffer(&quot;ATZ0\r&quot;, BT_UART_DELAY);<br />}<br />*/<br /><br />/*<br />void KAmodBT_ExitATMode()<br />{<br />USART_vSendBuffer(&quot;ATE1\r&quot;, BT_UART_DELAY);<br />}<br />*/<br /><br /><br />// KAmodBT_SetName sets module's name<br />int KAmodBT_SetName(char * Name)<br />{<br />char buf&#91;32&#93;;<br /><br />sprintf(buf, &quot;ATN=%s\r&quot;, Name);<br />USART_vSendBuffer(buf, BT_UART_DELAY);<br />USART_vReceiveBuffer(buf, BT_UART_DELAY);<br /><br />if (strcmp(buf, &quot;OK&quot;)==0) return BT_OK; else return BT_ERR;<br />}<br /><br /><br />// KAmodBT_GetName reads module's name<br />int KAmodBT_GetName(char * Name)<br />{<br />char resBuffer&#91;16&#93;;<br />USART_vSendBuffer(&quot;ATN?\r&quot;, BT_UART_DELAY);<br />USART_vReceiveBuffer(Name, 0);<br />USART_vReceiveBuffer(Name, 0);<br />USART_vReceiveBuffer(resBuffer, 0);<br />return BT_OK;<br />}<br /><br /><br />// KAmodBT_GetPin reads PIN (that you need to connect module to another device)<br />int KAmodBT_GetPin(char * Name)<br />{<br />char resBuffer&#91;16&#93;;<br />USART_vSendBuffer(&quot;ATP?\r&quot;, BT_UART_DELAY);<br />USART_vReceiveBuffer(Name, 0);<br />USART_vReceiveBuffer(Name, 0);<br />USART_vReceiveBuffer(resBuffer, 0);<br />return BT_OK;<br />}<br /><br /><br />// Reset module function<br />void KAmodBT_Reset()<br />{<br />BT_nRES_PORT &amp;= !(1 &lt;&lt; BT_nRES_PIN);<br />_delay_ms(50);<br />BT_nRES_PORT |= (1 &lt;&lt; BT_nRES_PIN);<br />_delay_ms(50);<br />}<br /><br /><br />// Sends string to module<br />void KAmodBT_SendBuffer(char * buffer)<br />{<br />USART_vSendBuffer(buffer, BT_UART_DELAY);<br />}[/syntax]<br />KAmodBTM222.h<br />[syntax=c]#ifndef KAMODBTM222_H_<br />#define KAMODBTM222_H_<br /><br />#define BT_ERR0<br />#define BT_OK1<br /><br /><br />#define BT_nRES_DIRDDRD<br />#define BT_nRES_PORT PORTD<br />#define BT_nRES_PINPD3<br /><br />int KAmodBT_Initialize();<br />int KAmodBT_SetName(char * Name);<br />int KAmodBT_EnterATMode();<br />int KAmodBT_GetName(char * Name);<br />int KAmodBT_GetPin(char * Name);<br />void KAmodBT_Reset(void);<br />void KAmodBT_SendBuffer(char * buffer);<br /><br /><br />#endif /* KAMODBTM222_H_ */[/syntax]<br />A tak wygląda moje drzewko:<br /><a href="http://forum.atnel.pl/_obrazki/o/7205/6c22461fa435ea69055ae6b5f27cac00.png"  class="postlink"><img src="http://forum.atnel.pl/_obrazki/o/thumb/7205/6c22461fa435ea69055ae6b5f27cac00.png" alt="Obrazek" /></a><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7205">beq1993</a> — 17 gru 2014, o 21:27</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kicajek]]></name></author>
<updated>2014-12-16T23:17:03+01:00</updated>
<published>2014-12-16T23:17:03+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109135#p109135</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109135#p109135"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109135#p109135"><![CDATA[
<div class="quotetitle">beq1993 napisał(a):</div><div class="quotecontent"><br />Ok wszystko pozmieniane, ale konsola wyświetla to samo. Wstawiam kody po poprawkach:<br /></div><br /><br /><div class="quotetitle">kurnachatka napisał(a):</div><div class="quotecontent"><br />Wydaje mi się że brakuje ci też: <br />[syntax=c]#include &lt;avr/io.h&gt;[/syntax]<br />w main.c<br /></div><br />...chyba nie wszystko.<br />Myślę, że masz bałagan w rozmieszczeniu plików. Czy Twoje &quot;drzewko&quot; wygląda tak?<br /><a href="http://forum.atnel.pl/_obrazki/o/826/d9ed7377f57c56276d75f73049cf52e3.JPG"  class="postlink"><img src="http://forum.atnel.pl/_obrazki/o/826/d9ed7377f57c56276d75f73049cf52e3.JPG" alt="Obrazek" /></a><br /><br />Pozdr.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=826">kicajek</a> — 16 gru 2014, o 23:17</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[beq1993]]></name></author>
<updated>2014-12-16T16:17:54+01:00</updated>
<published>2014-12-16T16:17:54+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109063#p109063</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109063#p109063"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109063#p109063"><![CDATA[
Ok wszystko pozmieniane, ale konsola wyświetla to samo. Wstawiam kody po poprawkach:<br />main.c<br />[syntax=c]//***************** (c) 2010 BTC Korporacja ***********************************<br />//                     http://www.kamami.com<br />// PROJECT  : KAmodBTM222 Example<br />// BOARD    : ZL15AVR (with ATmega32 in socket U1)<br />// COMPILER : WinAVR<br />//<br />//******************************************************************************<br />//<br />//-----------------------------------------------------------------------------<br />//    KAmodBTM222 software library<br />//-----------------------------------------------------------------------------<br />//<br />//    THE SOFTWARE INCLUDED IN THIS FILE IS FOR GUIDANCE ONLY.<br />//    BTC KORPORACJA SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT<br />//    OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING<br />//    FROM USE OF THIS SOFTWARE.<br />//<br />//-----------------------------------------------------------------------------<br /><br />//-----------------------------------------------------------------------------<br />//  This sample works with ZL15AVR evaluation board.<br />//<br />//  This program performs simple configuration of module (sets module's name),<br />//  reads PIN and displays it. Then 'KAmodBTM222 demo' string is sent every second<br />//  via Bluetooth.<br />//<br />//  After running this program connect module to your PC, run terminal program,<br />//  for example HyperTerminal, configure it to connect to proper COM port, you<br />//  should see 'KAmodBTM222 demo' appearing every second on your screen.<br />//<br />//<br />//  Module stores its configuration, so you need to do it only once.<br />//  In real application rather use computer with terminal application for<br />//  module's configureation than do it with microcontroller application.<br />//  Samlpe program shows, that it can be done this way, but only to make demo<br />//  easy to run.<br />//<br />//-----------------------------------------------------------------------------<br />//  Connections:<br />//  GND and VCC of KAmodBTM222 should be connected to power supply, 3.3V and 5V<br />//  voltages can be used, but set JP2 jumper in proper position BEFORE connecting<br />//  it!<br />//<br />//  KAmodBTM222  |   ZL15AVR<br />//  --------------------------<br />//  PD1 (Con18)  |   RXI (JP1)<br />//  PD0 (Con18)  |   TXO (JP1)<br />//  PB2 (Con16)  |   nRES (JP1)<br />//<br />//<br />//  LCD display connections<br />//<br />//  D4 (LCD_CHAR/con13) - PA4 (con15)<br />//  D5 (LCD_CHAR/con13) - PA5 (con15)<br />//  D6 (LCD_CHAR/con13) - PA6 (con15)<br />//  D7 (LCD_CHAR/con13) - PA7 (con15)<br />//  E  (LCD_CHAR/con13) - PA2 (con15)<br />//  RS (LCD_CHAR/con13) - PA3 (con15)<br />//  RW (LCD_CHAR/con13) - GND (con15)<br />//<br />//<br />//-----------------------------------------------------------------------------<br /><br /><br /><br />#include &lt;stdio.h&gt;<br />#include &quot;BTM222/KAmodBTM222.h&quot;<br />#include &quot;lcd/HD44780B.h&quot;<br />#include &lt;util/delay.h&gt;<br /><br /><br /><br /><br />int main(void)<br />{<br />        PORTB = 8;<br />        char Pin&#91;5&#93;, Buffer&#91;16&#93;;<br />        LCD_Initialize();<br />        LCD_GoTo(0,0);<br />        LCD_WriteText(&quot;**** KAmodBT ***&quot;);<br />        LCD_GoTo(0,1);<br />        LCD_WriteText(&quot;Wait for BTM222 &quot;);<br /><br />        _delay_ms(3000);<br /><br />        LCD_GoTo(0,1);<br />        LCD_WriteText(&quot; Initialization &quot;);<br /><br /><br />        // Initialize communication<br />        if (KAmodBT_Initialize()!=BT_OK)<br />        {<br />                LCD_GoTo(0,1);<br />                LCD_WriteText(&quot;  Init. error!  &quot;);<br />                while(1);<br />        }<br /><br /><br /><br />        // Enter BTM222's AT mode<br />        if (KAmodBT_EnterATMode()!=BT_OK)<br />        {<br />                LCD_GoTo(0,1);<br />                LCD_WriteText(&quot; AT mode error! &quot;);<br />        }<br /><br />        LCD_GoTo(0,1);<br />        LCD_WriteText(&quot;  Setting name  &quot;);<br /><br /><br />        // Set module's name (seen by host device)<br />        if (KAmodBT_SetName(&quot;KAmodBTM222 demo&quot;)!=BT_OK)<br />        {<br />                LCD_GoTo(0,1);<br />                LCD_WriteText(&quot;Set name failed!&quot;);<br />        }<br /><br /><br />        LCD_GoTo(0,0);<br />        LCD_WriteText(&quot;                &quot;);<br />        LCD_GoTo(0,1);<br />        LCD_WriteText(&quot;                &quot;);<br /><br /><br />        // Read module's PIN (default '1234') and display it<br />        KAmodBT_GetPin(Pin);<br />        sprintf(Buffer, &quot;Pin: %s&quot;, Pin);<br />        LCD_GoTo(0,0);<br />        LCD_WriteText(Buffer);<br /><br />        // Read module's name and display it to check if it was written correctly.<br />        KAmodBT_GetName(Buffer);<br />        LCD_GoTo(0,1);<br />        LCD_WriteText(Buffer);<br /><br /><br />        //Reset module<br />        KAmodBT_Reset();<br />        _delay_ms(3000);<br /><br /><br />        // Send some text once a second.<br />        while(1)<br />        {<br />                KAmodBT_SendBuffer(&quot;KAmodBTM222 demo\n\r&quot;);<br />                _delay_ms(1000);<br />        };<br /><br />}[/syntax]<br />KAmodBTM222.h<br />[syntax=c]#define BT_ERR0<br />#define BT_OK1<br /><br /><br />#define BT_nRES_DIRDDRD<br />#define BT_nRES_PORT PORTD<br />#define BT_nRES_PINPD3<br /><br />int KAmodBT_Initialize();<br />int KAmodBT_SetName(char * Name);<br />int KAmodBT_EnterATMode();<br />int KAmodBT_GetName(char * Name);<br />int KAmodBT_GetPin(char * Name);<br />int KAmodBT_Reset(void);<br />int KAmodBT_SendBuffer(char * buffer);[/syntax]<br />KAmodBTM222.c<br />[syntax=c]#define BT_UART_DELAY 15<br /><br />#include &quot;BTM222/KAmodBTM222.h&quot;<br />#include &lt;avr/io.h&gt;<br />#include &lt;util/delay.h&gt;<br />#include &lt;stdint.h&gt;<br />#include &lt;string.h&gt;<br /><br />#define USART_BAUD 19200ul<br /><br />#define USART_UBBR_VALUE ((F_CPU/(USART_BAUD&lt;&lt;4))-1)<br /><br />//***************************************************************************************************************<br />// USART functions<br /> <br />void USART_vInit(void)<br /><br />{<br />UBRRH = (uint8_t)(USART_UBBR_VALUE&gt;&gt;8);<br />UBRRL = (uint8_t)USART_UBBR_VALUE;<br /><br />UCSRC = (1&lt;&lt;URSEL)|(1&lt;&lt;USBS)|(3&lt;&lt;UCSZ0);<br /><br />UCSRB = (1&lt;&lt;RXEN)|(1&lt;&lt;TXEN);<br />}<br /><br /><br />void USART_vSendByte(uint8_t u8Data)<br /><br />{<br />while((UCSRA&amp;(1&lt;&lt;UDRE)) == 0);<br />UDR = u8Data;<br />}<br /><br /><br />uint8_t USART_vReceiveByte()<br /><br />{<br />while((UCSRA&amp;(1&lt;&lt;RXC)) == 0);<br />return UDR;<br />}<br /><br /><br /><br />// USART_vSendBuffer sends string with delays of del ms between characters<br />void USART_vSendBuffer(char * buffer, int del)<br />{<br />int i = 0;<br />while(buffer&#91;i&#93;!=0) { USART_vSendByte(buffer&#91;i&#93;); _delay_ms(del); i++; }<br />}<br /><br />// USART_vReceiveBuffer gets string with delays of del ms between characters<br />void USART_vReceiveBuffer(char * buffer, int del)<br />{<br />int i = 0;<br />while (1)<br />{<br />buffer&#91;i&#93; = USART_vReceiveByte();<br />if ((buffer&#91;i&#93;=='\r') | (buffer&#91;i&#93;=='\n')) <br />{<br />buffer&#91;i&#93;=0;<br />return;<br />}<br />_delay_ms(del);<br />i++;<br />}<br />}<br /><br />//***************************************************************************************************************<br /><br /><br /><br />//***************************************************************************************************************<br />// Functions for KAmodBTM222<br />//***************************************************************************************************************<br /><br /><br />// Initialization of communication interface (UART + module's reset)<br />int KAmodBT_Initialize()<br />{<br />// Configure nRES <br />BT_nRES_DIR = BT_nRES_DIR | (1 &lt;&lt; BT_nRES_PIN);<br />BT_nRES_PORT |= (1 &lt;&lt; BT_nRES_PIN);<br /><br />// Initialize USART<br />USART_vInit();<br /><br />return BT_OK;<br />}<br /><br /><br />// Function for enabling module's AT mode and some more<br />int KAmodBT_EnterATMode()<br />{<br />char buf&#91;32&#93;;<br /><br />// Send +++ for AT mode enabling<br />USART_vSendBuffer(&quot;+++\r&quot;, 50);<br />USART_vReceiveBuffer(buf, BT_UART_DELAY);<br /><br /><br />//Disable echo, it speeds up communication, because, you don't have to wait for echo<br />USART_vSendBuffer(&quot;ATE0\r&quot;, 50);<br />USART_vReceiveBuffer(buf, BT_UART_DELAY);<br /><br />if (strcmp(buf, &quot;OK&quot;)==0) return BT_OK; else return BT_ERR;<br />}<br /><br />/*<br />void KAmodBT_RestoreDefaults()<br />{<br />USART_vSendBuffer(&quot;ATZ0\r&quot;, BT_UART_DELAY);<br />}<br />*/<br /><br />/*<br />void KAmodBT_ExitATMode()<br />{<br />USART_vSendBuffer(&quot;ATE1\r&quot;, BT_UART_DELAY);<br />}<br />*/<br /><br /><br />// KAmodBT_SetName sets module's name<br />int KAmodBT_SetName(char * Name)<br />{<br />char buf&#91;32&#93;;<br /><br />sprintf(buf, &quot;ATN=%s\r&quot;, Name);<br />USART_vSendBuffer(buf, BT_UART_DELAY);<br />USART_vReceiveBuffer(buf, BT_UART_DELAY);<br /><br />if (strcmp(buf, &quot;OK&quot;)==0) return BT_OK; else return BT_ERR;<br />}<br /><br /><br />// KAmodBT_GetName reads module's name<br />int KAmodBT_GetName(char * Name)<br />{<br />char resBuffer&#91;16&#93;;<br />USART_vSendBuffer(&quot;ATN?\r&quot;, BT_UART_DELAY);<br />USART_vReceiveBuffer(Name, 0);<br />USART_vReceiveBuffer(Name, 0);<br />USART_vReceiveBuffer(resBuffer, 0);<br />return BT_OK;<br />}<br /><br /><br />// KAmodBT_GetPin reads PIN (that you need to connect module to another device)<br />int KAmodBT_GetPin(char * Name)<br />{<br />char resBuffer&#91;16&#93;;<br />USART_vSendBuffer(&quot;ATP?\r&quot;, BT_UART_DELAY);<br />USART_vReceiveBuffer(Name, 0);<br />USART_vReceiveBuffer(Name, 0);<br />USART_vReceiveBuffer(resBuffer, 0);<br />return BT_OK;<br />}<br /><br /><br />// Reset module function<br />void KAmodBT_Reset()<br />{<br />BT_nRES_PORT &amp;= !(1 &lt;&lt; BT_nRES_PIN);<br />_delay_ms(50);<br />BT_nRES_PORT |= (1 &lt;&lt; BT_nRES_PIN);<br />_delay_ms(50);<br />}<br /><br /><br />// Sends string to module<br />void KAmodBT_SendBuffer(char * buffer)<br />{<br />USART_vSendBuffer(buffer, BT_UART_DELAY);<br />}[/syntax]<br />I jeszcze libsy do LCD:<br />HD44780B.c<br />[syntax=c]//***************** (c) 2008 BTC Korporacja ***********************************<br />//                     http://www kamami.com<br />//<br />//    THE SOFTWARE INCLUDED IN THIS FILE IS FOR GUIDANCE ONLY.<br />//    BTC KORPORACJA SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT<br />//    OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING<br />//    FROM USE OF THIS SOFTWARE.<br />//<br />//******************************************************************************<br />#include &quot;lcd/HD44780B.h&quot;<br />//-------------------------------------<br />// Write half byte<br />//-------------------------------------<br />void _LCD_OutNibble(unsigned char nibbleToWrite)<br />{<br />if(nibbleToWrite &amp; 0x01)<br />LCD_DB4_PORT |= LCD_DB4;<br />else<br />LCD_DB4_PORT  &amp;= ~LCD_DB4;<br /><br />if(nibbleToWrite &amp; 0x02)<br />LCD_DB5_PORT |= LCD_DB5;<br />else<br />LCD_DB5_PORT  &amp;= ~LCD_DB5;<br /><br />if(nibbleToWrite &amp; 0x04)<br />LCD_DB6_PORT |= LCD_DB6;<br />else<br />LCD_DB6_PORT  &amp;= ~LCD_DB6;<br /><br />if(nibbleToWrite &amp; 0x08)<br />LCD_DB7_PORT |= LCD_DB7;<br />else<br />LCD_DB7_PORT  &amp;= ~LCD_DB7;<br />}<br />//-------------------------------------<br />// Write byte<br />//-------------------------------------<br />void _LCD_Write(unsigned char dataToWrite)<br />{<br />LCD_E_PORT |= LCD_E;<br />_LCD_OutNibble(dataToWrite &gt;&gt; 4);<br />LCD_E_PORT &amp;= ~LCD_E;<br />LCD_E_PORT |= LCD_E;<br />_LCD_OutNibble(dataToWrite);<br />LCD_E_PORT &amp;= ~LCD_E;<br />_delay_us(50);<br />}<br />//-------------------------------------<br />// Write to command register<br />//-------------------------------------<br />void LCD_WriteCommand(unsigned char commandToWrite)<br />{<br />LCD_RS_PORT &amp;= ~LCD_RS;<br />_LCD_Write(commandToWrite);<br />}<br />//-------------------------------------<br />// Write to data register<br />//-------------------------------------<br />void LCD_WriteData(unsigned char dataToWrite)<br />{<br />LCD_RS_PORT |= LCD_RS;<br />_LCD_Write(dataToWrite);<br />}<br />//-------------------------------------<br />// Write text<br />//-------------------------------------<br />void LCD_WriteText(char * text)<br />{<br />while(*text)<br />  LCD_WriteData(*text++);<br />}<br />//-------------------------------------<br />// Set display coordinates<br />//-------------------------------------<br />void LCD_GoTo(unsigned char x, unsigned char y)<br />{<br />LCD_WriteCommand(HD44780_DDRAM_SET | (x + (0x40 * y)));<br />}<br />//-------------------------------------<br />// Clear display<br />//-------------------------------------<br />void LCD_Clear(void)<br />{<br />LCD_WriteCommand(HD44780_CLEAR);<br />_delay_ms(2);<br />}<br />//-------------------------------------<br />// Set home position<br />//-------------------------------------<br />void LCD_Home(void)<br />{<br />LCD_WriteCommand(HD44780_HOME);<br />_delay_ms(2);<br />}<br />//-------------------------------------<br />// Shift display left<br />//-------------------------------------<br />void LCD_ShiftLeft(void)<br />{<br />LCD_WriteCommand(HD44780_DISPLAY_CURSOR_SHIFT | HD44780_SHIFT_LEFT | HD44780_SHIFT_DISPLAY);<br />}<br />//-------------------------------------<br />// Shift display right<br />//-------------------------------------<br />void LCD_ShiftRight(void)<br />{<br />LCD_WriteCommand(HD44780_DISPLAY_CURSOR_SHIFT | HD44780_SHIFT_RIGHT | HD44780_SHIFT_DISPLAY);<br />}<br />//-------------------------------------<br />// Display initialization<br />//-------------------------------------<br />void LCD_Initialize(void)<br />{<br />unsigned char i;<br />LCD_DB4_DIR |= LCD_DB4; <br />LCD_DB5_DIR |= LCD_DB5; <br />LCD_DB6_DIR |= LCD_DB6; <br />LCD_DB7_DIR |= LCD_DB7; <br />LCD_E_DIR |= LCD_E;   <br />LCD_RS_DIR |= LCD_RS;  <br />_delay_ms(15); <br />LCD_RS_PORT &amp;= ~LCD_RS; <br />LCD_E_PORT &amp;= ~LCD_E;  <br /><br />for(i = 0; i &lt; 3; i++)<br />  {<br />  LCD_E_PORT |= LCD_E; <br />  _LCD_OutNibble(0x03); <br />  LCD_E_PORT &amp;= ~LCD_E; <br />  _delay_ms(5); <br />  }<br /><br />LCD_E_PORT |= LCD_E; <br />_LCD_OutNibble(0x02); <br />LCD_E_PORT &amp;= ~LCD_E; <br /><br />_delay_ms(1); <br />LCD_WriteCommand(HD44780_FUNCTION_SET | HD44780_FONT5x7 | HD44780_TWO_LINE | HD44780_4_BIT); <br />LCD_WriteCommand(HD44780_DISPLAY_ONOFF | HD44780_DISPLAY_OFF); <br />LCD_WriteCommand(HD44780_CLEAR); <br />_delay_ms(2);<br />LCD_WriteCommand(HD44780_ENTRY_MODE | HD44780_EM_SHIFT_CURSOR | HD44780_EM_INCREMENT);<br />LCD_WriteCommand(HD44780_DISPLAY_ONOFF | HD44780_DISPLAY_ON | HD44780_CURSOR_OFF | HD44780_CURSOR_NOBLINK);<br />}<br />//-------------------------------------<br />// End of file<br />//-------------------------------------[/syntax]<br />HD44780B.h<br />[syntax=c]//***************** (c) 2008 BTC Korporacja ***********************************<br />//                     http://www kamami.com<br />//<br />//    THE SOFTWARE INCLUDED IN THIS FILE IS FOR GUIDANCE ONLY.<br />//    BTC KORPORACJA SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT<br />//    OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING<br />//    FROM USE OF THIS SOFTWARE.<br />//<br />//******************************************************************************<br />#include &lt;avr/io.h&gt;<br />#include &lt;util/delay.h&gt;<br />//-------------------------------------------------------------------------------------------------<br />//<br />//-------------------------------------------------------------------------------------------------<br />#define LCD_RS_DIRDDRB<br />#define LCD_RS_PORT PORTB<br />#define LCD_RS(1 &lt;&lt; PB2)<br /><br />#define LCD_E_DIRDDRB<br />#define LCD_E_PORTPORTB<br />#define LCD_E(1 &lt;&lt; PB0)<br /><br />#define LCD_DB4_DIRDDRB<br />#define LCD_DB4_PORTPORTB<br />#define LCD_DB4(1 &lt;&lt; PB7)<br /><br />#define LCD_DB5_DIRDDRB<br />#define LCD_DB5_PORTPORTB<br />#define LCD_DB5(1 &lt;&lt; PB6)<br /><br />#define LCD_DB6_DIRDDRB<br />#define LCD_DB6_PORTPORTB<br />#define LCD_DB6(1 &lt;&lt; PB5)<br /><br />#define LCD_DB7_DIRDDRB<br />#define LCD_DB7_PORTPORTB<br />#define LCD_DB7(1 &lt;&lt; PB4)<br /><br />//-------------------------------------------------------------------------------------------------<br />// HD44780 commands<br />//-------------------------------------------------------------------------------------------------<br /><br />#define HD44780_CLEAR0x01<br /><br />#define HD44780_HOME0x02<br /><br />#define HD44780_ENTRY_MODE0x04<br />#define HD44780_EM_SHIFT_CURSOR0<br />#define HD44780_EM_SHIFT_DISPLAY1<br />#define HD44780_EM_DECREMENT0<br />#define HD44780_EM_INCREMENT2<br /><br />#define HD44780_DISPLAY_ONOFF0x08<br />#define HD44780_DISPLAY_OFF0<br />#define HD44780_DISPLAY_ON4<br />#define HD44780_CURSOR_OFF0<br />#define HD44780_CURSOR_ON2<br />#define HD44780_CURSOR_NOBLINK0<br />#define HD44780_CURSOR_BLINK1<br /><br />#define HD44780_DISPLAY_CURSOR_SHIFT0x10<br />#define HD44780_SHIFT_CURSOR0<br />#define HD44780_SHIFT_DISPLAY8<br />#define HD44780_SHIFT_LEFT0<br />#define HD44780_SHIFT_RIGHT4<br /><br />#define HD44780_FUNCTION_SET0x20<br />#define HD44780_FONT5x70<br />#define HD44780_FONT5x104<br />#define HD44780_ONE_LINE0<br />#define HD44780_TWO_LINE8<br />#define HD44780_4_BIT0<br />#define HD44780_8_BIT16<br /><br />#define HD44780_CGRAM_SET0x40<br /><br />#define HD44780_DDRAM_SET0x80<br /><br />//-------------------------------------------------------------------------------------------------<br />// Functions declarations<br />//-------------------------------------------------------------------------------------------------<br />void LCD_WriteCommand(unsigned char);<br />void LCD_WriteData(unsigned char);<br />void LCD_WriteText(char *);<br />void LCD_GoTo(unsigned char, unsigned char);<br />void LCD_Clear(void);<br />void LCD_Home(void);<br />void LCD_ShiftLeft(void);<br />void LCD_ShiftRight(void);<br />void LCD_Initialize(void);<br />//-------------------------------------------------------------------------------------------------<br />// End of file<br />//-------------------------------------------------------------------------------------------------[/syntax]<br /><br />@mirekk36 Chętnie zakupiłbym książkę, ale mieszkam za granicą. 70 zł wysyłki to jest dla mnie zbyt duża suma. Zauważając że sama książka kosztuje 115 zł.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7205">beq1993</a> — 16 gru 2014, o 16:17</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[eMCe2]]></name></author>
<updated>2014-12-16T15:45:23+01:00</updated>
<published>2014-12-16T15:45:23+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109061#p109061</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109061#p109061"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109061#p109061"><![CDATA[
[syntax=c]#include &quot;BTM222/KAmodBTM222.c&quot;<br />#include &quot;lcd/HD44780B.c&quot;[/syntax]<br /><br />Zmien to z .c na .h i bedzie git<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1363">eMCe2</a> — 16 gru 2014, o 15:45</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2014-12-16T15:44:24+01:00</updated>
<published>2014-12-16T15:44:24+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109060#p109060</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109060#p109060"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109060#p109060"><![CDATA[
beq1993 ---&gt; szanowny panie kolego ..... polecam jednak zacząć od książki:<br /><br /><!-- m --><a class="postlink" href="http://atnel.pl/mikrokontrolery-avr-jezyk-c.html" >http://atnel.pl/mikrokontrolery-avr-jezyk-c.html</a><!-- m --><br /><br />i poczytać o PODSTAWACH języka C ... bo widać, że od samego początku twój problem to właśnie brak podstaw ... czyli jak dzieli się projekt na pliki nagłówkowe i źródłowe, jak działa kompilacja , jak się korzysta z funkcji itp itd<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 16 gru 2014, o 15:44</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[majster]]></name></author>
<updated>2014-12-16T15:37:45+01:00</updated>
<published>2014-12-16T15:37:45+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109059#p109059</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109059#p109059"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109059#p109059"><![CDATA[
Pomaz includy z main.c bo brak tam na pewno includa od sprintf i od libsa z lcd. Dodatkowo brak ci deklatacji 2 funkcji w kamod.....h<br /><br />Namazane ze smarta.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1628">majster</a> — 16 gru 2014, o 15:37</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[beq1993]]></name></author>
<updated>2014-12-16T15:22:33+01:00</updated>
<published>2014-12-16T15:22:33+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109057#p109057</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109057#p109057"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109057#p109057"><![CDATA[
Ok zmieniłem na .h. Przepraszam za błąd, ale dopiero przesiadłem się z Asembler'a na C. Dodałem także definicje jak kazał <strong>@kicajek</strong> i <strong>@eMCe2</strong>. Oto co wyświetla konsola:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">**** Build of configuration Release for project Wys ****<br /><br />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=atmega16 -DF_CPU=16000000UL -MMD -MP -MF&quot;main.d&quot; -MT&quot;main.d&quot; -c -o &quot;main.o&quot; &quot;../main.c&quot;<br />../main.c: In function 'main':<br />../main.c:126: warning: implicit declaration of function 'sprintf'<br />../main.c:126: warning: incompatible implicit declaration of built-in function 'sprintf'<br />Finished building: ../main.c<br /> <br />Building target: Wys.elf<br />Invoking: AVR C Linker<br />avr-gcc -Wl,-Map,Wys.map -mmcu=atmega16 -o &quot;Wys.elf&quot;  ./main.o   <br />./main.o: In function `main':<br />main.c:(.text.main+0x20): undefined reference to `LCD_Initialize'<br />main.c:(.text.main+0x28): undefined reference to `LCD_GoTo'<br />main.c:(.text.main+0x30): undefined reference to `LCD_WriteText'<br />main.c:(.text.main+0x38): undefined reference to `LCD_GoTo'<br />main.c:(.text.main+0x40): undefined reference to `LCD_WriteText'<br />main.c:(.text.main+0x5a): undefined reference to `LCD_GoTo'<br />main.c:(.text.main+0x62): undefined reference to `LCD_WriteText'<br />main.c:(.text.main+0x66): undefined reference to `KAmodBT_Initialize'<br />main.c:(.text.main+0x72): undefined reference to `LCD_GoTo'<br />main.c:(.text.main+0x7a): undefined reference to `LCD_WriteText'<br />main.c:(.text.main+0x80): undefined reference to `KAmodBT_EnterATMode'<br />main.c:(.text.main+0x8c): undefined reference to `LCD_GoTo'<br />main.c:(.text.main+0x94): undefined reference to `LCD_WriteText'<br />main.c:(.text.main+0x9c): undefined reference to `LCD_GoTo'<br />main.c:(.text.main+0xa4): undefined reference to `LCD_WriteText'<br />main.c:(.text.main+0xac): undefined reference to `KAmodBT_SetName'<br />main.c:(.text.main+0xb8): undefined reference to `LCD_GoTo'<br />main.c:(.text.main+0xc0): undefined reference to `LCD_WriteText'<br />main.c:(.text.main+0xc8): undefined reference to `LCD_GoTo'<br />main.c:(.text.main+0xd0): undefined reference to `LCD_WriteText'<br />main.c:(.text.main+0xd8): undefined reference to `LCD_GoTo'<br />main.c:(.text.main+0xe0): undefined reference to `LCD_WriteText'<br />main.c:(.text.main+0xee): undefined reference to `KAmodBT_GetPin'<br />main.c:(.text.main+0x134): undefined reference to `LCD_GoTo'<br />main.c:(.text.main+0x13a): undefined reference to `LCD_WriteText'<br />main.c:(.text.main+0x140): undefined reference to `KAmodBT_GetName'<br />main.c:(.text.main+0x148): undefined reference to `LCD_GoTo'<br />main.c:(.text.main+0x14e): undefined reference to `LCD_WriteText'<br />main.c:(.text.main+0x152): undefined reference to `KAmodBT_Reset'<br />main.c:(.text.main+0x170): undefined reference to `KAmodBT_SendBuffer'<br />make: *** &#91;Wys.elf&#93; Error 1<br /><br />**** Build Finished ****<br /></div><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7205">beq1993</a> — 16 gru 2014, o 15:22</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[eMCe2]]></name></author>
<updated>2014-12-16T13:40:16+01:00</updated>
<published>2014-12-16T13:40:16+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109048#p109048</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109048#p109048"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109048#p109048"><![CDATA[
a w pliku .h dodaj jeszcze<br /><br />[syntax=c]void KAmodBT_Reset(void);<br />void KAmodBT_SendBuffer(char * buffer);[/syntax]<br /><br />O czym ci napisał kolega <strong>@kicajek</strong><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1363">eMCe2</a> — 16 gru 2014, o 13:40</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[majster]]></name></author>
<updated>2014-12-16T07:19:11+01:00</updated>
<published>2014-12-16T07:19:11+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109012#p109012</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109012#p109012"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=109012#p109012"><![CDATA[
Kolego nigdy nie includujemy plikow.c a pliki.h wiec zmien to i podaj co isze w console.<br /><br />Namazane ze smarta.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1628">majster</a> — 16 gru 2014, o 07:19</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kicajek]]></name></author>
<updated>2014-12-16T01:29:16+01:00</updated>
<published>2014-12-16T01:29:16+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108997#p108997</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108997#p108997"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108997#p108997"><![CDATA[
Witam<br />M.in w pliku KAmodBTM222.h brakuje deklaracji dwóch funkcji - o tym mówi kompilator gdy nie jest uciszony przez podmianę *.h  na *.c<br /><br />Pozdr.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=826">kicajek</a> — 16 gru 2014, o 01:29</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Piotrek_P]]></name></author>
<updated>2014-12-15T20:50:14+01:00</updated>
<published>2014-12-15T20:50:14+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108928#p108928</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108928#p108928"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108928#p108928"><![CDATA[
<div class="quotetitle">beq1993 napisał(a):</div><div class="quotecontent"><br />Właśnie też mi się tak wydawało, ale jak dam .h to wywala mnóstwo błędów undeclared function.<br /></div><br />Wg mnie to nawet dobrze, że wywala. Przynajmniej można się zorientować o co 'jemu' się rozchodzi <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";-)" title="Puszcza oko" /> . Tylko, że dalej nikt z nas nie wie co wywala więc trudno Ci pomóc.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=290">Piotrek_P</a> — 15 gru 2014, o 20:50</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kurnachatka]]></name></author>
<updated>2014-12-15T20:48:21+01:00</updated>
<published>2014-12-15T20:48:21+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108927#p108927</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108927#p108927"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108927#p108927"><![CDATA[
Wydaje mi się że brakuje ci też:<br />[syntax=c]#include &lt;avr/io.h&gt;[/syntax]<br />w main.c<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=930">kurnachatka</a> — 15 gru 2014, o 20:48</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[beq1993]]></name></author>
<updated>2014-12-15T20:44:57+01:00</updated>
<published>2014-12-15T20:44:57+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108926#p108926</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108926#p108926"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108926#p108926"><![CDATA[
Właśnie też mi się tak wydawało, ale jak dam .h to wywala mnóstwo błędów undeclared function.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7205">beq1993</a> — 15 gru 2014, o 20:44</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kicajek]]></name></author>
<updated>2014-12-15T20:12:50+01:00</updated>
<published>2014-12-15T20:12:50+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108911#p108911</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108911#p108911"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108911#p108911"><![CDATA[
Witam<br />...a te includy:<br />[syntax=c]#include &quot;BTM222/KAmodBTM222.c&quot;<br />#include &quot;lcd/HD44780B.c&quot;[/syntax]<br />nie powinny być z rozszerzeniem    *.h ?<br /><br />Pozdr.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=826">kicajek</a> — 15 gru 2014, o 20:12</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[beq1993]]></name></author>
<updated>2014-12-15T17:17:03+01:00</updated>
<published>2014-12-15T17:17:03+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108881#p108881</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108881#p108881"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108881#p108881"><![CDATA[
Usunąłem <br />[syntax=c]#define F_CPU 16000000UL[/syntax]<br />To nie pomogło. Mogę się skontaktować z producentem, ale osobiście uważam że to ja gdzieś błąd robię, np. w kodzie, albo źle podłączyłem. Dlatego pytam.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7205">beq1993</a> — 15 gru 2014, o 17:17</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[majster]]></name></author>
<updated>2014-12-15T16:16:16+01:00</updated>
<published>2014-12-15T16:16:16+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108870#p108870</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108870#p108870"/>
<title type="html"><![CDATA[Re: Nie mogę się połączyć z Kamodbtm222.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9702&amp;p=108870#p108870"><![CDATA[
W eclipse samo wpisuje sie do mkfile w as nie wiem bynajmniej nie tak definiuje sie kwarc. A jak masz problem z kupnym modulem to moze lepiej napisac do producenta ze sa z nim problemy?<br /><br />Namazane ze smarta.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1628">majster</a> — 15 gru 2014, o 16:16</p><hr />
]]></content>
</entry>
</feed>