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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2017-10-24T09:58:05+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=19450&amp;mode</id>
<entry>
<author><name><![CDATA[Zealota]]></name></author>
<updated>2017-10-24T09:58:05+01:00</updated>
<published>2017-10-24T09:58:05+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19450&amp;p=197677#p197677</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19450&amp;p=197677#p197677"/>
<title type="html"><![CDATA[Re: Pilot na podczerwień RC6]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19450&amp;p=197677#p197677"><![CDATA[
<div class="quotetitle">Hannibal9 napisał(a):</div><div class="quotecontent"><br /><div class="quotetitle">Zealota napisał(a):</div><div class="quotecontent">Jak zwykle, polecam bibliotekę IRMP:<br /><!-- m --><a class="postlink" href="https://www.mikrocontroller.net/articles/IRMP_-_english" >https://www.mikrocontroller.net/articles/IRMP_-_english</a><!-- m --><br /></div><br /><br />Niestety nie znam angielskiego, nie wiem czy sobie z tym poradzę.</div><br /><br />W źródłach jest wiele przydatnych informacji, może na początek wystarczy Ci przykładowy kod ze źródeł:<br /><br />[syntax=c]/*---------------------------------------------------------------------------------------------------------------------------------------------------<br /> * irmp-main-avr.c - demo main module to test IRMP decoder on AVR<br /> *<br /> * Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de<br /> *<br /> * $Id: irmp-main-avr.c,v 1.2 2016/01/12 21:15:16 fm Exp $<br /> *<br /> * This demo module is runnable on AVRs<br /> *<br /> * ATMEGA88 @ 8 MHz internal RC      Osc with BODLEVEL 4.3V: lfuse: 0xE2 hfuse: 0xDC efuse: 0xF9<br /> * ATMEGA88 @ 8 MHz external Crystal Osc with BODLEVEL 4.3V: lfuse: 0xFF hfuse: 0xDC efuse: 0xF9<br /> *<br /> * This program is free software; you can redistribute it and/or modify<br /> * it under the terms of the GNU General Public License as published by<br /> * the Free Software Foundation; either version 2 of the License, or<br /> * (at your option) any later version.<br /> *---------------------------------------------------------------------------------------------------------------------------------------------------<br /> */<br /><br />#include &quot;irmp.h&quot;<br /><br />#ifndef F_CPU<br />#error F_CPU unknown<br />#endif<br /><br />static void<br />timer1_init (void)<br />{<br />#if defined (__AVR_ATtiny45__) || defined (__AVR_ATtiny85__)                // ATtiny45 / ATtiny85:<br /><br />#if F_CPU &gt;= 16000000L<br />    OCR1C   =  (F_CPU / F_INTERRUPTS / 8) - 1;                              // compare value: 1/15000 of CPU frequency, presc = 8<br />    TCCR1   = (1 &lt;&lt; CTC1) | (1 &lt;&lt; CS12);                                    // switch CTC Mode on, set prescaler to 8<br />#else<br />    OCR1C   =  (F_CPU / F_INTERRUPTS / 4) - 1;                              // compare value: 1/15000 of CPU frequency, presc = 4<br />    TCCR1   = (1 &lt;&lt; CTC1) | (1 &lt;&lt; CS11) | (1 &lt;&lt; CS10);                      // switch CTC Mode on, set prescaler to 4<br />#endif<br /><br />#else                                                                       // ATmegaXX:<br />    OCR1A   =  (F_CPU / F_INTERRUPTS) - 1;                                  // compare value: 1/15000 of CPU frequency<br />    TCCR1B  = (1 &lt;&lt; WGM12) | (1 &lt;&lt; CS10);                                   // switch CTC Mode on, set prescaler to 1<br />#endif<br /><br />#ifdef TIMSK1<br />    TIMSK1  = 1 &lt;&lt; OCIE1A;                                                  // OCIE1A: Interrupt by timer compare<br />#else<br />    TIMSK   = 1 &lt;&lt; OCIE1A;                                                  // OCIE1A: Interrupt by timer compare<br />#endif<br />}<br /><br />#ifdef TIM1_COMPA_vect                                                      // ATtiny84<br />#define COMPA_VECT  TIM1_COMPA_vect<br />#else<br />#define COMPA_VECT  TIMER1_COMPA_vect                                       // ATmega<br />#endif<br /><br />ISR(COMPA_VECT)                                                             // Timer1 output compare A interrupt service routine, called every 1/15000 sec<br />{<br />  (void) irmp_ISR();                                                        // call irmp ISR<br />  // call other timer interrupt routines...<br />}<br /><br />int<br />main (void)<br />{<br />    IRMP_DATA   irmp_data;<br /><br />    irmp_init();                                                            // initialize IRMP<br />    timer1_init();                                                          // initialize timer1<br /><br />    sei ();                                                                 // enable interrupts<br /><br />    for (;;)<br />    {<br />        if (irmp_get_data (&amp;irmp_data))<br />        {<br />            ;                                                               // got an IR message, do something<br />        }<br />    }<br />}[/syntax]<br /><br />Jest naprawdę przystępnie opisany. Oczywiście potrzebne są podstawy C i znajomość AVR<br /><br />Powyższy kod jest dla Atmega8 i częstotliwość zegara 8 MHz.<br />Musisz skonfigurować &quot;irmpconfig.h&quot; wybierając pin mikrokontrolera oraz protokoły jakie chcesz obsługiwać.<br /><br />Załączam projekt z Eclipse Neon, gdzie odbiornik jest ustawiony na PB0.<br />Ustawiłem protokoły na RC5 oraz RC6.<br /><br />Dalej już musisz sobie poradzić <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=16487">Zealota</a> — 24 paź 2017, o 09:58</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Hannibal9]]></name></author>
<updated>2017-10-24T09:16:25+01:00</updated>
<published>2017-10-24T09:16:25+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19450&amp;p=197674#p197674</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19450&amp;p=197674#p197674"/>
<title type="html"><![CDATA[Re: Pilot na podczerwień RC6]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19450&amp;p=197674#p197674"><![CDATA[
<div class="quotetitle">Zealota napisał(a):</div><div class="quotecontent"><br />Jak zwykle, polecam bibliotekę IRMP:<br /><!-- m --><a class="postlink" href="https://www.mikrocontroller.net/articles/IRMP_-_english" >https://www.mikrocontroller.net/articles/IRMP_-_english</a><!-- m --><br /></div><br /><br /><br />Niestety nie znam angielskiego, nie wiem czy sobie z tym poradzę.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7324">Hannibal9</a> — 24 paź 2017, o 09:16</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Zealota]]></name></author>
<updated>2017-10-24T09:05:18+01:00</updated>
<published>2017-10-24T09:05:18+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19450&amp;p=197672#p197672</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19450&amp;p=197672#p197672"/>
<title type="html"><![CDATA[Re: Pilot na podczerwień RC6]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19450&amp;p=197672#p197672"><![CDATA[
Jak zwykle, polecam bibliotekę IRMP:<br /><!-- m --><a class="postlink" href="https://www.mikrocontroller.net/articles/IRMP_-_english" >https://www.mikrocontroller.net/articles/IRMP_-_english</a><!-- m --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=16487">Zealota</a> — 24 paź 2017, o 09:05</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Hannibal9]]></name></author>
<updated>2017-10-24T08:41:47+01:00</updated>
<published>2017-10-24T08:41:47+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19450&amp;p=197670#p197670</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19450&amp;p=197670#p197670"/>
<title type="html"><![CDATA[Pilot na podczerwień RC6]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19450&amp;p=197670#p197670"><![CDATA[
Witam, czy walczył ktoś z pilotem na podczerwień nadającym w RC6? Posiadam takowy był razem z zabawką i chciałbym go jakoś wykorzystać do obsługi AVR-ow.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7324">Hannibal9</a> — 24 paź 2017, o 08:41</p><hr />
]]></content>
</entry>
</feed>