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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2014-09-27T21:08:41+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=8&amp;t=8644&amp;mode</id>
<entry>
<author><name><![CDATA[Krauser]]></name></author>
<updated>2014-09-27T21:08:41+01:00</updated>
<published>2014-09-27T21:08:41+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96893#p96893</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96893#p96893"/>
<title type="html"><![CDATA[Re: Chinski pilot na podczerwień]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96893#p96893"><![CDATA[
<div class="quotetitle">antynick napisał(a):</div><div class="quotecontent"><br />Na Atmedze16 ten sam błąd<br /></div><br />Mikrokontrolery czasem różnią się minimalnie nazwami rejestrów lub bitów (usuniesz 1 i dodasz T i będzie śmigać). Do atmegi 16 jest skromna specyfikacja po polsku <!-- m --><a class="postlink" href="http://www.jaglarz.info/ja/elektronika/atmega16.pdf" >http://www.jaglarz.info/ja/elektronika/atmega16.pdf</a><!-- m --><br /><div class="quotetitle">antynick napisał(a):</div><div class="quotecontent"><br />Biblioteki od LCD też nie mam, no bo przecież jak nie kupisz książki to już nic nie napiszesz... nieistotne.<br /></div><br />No cóż trzeba się zapisać do jakiejś biblioteki. Możesz też poszukać kodów w uaktualnieniach <!-- m --><a class="postlink" href="http://www.atnel.pl/uaktualnienia-programow-do-dvd.html" >http://www.atnel.pl/uaktualnienia-programow-do-dvd.html</a><!-- m --> Są też inne opcje np. <a href="http://forum.atnel.pl/topic3000.html"  class="postlink">Terminal jako kolorowy wyświetlacz LCD ? <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /></a> lub biblioteka Radzia <!-- m --><a class="postlink" href="http://radzio.dxp.pl/hd44780/" >http://radzio.dxp.pl/hd44780/</a><!-- m --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=465">Krauser</a> — 27 wrz 2014, o 21:08</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[antynick]]></name></author>
<updated>2014-09-27T19:46:19+01:00</updated>
<published>2014-09-27T19:46:19+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96877#p96877</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96877#p96877"/>
<title type="html"><![CDATA[Re: Chinski pilot na podczerwień]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96877#p96877"><![CDATA[
Na Atmedze16 ten sam błąd:<br /><br />[syntax=c]TIMSK1 |= (1&lt;&lt;ICIE1);   /* enable interrupt */[/syntax]<br /><br />[syntax=c]../main.c: In function 'main':<br />../main.c:20: error: 'TIMSK1' undeclared (first use in this function)<br />../main.c:20: error: (Each undeclared identifier is reported only once<br />../main.c:20: error: for each function it appears in.)<br />../main.c:20: error: 'ICIE1' undeclared (first use in this function)<br />make: *** &#91;main.o&#93; Error 1[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2251">antynick</a> — 27 wrz 2014, o 19:46</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[xor]]></name></author>
<updated>2014-09-27T18:53:11+01:00</updated>
<published>2014-09-27T18:53:11+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96863#p96863</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96863#p96863"/>
<title type="html"><![CDATA[Re: Chinski pilot na podczerwień]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96863#p96863"><![CDATA[
Datatsheet się kłania (strona 92 i dalsze) <a href="http://www.atmel.com/images/atmel-8159-8-bit-avr-microcontroller-atmega8a_datasheet.pdf"  class="postlink">http://www.atmel.com/images/atmel-8159-8-bit-avr-microcontroller-atmega8a_datasheet.pdf</a>: w m8 nie ma ani rejestru TIMSK1 ani bitu ICIE1<br />Natomiast błędy związane z przerwaniami znikną po dołączeniu<br />[syntax=c]#include &lt;avr/interrupt.h&gt;[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1774">xor</a> — 27 wrz 2014, o 18:53</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[antynick]]></name></author>
<updated>2014-09-27T17:37:57+01:00</updated>
<published>2014-09-27T17:37:57+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96852#p96852</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96852#p96852"/>
<title type="html"><![CDATA[Re: Chinski pilot na podczerwień]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96852#p96852"><![CDATA[
Czyli te błędy które zostały wynikają z braku 'podciągniętej' biblioteki przerwań? (jak pisał o tym mirek1968 w tamtym wątku)<br />Gdzie taką bibliotekę mogę znaleźć?? Mógłby ktoś podesłać??<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2251">antynick</a> — 27 wrz 2014, o 17:37</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Jaglarz]]></name></author>
<updated>2014-09-27T16:46:09+01:00</updated>
<published>2014-09-27T16:46:09+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96842#p96842</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96842#p96842"/>
<title type="html"><![CDATA[Re: Chinski pilot na podczerwień]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96842#p96842"><![CDATA[
Proszę po raz kolejny o korektę <!-- l --><a class="postlink-local" href="http://forum.atnel.pl/topic7402.html" >topic7402.html</a><!-- l --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=471">Jaglarz</a> — 27 wrz 2014, o 16:46</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[antynick]]></name></author>
<updated>2014-09-27T17:33:03+01:00</updated>
<published>2014-09-27T16:35:41+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96838#p96838</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96838#p96838"/>
<title type="html"><![CDATA[Re: Chinski pilot na podczerwień]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96838#p96838"><![CDATA[
No dobra, a jak przerobić podany kod z linku wyżej na M8:<br /><br />[syntax=c]#include &lt;avr/io.h&gt;<br />#include &quot;LCD/lcd44780.h&quot;<br /> <br />#define F_START F_CPU/8000*13.5<br />#define F_ONE F_CPU/8000*2.25<br />#define F_ZERO F_CPU/8000*1.125<br />#define F_MARGIN F_CPU/8000*0.4<br /> <br />volatile uint8_t frame_ready;<br />volatile uint8_t address;<br />volatile uint8_t command;<br /> <br />int main(void)<br />{    <br />        DDRA |= (1&lt;&lt;PA7);<br />        PORTA |= (1&lt;&lt;PA7); /* podświetlenie wyświetlacza LCD */<br /> <br />        PORTD |= (1&lt;&lt;PD6); /* podciągnięcie wejścia IR */<br /> <br />        lcd_init();     /* inicjalizacja LCD */<br />        /* ir timer */<br />        TCCR1B |= (1&lt;&lt;CS11);    /* prescaler = 8 */<br />        TCCR1B &amp;= ~(1&lt;&lt;ICES1);  /* falling edge */<br />        TIMSK1 |= (1&lt;&lt;ICIE1);   /* enable interrupt */<br />        sei();<br />        while(1)<br />        {<br />           if(frame_ready)<br />           {<br />              lcd_locate(0,0);<br />              lcd_int(address);<br />              lcd_str(&quot;  &quot;);<br />              lcd_locate(1,0);<br />              lcd_int(command);<br />              lcd_str(&quot;  &quot;);<br />              frame_ready = 0;<br />           }<br />        }<br />}<br /> <br />ISR(TIMER1_CAPT_vect)<br />{<br />        static uint32_t temp_frame;<br />        static uint16_t last_icr;<br />        uint16_t width;<br />        static uint8_t frame_idx = 33;<br />        uint8_t bit = 2;<br />        width = ICR1 - last_icr;<br />        last_icr = ICR1;<br />        if(frame_idx == 33 &amp;&amp; width &gt; F_START - F_MARGIN &amp;&amp; width &lt; F_START + F_MARGIN)<br />        {<br />                frame_idx--;<br />        }<br />        if(frame_idx &lt; 32)<br />        {<br />                if(width &gt; F_ONE - F_MARGIN &amp;&amp; width &lt; F_ONE + F_MARGIN) bit = 1;<br />                if(width &gt; F_ZERO - F_MARGIN &amp;&amp; width &lt; F_ZERO + F_MARGIN) bit = 0;<br />                if(bit != 2)<br />                {<br />                        temp_frame |= (uint32_t)bit &lt;&lt; frame_idx;<br />                        if(frame_idx == 0)<br />                        {<br />                                address = (uint8_t)(temp_frame &gt;&gt; 24);<br />                                command = (uint8_t)(temp_frame &gt;&gt; 8);<br />                                temp_frame = 0;<br />                                frame_idx = 33;<br />                                frame_ready = 1;<br />                        }<br />                        else<br />                        {<br />                                frame_idx--;<br />                        }<br />                }<br />                else<br />                {<br />                        frame_idx = 33;<br />                }<br />        }<br />        if(frame_idx == 32) frame_idx--;<br />}[/syntax]<br /><br />Biblioteki od LCD też nie mam, no bo przecież jak nie kupisz książki to już nic nie napiszesz... nieistotne.<br /><br />Błędy:<br /><br />[syntax=c]../main.c:2:26: error: LCD/lcd44780.h: No such file or directory<br />../main.c: In function 'main':<br />../main.c:15: error: 'DDRA' undeclared (first use in this function)<br />../main.c:15: error: (Each undeclared identifier is reported only once<br />../main.c:15: error: for each function it appears in.)<br />../main.c:15: error: 'PA7' undeclared (first use in this function)<br />../main.c:16: error: 'PORTA' undeclared (first use in this function)<br />../main.c:20: warning: implicit declaration of function 'lcd_init'<br />../main.c:24: error: 'TIMSK1' undeclared (first use in this function)<br />../main.c:24: error: 'ICIE1' undeclared (first use in this function)<br />../main.c:25: warning: implicit declaration of function 'sei'<br />../main.c:30: warning: implicit declaration of function 'lcd_locate'<br />../main.c:31: warning: implicit declaration of function 'lcd_int'<br />../main.c:32: warning: implicit declaration of function 'lcd_str'<br />../main.c: At top level:<br />../main.c:42: warning: return type defaults to 'int'<br />../main.c: In function 'ISR':<br />../main.c:42: warning: type of '__vector_5' defaults to 'int'<br />make: *** &#91;main.o&#93; Error 1[/syntax]<br /><br />Poza oczywistą zmianą portu PA (bo w M8 go nie ma), wywaleniem LCD (chciałbym wynik binarny na diodach led - z tym sobie poradzę), mam taki kod:<br /><br />[syntax=c]#include &lt;avr/io.h&gt;<br />#include &quot;LCD/lcd44780.h&quot;<br /><br />#define F_START F_CPU/8000*13.5<br />#define F_ONE F_CPU/8000*2.25<br />#define F_ZERO F_CPU/8000*1.125<br />#define F_MARGIN F_CPU/8000*0.4<br /><br />volatile uint8_t frame_ready;<br />volatile uint8_t address;<br />volatile uint8_t command;<br /><br />int main(void)<br />{<br />        PORTD |= (1&lt;&lt;PD6); /* podciągnięcie wejścia IR */<br /><br />        lcd_init();     /* inicjalizacja LCD */<br />        /* ir timer */<br />        TCCR1B |= (1&lt;&lt;CS11);    /* prescaler = 8 */<br />        TCCR1B &amp;= ~(1&lt;&lt;ICES1);  /* falling edge */<br />        TIMSK1 |= (1&lt;&lt;ICIE1);   /* enable interrupt */<br />        sei();<br />        while(1)<br />        {<br />           if(frame_ready)<br />           {<br />              //address<br />              //command<br /><br />              frame_ready = 0;<br />           }<br />        }<br />}<br /><br />ISR(TIMER1_CAPT_vect)<br />{<br />        static uint32_t temp_frame;<br />        static uint16_t last_icr;<br />        uint16_t width;<br />        static uint8_t frame_idx = 33;<br />        uint8_t bit = 2;<br />        width = ICR1 - last_icr;<br />        last_icr = ICR1;<br />        if(frame_idx == 33 &amp;&amp; width &gt; F_START - F_MARGIN &amp;&amp; width &lt; F_START + F_MARGIN)<br />        {<br />                frame_idx--;<br />        }<br />        if(frame_idx &lt; 32)<br />        {<br />                if(width &gt; F_ONE - F_MARGIN &amp;&amp; width &lt; F_ONE + F_MARGIN) bit = 1;<br />                if(width &gt; F_ZERO - F_MARGIN &amp;&amp; width &lt; F_ZERO + F_MARGIN) bit = 0;<br />                if(bit != 2)<br />                {<br />                        temp_frame |= (uint32_t)bit &lt;&lt; frame_idx;<br />                        if(frame_idx == 0)<br />                        {<br />                                address = (uint8_t)(temp_frame &gt;&gt; 24);<br />                                command = (uint8_t)(temp_frame &gt;&gt; 8);<br />                                temp_frame = 0;<br />                                frame_idx = 33;<br />                                frame_ready = 1;<br />                        }<br />                        else<br />                        {<br />                                frame_idx--;<br />                        }<br />                }<br />                else<br />                {<br />                        frame_idx = 33;<br />                }<br />        }<br />        if(frame_idx == 32) frame_idx--;<br />}[/syntax]<br /><br />Błędy:<br />[syntax=c]../main.c: In function 'main':<br />../main.c:19: error: 'TIMSK1' undeclared (first use in this function)<br />../main.c:19: error: (Each undeclared identifier is reported only once<br />../main.c:19: error: for each function it appears in.)<br />../main.c:19: error: 'ICIE1' undeclared (first use in this function)<br />../main.c:20: warning: implicit declaration of function 'sei'<br />../main.c: At top level:<br />../main.c:34: warning: return type defaults to 'int'<br />../main.c: In function 'ISR':<br />../main.c:34: warning: type of '__vector_5' defaults to 'int'<br />make: *** &#91;main.o&#93; Error 1[/syntax]<br /><br /> krzaczy w tym miejscu:<br />[syntax=c]TIMSK1 |= (1&lt;&lt;ICIE1);   /* enable interrupt */[/syntax]<br /><br /><br />-- <br />Aha. Nie wiem czy to istotne, czy Dioda IR w M8 też ma być podciągnięta pod PD6 czy jednak PB0 ??<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2251">antynick</a> — 27 wrz 2014, o 16:35</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[xor]]></name></author>
<updated>2014-09-27T13:15:12+01:00</updated>
<published>2014-09-27T13:15:12+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96821#p96821</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96821#p96821"/>
<title type="html"><![CDATA[Re: Chinski pilot na podczerwień]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96821#p96821"><![CDATA[
<a href="http://forum.atnel.pl/topic7144.html"  class="postlink">http://forum.atnel.pl/topic7144.html</a><br /><a href="http://www.lirc.org/"  class="postlink">http://www.lirc.org/</a><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1774">xor</a> — 27 wrz 2014, o 13:15</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[sz4t4n]]></name></author>
<updated>2014-09-27T12:43:31+01:00</updated>
<published>2014-09-27T12:43:31+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96820#p96820</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96820#p96820"/>
<title type="html"><![CDATA[Re: Chinski pilot na podczerwień]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96820#p96820"><![CDATA[
Miałem kiedyś podobny pilot. Nadawał on w wielu różnych standardach. Sprawdź czy przypadkiem długie przyciśnięcie któregoś z przycisku nie zmienia standardu nadawania.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=377">sz4t4n</a> — 27 wrz 2014, o 12:43</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Jaglarz]]></name></author>
<updated>2014-09-27T12:37:12+01:00</updated>
<published>2014-09-27T12:37:12+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96819#p96819</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96819#p96819"/>
<title type="html"><![CDATA[Re: Chinski pilot na podczerwień]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96819#p96819"><![CDATA[
Proszę poprawić obrazek zgodnie z zaleceniami <!-- l --><a class="postlink-local" href="http://forum.atnel.pl/topic44.html" >topic44.html</a><!-- l --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=471">Jaglarz</a> — 27 wrz 2014, o 12:37</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[antynick]]></name></author>
<updated>2014-09-27T13:37:04+01:00</updated>
<published>2014-09-27T12:32:32+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96818#p96818</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96818#p96818"/>
<title type="html"><![CDATA[Chinski pilot na podczerwień]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=8644&amp;p=96818#p96818"><![CDATA[
Witam.<br />Zakupiłem na ibaju zestaw:<br /><a href="http://forum.atnel.pl/_obrazki/o/2251/0f2a762009b58a4ff1ee7b3c3c50c20d.jpg"  class="postlink"><img src="http://forum.atnel.pl/_obrazki/o/thumb/2251/0f2a762009b58a4ff1ee7b3c3c50c20d.jpg" alt="Obrazek" /></a><br /><br />Nie potrafię zdekodować sygnału jaki przesyła ten pilot.<br />RC5 to to chyba nie jest, bo RC5-Dekodowanie-przyklad-2.zip ze strony:<br /><br />nie odbiera danych.<br />Dane do terminala są odbierane (Putty) bo po restarcie otrzymuję napis:<br /><strong>&quot;Gotowy do dekodowania sygnalu RC-5!&quot;</strong><br />Odbiornik ma wbudowaną diodę i ona świeci podczas wciskania przycisków. Tak samo pulsuje dioda na PD6 Atmegi8 (1MHz wew)<br />Wszystkie piloty jakie posiadam w domu dają ten sam efekt.<br />Wiem że jest to opisane w Książce, ale niestety jeszcze jej nie posiadam.<br />Wiem, że mogę kupić pilot RC5, ale chciałbym użyć tego małego, zgrabnego.<br /><br />Czy istnieje jakiś sposób/program na zdekodowanie sygnału?? Niestety Oscyloskopa nie posiadam.<br /><br />Bardzo zależy mi na tym. Jestem nowicjuszem, ale szybko się uczę.<br /><br />Pozdrawiam.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2251">antynick</a> — 27 wrz 2014, o 12:32</p><hr />
]]></content>
</entry>
</feed>