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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2014-07-26T20:01:21+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=8&amp;t=7923&amp;mode</id>
<entry>
<author><name><![CDATA[jacekk232]]></name></author>
<updated>2014-07-26T20:01:21+01:00</updated>
<published>2014-07-26T20:01:21+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7923&amp;p=89009#p89009</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7923&amp;p=89009#p89009"/>
<title type="html"><![CDATA[Re: Attiny25 - timer programowy.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7923&amp;p=89009#p89009"><![CDATA[
Zapomniałeś o włączeniu globalnego zezwolenia na przerwania <strong>sei();</strong><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=204">jacekk232</a> — 26 lip 2014, o 20:01</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mickeu]]></name></author>
<updated>2014-07-26T19:56:04+01:00</updated>
<published>2014-07-26T19:56:04+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7923&amp;p=89008#p89008</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7923&amp;p=89008#p89008"/>
<title type="html"><![CDATA[Attiny25 - timer programowy.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7923&amp;p=89008#p89008"><![CDATA[
Witam<br /><br />Mam problem z timerem programowym a konkretnie ze zmiana stanu portu.<br />Attiny25 - kwarc 16 Mhz<br />Port - PB0 (MOSI/DI/SDA/AIN0/OC0A/OC1A/AREF/PCINT0)<br />Co ty jest nie tak?<br /><br />[syntax=c]#define  F_CPU 16000000UL<br />#include &lt;avr/io.h&gt;<br />#include &lt;avr/interrupt.h&gt;<br /><br />void timer0_init();<br />void generator();<br /><br />volatile uint32_t Timer1;<br /><br />int main(void){<br /><br /><br />DDRB |= (1&lt;&lt;PB0)|(1&lt;&lt;PB1)|(1&lt;&lt;PB5);<br />timer0_init();<br /><br />while(1){<br /><br />generator();<br /><br />}<br />}<br /><br />void timer0_init(){<br /><br />TCCR0A |= (1&lt;&lt;WGM01); // Ustawia timer w tryb CTC<br />OCR0A = 1;<br />TCCR0B |= (1&lt;&lt;CS00); //Fcpu/1<br />TIMSK |= (1&lt;&lt;OCIE0A);<br />}<br /><br /><br />void generator(){<br />if (!Timer1){<br />Timer1=50;<br />PORTB ^= (1&lt;&lt;PB0);<br />}<br />}<br /><br />ISR (TIM0_COMPA_vect){<br />uint16_t x;<br />x = Timer1;<br />if (x) Timer1 = --x;<br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1584">mickeu</a> — 26 lip 2014, o 19:56</p><hr />
]]></content>
</entry>
</feed>