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

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

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=30&amp;t=5897&amp;mode</id>
<entry>
<author><name><![CDATA[kicajek]]></name></author>
<updated>2014-02-24T23:12:12+01:00</updated>
<published>2014-02-24T23:12:12+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=71903#p71903</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=71903#p71903"/>
<title type="html"><![CDATA[Re: Przerobienie programu z Attiny44 pod Atmega8]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=71903#p71903"><![CDATA[
Witam<br />Ja nic nie zmieniałem poza nazwami rejestrów z zmianą PIN'ów ( ATmega ma inne niż było w oryginale)<br />Taktowanie 1MHz, bo dla 8 był tylko skrzek - może oryginał też był podróbką oryginalnych kogutów  <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /> <br /><br />EDIT:<br />Przeczytaj ten artykuł, który podałeś.<br />Jest tam takie coś:<br /><div class="quotetitle"><b>Quote:</b></div><div class="quotecontent"><br />Powoli dochodzimy do sedna programu <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" />. Funkcja EnableSirene() ustawia wartości początkowe dla poszczególnych tonów modulatora, m.in. wartości dla timera generującego określoną częstotliwość, szybkość zmian częstotliwości.<br /></div>  <br />..... kawałek kodu i dalej:<br /><div class="quotetitle"><b>Quote:</b></div><div class="quotecontent"><br />Występujące tutaj wartości min, max oraz wartości skalarne są dobrane tak aby częstotliwości generowane oraz szybkość zmian odpowiadały fabrycznemu generatorowi Zura. Przy modyfikacjach kodu może okazać się konieczna zmiana niektórych z nich.<br /></div><br /><br />Pozdr.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=826">kicajek</a> — 24 lut 2014, o 23:12</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kicajek]]></name></author>
<updated>2014-02-11T19:30:30+01:00</updated>
<published>2014-02-11T19:30:30+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=69953#p69953</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=69953#p69953"/>
<title type="html"><![CDATA[Re: Przerobienie programu z Attiny44 pod Atmega8]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=69953#p69953"><![CDATA[
Witam<br />W związku z prośbą kol.<strong>buczak</strong> podaję przerobiony kod ATtiny44/ATmega8.<br />Oryginalny kod znajduje się na stronie podanej przez kolegę niemniej jeśli jest to zabronione to proszę o jego ( tego mojego  <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /> ) usunięcie.<br />Wykorzystane PINY procesora opisane są w komentarzach.<br />ATmega8, taktowanie 1MHz.<br />[syntax=c]/*<br /> * zura1120.c<br /> *<br /> * Created: 2012-03-24 12:53:26<br /> *  Author: Bartosz Rosa<br /> *  More info:  http://onixarts.pl/blog/2014/01/modulator-zura-1120<br /> *  Licence:    Free for personal (not commercial use). You can execute, distribute, modify this code.<br /> *                              The only one restriction is to put original author info when You publish or distribute this code or some parts of it<br /> *                              or You create any hardware using this code.<br /> *                              It would be great if You could notice me on pelzak1@o2.pl when this piece of my work will be helpfull.<br /> */<br />#include &lt;avr/io.h&gt;<br />#include &lt;avr/iom8.h&gt;<br />#include &lt;util/delay_basic.h&gt;<br />#include &lt;avr/interrupt.h&gt;<br /><br />volatile uint8_t count;<br />volatile unsigned int sireneConfig;  // |||Reserved|SireneType0|AutoChangeSoundMode|LightsEnabled|SireneEnabled<br />volatile unsigned int sireneSound;<br /><br /> // - consts ----------------------------------<br /><br />#define SireneSound_None 0U<br />#define SireneSound_LeOn 1U<br />#define SireneSound_Wilk 2U<br />#define SireneSound_Pies 4U<br />#define SireneSound_SyrR  8U<br />#define SireneEnabledFlag 1U<br />#define LightsEnabledFlag 2U<br />#define AutoChangeSoundModeFlag 4U<br />#define ButtonLeOn 1U<br />#define ButtonWilk 2U<br />#define ButtonPies 4U<br />#define ButtonMix 8U<br />#define ButtonSyr_R 16U<br />#define ButtonLights 32U<br />#define LightsMainOutput (1&lt;&lt;PB1) // syrena<br />#define LightsLed1Output (1&lt;&lt;PD0) // led_1<br />#define LightsLed2Output (1&lt;&lt;PD1) // led_2<br /><br />const unsigned int min = 487;<br />const unsigned int max = 637;<br />const unsigned int min1 = 352;<br />const unsigned int max1 = 746;<br /><br />int sireneLoopCounter = 0;<br />int loopCounter = 0;<br />int lightsLoopCounter = 0;<br />int sireneSpeed = 20;<br />int direction=-2;<br /><br />void UpdateLights(void);<br />void EnableLights(void);<br />void DisableSirene(void);<br />void SetLightsLed1(uint8_t state);<br />void SetLightsLed2(uint8_t state);<br /><br />int autoChangeSoundCounter = 0U;<br />int autoChangeSoundIndex = 0U;<br /><br />ISR(TIMER2_COMP_vect)<br />{<br /><br />}<br /><br /><br />ISR(TIMER2_OVF_vect)<br /><br />{<br />UpdateLights();<br />}<br /><br />void EnableSirene(uint8_t sireneSoundToEnable, uint8_t autoMode )<br />{<br />        EnableLights();<br /><br />         sireneConfig |= SireneEnabledFlag;<br />         sireneSound = sireneSoundToEnable;<br /><br />        if( !autoMode )<br /><br />                      sireneConfig &amp;= ~AutoChangeSoundModeFlag;<br />                 else sireneConfig |=  AutoChangeSoundModeFlag;<br /><br /><br />        TCCR1B |= (1&lt;&lt;CS10);    // enables timer1<br /><br />        sireneLoopCounter = 0U;<br /><br />        switch( sireneSoundToEnable )<br /><br />        {<br /><br />                case SireneSound_LeOn:<br />                     OCR1A = min;<br />                     sireneSpeed = 2500;<br />                     break;<br /><br />                case SireneSound_Wilk:<br />                     sireneSpeed = 90;<br />                     break;<br /><br />                case SireneSound_Pies:<br />                     sireneSpeed = 2;<br />                     break;<br /><br />                case SireneSound_SyrR:   // start from the lowest frequency<br />                     OCR1A = max1;<br />                     sireneSpeed = 10;<br />                     direction = -2;<br />                     break;<br /><br />                default:<br /><br />                        DisableSirene();<br />        }<br />}<br /><br /><br />void DisableSirene()<br />{<br /><br />        sireneConfig &amp;= ~SireneEnabledFlag;<br />        TCCR1B &amp;= ~(1&lt;&lt;CS10);   // disable timer1<br />        PORTB &amp;= ~(1&lt;&lt;PB3);     // disable piezo<br />        OCR1A = max1;<br /><br />        sireneSound = SireneSound_None;<br /><br />        sireneConfig &amp;= ~AutoChangeSoundModeFlag; // mix mode disabled<br /><br />        direction = -2;<br /><br />}<br /><br /><br />void EnableLights()<br />{<br /><br />        sireneConfig |= LightsEnabledFlag;<br />        PORTB |= LightsMainOutput;<br /><br />}<br /><br /><br />void DisableLights()<br /><br />{<br /><br />        sireneConfig &amp;= ~SireneEnabledFlag;<br />        PORTB &amp;= ~LightsMainOutput;       //PORTD ?<br />        SetLightsLed1(0);<br />        SetLightsLed2(0);<br /><br />}<br /><br /><br /><br />void ToggleLights()<br /><br />{<br /><br />        sireneConfig ^= LightsEnabledFlag;<br />        if( sireneConfig &amp; LightsEnabledFlag)<br />                EnableLights();<br /><br />        else<br /><br />        {<br />                DisableLights();<br />                DisableSirene();<br />        }<br /><br />}<br /><br /><br /><br />void SetLightsLed1(uint8_t state)<br />{<br /><br />        if( state)<br />                PORTD |= LightsLed1Output;<br />        else<br />                PORTD &amp;= ~LightsLed1Output;<br /><br />}<br /><br /><br /><br />void SetLightsLed2(uint8_t state)<br />{<br />        if( state )<br />                PORTD |= LightsLed2Output;<br />        else<br />                PORTD &amp;= ~LightsLed2Output;<br /><br />}<br /><br /><br />void OnButtonPressed(uint8_t buttons)<br /><br />{<br /><br />        if( !(buttons &amp; ButtonLeOn) &amp;&amp; sireneSound != SireneSound_LeOn )<br />        {<br />                EnableSirene( SireneSound_LeOn, 0 );<br />        }<br /><br />        else if (!(buttons  &amp; ButtonWilk) &amp;&amp; sireneSound != SireneSound_Wilk)<br /><br />        {<br />                // if previus sound mode was le-on then siren starts from the lowest frequency - modulator specific behavior<br /><br />                if( sireneSound &amp; SireneSound_LeOn)<br /><br />                        OCR1A = max1;<br /><br />                EnableSirene(SireneSound_Wilk, 0);<br /><br />        }<br /><br />        else if (!(buttons  &amp; ButtonPies) &amp;&amp; sireneSound != SireneSound_Pies)<br /><br />        {<br /><br />                EnableSirene(SireneSound_Pies, 0);<br /><br />        }<br /><br />        else if (!(buttons  &amp; ButtonMix))<br /><br />        {<br /><br />                EnableSirene( SireneSound_LeOn, 1 );<br /><br />                loopCounter = 0;<br /><br />        }<br /><br />        else if( !(buttons  &amp; ButtonSyr_R) &amp;&amp; sireneSound != SireneSound_SyrR)<br /><br />        {<br /><br />                EnableSirene(SireneSound_SyrR, 0);<br /><br />        }<br /><br />        else if( !(buttons  &amp; ButtonLights) )<br /><br />        {<br /><br />                _delay_loop_2(0);<br /><br />                if( !(buttons &amp; ButtonLights ))<br /><br />                        ToggleLights();<br /><br />        }<br /><br />}<br /><br /><br /><br />uint8_t ReadButtons()<br /><br />{<br />        return PINC &amp; 63U;<br />}<br /><br /><br />void UpdateSireneTone()<br />{<br />        if( !(sireneConfig &amp; SireneEnabledFlag) )<br />                return;<br /><br />        if (sireneSound &amp; SireneSound_LeOn)<br />        {<br />                if( sireneLoopCounter &gt; sireneSpeed )<br />                {<br />                        if( OCR1A == max)<br />                            OCR1A = min;<br /><br />        else<br />                        OCR1A = max;<br />                        sireneLoopCounter = 0;<br />                }<br />        }<br /><br />        else if( sireneSound &amp; SireneSound_SyrR )<br />        {<br />                if( sireneLoopCounter &gt; sireneSpeed )<br />                {<br />                        if( !(sireneLoopCounter%sireneSpeed))<br />                                OCR1A+=direction;<br /><br />                       if(sireneLoopCounter == sireneSpeed*200)<br />                        {<br />                               direction = 0;<br />                        }<br /><br />                        if(sireneLoopCounter == sireneSpeed*250)<br /><br />                                direction = 2;<br /><br />                        if( sireneLoopCounter == sireneSpeed*520)<br /><br />                        {<br />                                DisableSirene();<br />                                sireneLoopCounter = 0;<br /><br />                        }<br /><br />                }<br /><br />        }<br /><br />        else<br /><br />        {<br />                if( sireneLoopCounter &gt; sireneSpeed )<br />                {<br />                       OCR1A+=direction;<br /><br />                        if(OCR1A &gt; max1)   direction = -2;<br />                        if(OCR1A &lt; min1)   direction =  2;<br /><br />                        sireneLoopCounter = 0;<br />                }<br />        }<br /><br />}<br /><br />// don't do that. This is the simplest approach but costs a half available flash in my AVR :)<br /><br />void UpdateLights()<br /><br />{<br /><br />        if( !(sireneConfig &amp; LightsEnabledFlag))<br /><br />                return;<br /><br /><br /><br />        lightsLoopCounter++;<br /><br /><br /><br />        if(lightsLoopCounter == 1)<br /><br />        {<br /><br />                SetLightsLed1(1);<br /><br />                SetLightsLed2(0);<br /><br />        }<br /><br />        else if(lightsLoopCounter == 20)<br /><br />        {<br /><br />                SetLightsLed1(0);<br /><br />                SetLightsLed2(1);<br /><br />        }<br /><br />        else if(lightsLoopCounter == 40)<br /><br />        {<br /><br />                SetLightsLed1(1);<br /><br />                SetLightsLed2(0);<br /><br />        }<br /><br />        else if(lightsLoopCounter == 60)<br /><br />        {<br /><br />                SetLightsLed1(0);<br /><br />                SetLightsLed2(1);<br /><br />        }<br /><br />        //------------------<br /><br />        else if(lightsLoopCounter == 80)<br /><br />        {<br /><br />                SetLightsLed1(1);<br /><br />                SetLightsLed2(0);<br /><br />        }<br /><br />        else if(lightsLoopCounter == 85)<br /><br />        {<br /><br />                SetLightsLed1(0);<br /><br />                SetLightsLed2(0);<br /><br />        }<br /><br />        else if(lightsLoopCounter == 90)<br /><br />        {<br /><br />                SetLightsLed1(1);<br /><br />                SetLightsLed2(0);<br /><br />        }<br /><br />        else if(lightsLoopCounter == 95)<br /><br />        {<br /><br />                SetLightsLed1(0);<br /><br />                SetLightsLed2(0);<br /><br />        }<br /><br />        //----------------------------------<br /><br />        else if(lightsLoopCounter == 100)<br /><br />        {<br /><br />                SetLightsLed1(0);<br /><br />                SetLightsLed2(1);<br /><br />        }<br /><br /><br /><br />        else if(lightsLoopCounter == 105)<br /><br />        {<br /><br />                SetLightsLed1(0);<br /><br />                SetLightsLed2(0);<br /><br />        }<br /><br />        else if(lightsLoopCounter == 110)<br /><br />        {<br /><br />                SetLightsLed1(0);<br /><br />                SetLightsLed2(1);<br /><br />        }<br /><br />        else if(lightsLoopCounter == 115)<br /><br />        {<br /><br />                SetLightsLed1(0);<br /><br />                SetLightsLed2(0);<br /><br />        }<br /><br />        //------------------<br /><br />        else if(lightsLoopCounter == 120)<br /><br />        {<br /><br />                SetLightsLed1(1);<br /><br />                SetLightsLed2(0);<br /><br />        }<br /><br />        else if(lightsLoopCounter == 125)<br /><br />        {<br /><br />                SetLightsLed1(0);<br /><br />                SetLightsLed2(0);<br /><br />        }<br /><br />        else if(lightsLoopCounter == 130)<br /><br />        {<br /><br />                SetLightsLed1(1);<br /><br />                SetLightsLed2(0);<br /><br />        }<br /><br />        else if(lightsLoopCounter == 135)<br /><br />        {<br /><br />                SetLightsLed1(0);<br /><br />                SetLightsLed2(0);<br /><br />        }<br /><br />        //------------------------<br /><br />        else if(lightsLoopCounter == 140)<br /><br />        {<br /><br />                SetLightsLed1(0);<br /><br />                SetLightsLed2(1);<br /><br />        }<br /><br />        else if(lightsLoopCounter == 145)<br /><br />        {<br /><br />                SetLightsLed1(0);<br /><br />                SetLightsLed2(0);<br /><br />        }<br /><br /><br /><br />        else if(lightsLoopCounter == 150)<br /><br />        {<br /><br />                SetLightsLed1(0);<br /><br />                SetLightsLed2(1);<br /><br />        }<br /><br />        else if(lightsLoopCounter == 155)<br /><br />        {<br /><br />                SetLightsLed1(0);<br /><br />                SetLightsLed2(0);<br /><br />                lightsLoopCounter = 0;<br /><br />        }<br /><br /><br /><br /><br /><br /><br /><br /><br /><br />}<br /><br /><br /><br />void UpdateMix()<br /><br />{<br /><br />        if( !(sireneConfig &amp; AutoChangeSoundModeFlag))<br /><br />                return;<br /><br /><br /><br />        loopCounter++;<br /><br /><br /><br />        if( loopCounter == 1 )<br /><br />        {<br /><br />                EnableSirene(SireneSound_LeOn, 1);<br /><br />        }<br /><br />        else if(loopCounter == 8000)<br /><br />        {<br /><br />                EnableSirene(SireneSound_Pies, 1);<br /><br />        }<br /><br />        else if(loopCounter == 16000)<br /><br />        {<br /><br />                EnableSirene(SireneSound_Wilk, 1);<br /><br />        }<br /><br />        else if(loopCounter == 24000)<br /><br />        {<br /><br />                EnableSirene(SireneSound_Pies, 1);<br /><br />        }<br /><br />        else if(loopCounter == 31000)<br /><br />        {<br /><br />                loopCounter = 0;<br /><br />        }<br /><br />}<br /><br /><br /><br />int main(void)<br /><br />{<br /><br />        // - buttons config -------------------<br />        // PC0 - LE-ON<br />        // PC1 - WILK<br />        // PC2 - PIES<br />        // PC3 - MIX<br />        // PC4 - SYR.R<br />        // PC5 - światła<br /><br /><br /><br />        DDRC  &amp;= ~((1&lt;&lt;PC0)|(1&lt;&lt;PC1)|(1&lt;&lt;PC2)|(1&lt;&lt;PC3)|(1&lt;&lt;PC4)|(1&lt;&lt;PC5));  // 0 = input<br />        PORTC |= (1&lt;&lt;PC0)|(1&lt;&lt;PC1)|(1&lt;&lt;PC2)|(1&lt;&lt;PC3)|(1&lt;&lt;PC4)|(1&lt;&lt;PC5);     // pull-up to 1<br /><br /><br /><br />        // - outputs config ------------------------<br />        // PB1 (OC1A) - piezo<br />        // PD2 - koguty<br />        // PD0 - LED1<br />        // PD1 - LED2<br /><br /><br /><br />        DDRB |= (1&lt;&lt;PB1);    // 1 = output PWM<br /><br />       PORTB &amp;= ~(1&lt;&lt;PB1);<br /><br /><br /><br />        DDRD |= (1&lt;&lt;PD0) | (1&lt;&lt;PD1)|(1&lt;&lt;PD2);    // 1 = output LED + koguty<br />        PORTD &amp;= ~((1&lt;&lt;PD0)|(1&lt;&lt;PD1)|(1&lt;&lt;PD2));<br /><br /><br /><br /><br /><br />   TCCR2 |= (1&lt;&lt;CS21) | (1&lt;&lt;CS20); // T0 prescaler<br /><br /><br /><br />   //Enable Overflow Interrupt Enable<br /><br />   TIMSK|=(1&lt;&lt;TOIE2);<br /><br /><br /><br />   // inicjalizacja liczników<br /><br />   TCNT2=0U;<br /><br /><br /><br /><br /><br />  // Timer1 config<br /><br />  // COM1A0 - toogle OC1A (piezo) on Compare Match<br /><br />  // WGM13:10 - Fast PWM mode, top = OCR1A<br /><br /><br /><br />   TCCR1A |= (1&lt;&lt;COM1A0)|(1&lt;&lt;WGM10)|(1&lt;&lt;WGM11); //clear on Compare match<br /><br />   TCCR1B |= (1&lt;&lt;WGM13)|(1&lt;&lt;WGM12); // fast pwm TOP = OCR1A<br /><br /><br /><br />        sei();<br /><br /><br /><br />        // variable init<br /><br />        sireneConfig = 0U;<br /><br />        autoChangeSoundCounter = 0U;<br /><br />        autoChangeSoundIndex = 0U;<br /><br /><br /><br />        // frequencies<br /><br />        OCR1A = max1;<br /><br />        TCCR1B &amp;= ~(1&lt;&lt;CS10);   // enable timer1<br /><br />        uint8_t mixHelperCounter = 0;<br /><br /><br /><br />        while(1)<br /><br />        {<br /><br />                int8_t button = ReadButtons();<br /><br />                if( button )<br /><br />                        OnButtonPressed( button );<br /><br /><br /><br />                sireneLoopCounter++;<br /><br /><br /><br />                UpdateSireneTone();<br /><br /><br /><br />                mixHelperCounter++;<br /><br />                if( mixHelperCounter ==5 )<br /><br />                {<br /><br />                        mixHelperCounter = 0;<br /><br />                        UpdateMix();<br /><br />                }<br /><br />   }<br /><br />}[/syntax]<br /><br />Pozdr.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=826">kicajek</a> — 11 lut 2014, o 19:30</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Mscichu]]></name></author>
<updated>2014-02-11T15:20:07+01:00</updated>
<published>2014-02-11T15:20:07+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=69879#p69879</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=69879#p69879"/>
<title type="html"><![CDATA[Re: Przerobienie programu z Attiny44 pod Atmega8]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=69879#p69879"><![CDATA[
A jak u Ciebie z kwestią podłączenia? Mogę chwilę posiedzieć, pytanie czy dasz radę podłączyć? Czy płytkę sam będziesz robił?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=853">Mscichu</a> — 11 lut 2014, o 15:20</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kicajek]]></name></author>
<updated>2014-02-09T11:58:23+01:00</updated>
<published>2014-02-09T11:58:23+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=69406#p69406</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=69406#p69406"/>
<title type="html"><![CDATA[Re: Przerobienie programu z Attiny44 pod Atmega8]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=69406#p69406"><![CDATA[
Witam<br /><div class="quotetitle">Marcin_G napisał(a):</div><div class="quotecontent"><br />Na pewno trzeba zmienić wektory przerwań trzeba zmienić TIMER0 na TIMER1<br /></div><br />TIMER1 jest zajęty, ale zostaje jeszcze T2.<br />Do kol.<strong>buczak</strong> - to nie jest niechęć do niesienia pomocy, tylko wskazówki jak sobie radzić przy migracji pomiędzy różnymi AVR'ami. Kol.Mirek cały czas podkreśla w swoich książkach, że uczymy się posługiwać datashetami. Oczywiście gdy sobie nie poradzisz pomoc na pewno przyjdzie.<br />Pozdr.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=826">kicajek</a> — 9 lut 2014, o 11:58</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Marcin_G]]></name></author>
<updated>2014-02-09T10:44:24+01:00</updated>
<published>2014-02-09T10:44:24+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=69390#p69390</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=69390#p69390"/>
<title type="html"><![CDATA[Re: Przerobienie programu z Attiny44 pod Atmega8]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=69390#p69390"><![CDATA[
Na pewno trzeba zmienić wektory przerwań trzeba zmienić TIMER0 na TIMER1 bo ATmega8 w timerze0 nie posiada trybu &quot;Compare Match&quot;.<br />Patrząc jednak na kod widać że wektor przerwania od Compare Match <br />[syntax=c]ISR(TIM0_COMPA_vect)<br />{<br />}[/syntax]<br />jest pusty, więc może wystarczy go zakomentować i reszta ruszy.<br />Musiałbyś jeszcze napewno zmienić ten wektor<br />[syntax=c]ISR(TIM0_OVF_vect)<br />{<br />   UpdateLights();<br />}[/syntax]<br />na taki<br />[syntax=c]ISR(TIMER0_OVF_vect)<br />{<br />   UpdateLights();<br />}[/syntax]<br /><br />no i jak będziesz miał trochę szczęścia to być może będzie to wszystko <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /> No a jeśli nie, to tak jak kolega pisał wyżej, noty przed oczy i '' alleluja i do przodu&quot; <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /> <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=758">Marcin_G</a> — 9 lut 2014, o 10:44</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kicajek]]></name></author>
<updated>2014-02-09T02:17:40+01:00</updated>
<published>2014-02-09T02:17:40+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=69365#p69365</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=69365#p69365"/>
<title type="html"><![CDATA[Re: Przerobienie programu z Attiny44 pod Atmega8]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5897&amp;p=69365#p69365"><![CDATA[
Witam<br />1.Wywal [syntax=c]#define F_CPU 8000000UL[/syntax]<br />2.Weź do ręki noty katalogowe obydwu uC i porównaj wpisy do rejestrów - może pójdzie bez przeróbek?<br /><br />Pozdr.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=826">kicajek</a> — 9 lut 2014, o 02:17</p><hr />
]]></content>
</entry>
</feed>