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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2015-11-12T09:27:19+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=49&amp;t=11777&amp;mode</id>
<entry>
<author><name><![CDATA[Debooles]]></name></author>
<updated>2015-11-12T09:27:19+01:00</updated>
<published>2015-11-12T09:27:19+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=11777&amp;p=145153#p145153</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=11777&amp;p=145153#p145153"/>
<title type="html"><![CDATA[Re: [atmega 8][wstawka] problem z praca na &quot;kopi&quot; zmiennej]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=11777&amp;p=145153#p145153"><![CDATA[
Przydatna sprawa, no widziałem te nowe wstawki tak nie zapowiadały się obiecująco.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=10968">Debooles</a> — 12 lis 2015, o 09:27</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[tomasz1987]]></name></author>
<updated>2015-05-22T11:19:45+01:00</updated>
<published>2015-05-22T11:19:45+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=11777&amp;p=129836#p129836</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=11777&amp;p=129836#p129836"/>
<title type="html"><![CDATA[[atmega 8][wstawka] problem z praca na &quot;kopi&quot; zmiennej]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=11777&amp;p=129836#p129836"><![CDATA[
Witam,<br />po seansie o wstawkach assemblerowych zapragnąłem koniecznie coś napisać <img src="https://forum.atnel.pl/images/smilies/icon_e_biggrin.gif" alt=":D" title="Bardzo szczęśliwy" /><br /><br />wstęp :<br />port za względu na zaprojektowane PCB ma 2 najstarsze bity na końcu, czyli jest 54321067.<br /><br />opis problemu:<br />Za żadne skarby nie mogę wyciągnąć kopi :/<br /><br /><br />funkcje:<br />[syntax=c]void ror_bit(char *k)<br />{<br />asm volatile(&quot;lsr %&#91;rejestr&#93;    \n\t&quot;<br />&quot;brcc  koniec%=   \n\t&quot;<br />&quot;ori %&#91;rejestr&#93; ,128  \n\t&quot;<br />&quot;koniec%=:    \n\t&quot;<br />//&quot;out %&#91;port&#93;,%&#91;rejestr&#93;\n\t&quot;<br />:<br />:&#91;rejestr&#93;&quot;d&quot; (*k)//, &#91;port&#93;&quot;I&quot;(_SFR_IO_ADDR(PORTB)<br />);<br />}<br /><br /><br />void show_comand(uint8_t *k)<br />{<br />ror_bit(&amp;k);<br />ror_bit(&amp;k);<br />PORTB=k;<br /><br />}[/syntax]<br /><br />wywołanie w main:<br />[syntax=c]if( !Timer2 ) {<br />   Timer2=5;<br /><br />   show_comand(&amp;data);<br /><br />  }[/syntax]<br /><br /><br /><br />Następnym krokiem było usunięcie wskaźników i referencji z funkcji niestety nic to nie zmieniło. Więc już ostatnią deską ratunku utworzyłem nowy rejestr w funkcji ror_bit i tam mov'em przepisałem wynik przesuwania.<br /><br />[syntax=c]uint8_t ror_bit(uint8_t k)<br />{<br />uint8_t k2;<br />asm volatile(<br />&quot;lsr %&#91;rejestr&#93;    \n\t&quot;<br />&quot;brcc  koniec%=   \n\t&quot;<br />&quot;ori %&#91;rejestr&#93; ,128 \n\t&quot;<br />&quot;koniec%=:    \n\t&quot;<br />&quot;mov %&#91;rejestr2&#93;,%&#91;rejestr&#93;\n\t&quot;<br />:<br />:&#91;rejestr&#93;&quot;d&quot; (k), &#91;rejestr2&#93;&quot;d&quot; (k2)<br />);<br />return k2;<br />}<br /><br /><br />void show_comand(uint8_t k)<br />{<br />k=ror_bit(k);<br />k=ror_bit(k);<br />PORTB=k;<br /><br />}[/syntax]<br /><br />niestety wszystko wylądowało w malinach :/ proszę podpowiedzcie gdzie popełniłem błąd.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1096">tomasz1987</a> — 22 maja 2015, o 11:19</p><hr />
]]></content>
</entry>
</feed>