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

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

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=8&amp;t=9699&amp;mode</id>
<entry>
<author><name><![CDATA[kurnachatka]]></name></author>
<updated>2014-12-15T14:39:12+01:00</updated>
<published>2014-12-15T14:39:12+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9699&amp;p=108828#p108828</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9699&amp;p=108828#p108828"/>
<title type="html"><![CDATA[Re: Miganie diod]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9699&amp;p=108828#p108828"><![CDATA[
Może tak:<br /><br />[syntax=c]#include &lt;avr/io.h&gt;<br />#include &lt;avr/interrupt.h&gt;<br /><br />#define PORT_LED (PORTB)<br /><br />#define PIN_LED_X (1&lt;&lt;PB3) //D1 PWM2<br />#define LED_X_ON (PORT_LED |= PIN_LED_X)<br />#define LED_X_OFF (PORT_LED &amp;= ~PIN_LED_X)<br />#define LED_X_TOGG (PORT_LED ^= PIN_LED_X)<br /><br />#define PIN_LED_Y (1&lt;&lt;PB4) //D2 PWM3<br />#define LED_Y_ON (PORT_LED |= PIN_LED_Y)<br />#define LED_Y_OFF (PORT_LED &amp;= ~PIN_LED_Y)<br />#define LED_Y_TOGG (PORT_LED ^= PIN_LED_Y)<br /><br />#define PIN_LED_Z (1&lt;&lt;PB1) //D3 PWM1<br />#define LED_Z_ON (PORT_LED |= PIN_LED_Z)<br />#define LED_Z_OFF (PORT_LED &amp;= ~PIN_LED_Z)<br />#define LED_Z_TOGG (PORT_LED ^= PIN_LED_Z)<br /><br />void InitLEDs(void);<br /><br />int main(void)<br />{<br />InitLEDs();<br /><br />sei();<br />LED_X_ON;<br />LED_Y_ON;<br />LED_Z_ON;<br /><br />while(1)<br />{<br /><br />}<br />}<br /><br />void InitLEDs(void)<br />{<br />DDRB |= PIN_LED_X|PIN_LED_Y | PIN_LED_Z; //set diodes as output<br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=930">kurnachatka</a> — 15 gru 2014, o 14:39</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Jaglarz]]></name></author>
<updated>2014-12-15T14:35:55+01:00</updated>
<published>2014-12-15T14:35:55+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9699&amp;p=108824#p108824</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9699&amp;p=108824#p108824"/>
<title type="html"><![CDATA[Re: Miganie diod]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9699&amp;p=108824#p108824"><![CDATA[
Proszę poprawić <!-- 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> — 15 gru 2014, o 14:35</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[reverse]]></name></author>
<updated>2014-12-15T14:30:27+01:00</updated>
<published>2014-12-15T14:30:27+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9699&amp;p=108822#p108822</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9699&amp;p=108822#p108822"/>
<title type="html"><![CDATA[Miganie diod]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9699&amp;p=108822#p108822"><![CDATA[
Dzień dobry,<br />pracuję aktualnie nad projektem opartym o mikrokontroler ATtiny167, który ma pobierać dane z czujników (I2C) i następnie je przetwarzać.<br /><br />Problem jest dosyć dziwny ponieważ przy najzwyklejszym świeceniu diodą zamiast otrzymać ciągłe światło dioda migocze.<br /><div class="quotetitle"><b>Quote:</b></div><div class="quotecontent"><br />#define PORT_LED (PORTB)<br /><br />#define PIN_LED_X (1&lt;&lt;PB3)//D1 PWM2<br />#define LED_X_ON (PORT_LED |= PIN_LED_X)<br />#define LED_X_OFF (PORT_LED &amp;= ~PIN_LED_X)<br />#define LED_X_TOGG (PORT_LED ^= PIN_LED_X)<br /><br />#define PIN_LED_Y (1&lt;&lt;PB4)//D2 PWM3<br />#define LED_Y_ON (PORT_LED |= PIN_LED_Y)<br />#define LED_Y_OFF (PORT_LED &amp;= ~PIN_LED_Y)<br />#define LED_Y_TOGG (PORT_LED ^= PIN_LED_Y)<br /><br />#define PIN_LED_Z (1&lt;&lt;PB1)//D3 PWM1<br />#define LED_Z_ON (PORT_LED |= PIN_LED_Z)<br />#define LED_Z_OFF (PORT_LED &amp;= ~PIN_LED_Z)<br />#define LED_Z_TOGG (PORT_LED ^= PIN_LED_Z)<br /><br />int main(void)<br />{<br />void InitLEDs();<br /><br />sei();<br />LED_X_ON;<br />LED_Y_ON;<br />LED_Z_ON;<br /><br />    while(1)<br />    {<br />;<br />}<br />}<br /><br />void InitLEDs(void)<br />{<br />DDRB |= PIN_LED_X|PIN_LED_Y | PIN_LED_Z;//set diodes as output<br />}<br /></div><br /><br />Jest to dosyć uproszczony szkielet programu ale nie ma w nim na razie żadnych przerwań a i tak zamiast prostego zaświecenia diodami układ miga. Nie mam pojęcia z czym to może być związane. Myślałem że może układ się resetuje ale to chyba nie to.<br /><br />Z góry dzięki za odpowiedzi i sugestie.<br /><br />Pozdrawiam<br />Michał<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1769">reverse</a> — 15 gru 2014, o 14:30</p><hr />
]]></content>
</entry>
</feed>