CodeVisionAVR: Porovnání verzí

Z MediaWiki SPŠ a VOŠ Písek
Skočit na navigaci Skočit na vyhledávání
Bez shrnutí editace
Obsah stránky nahrazen textem „===www=== http://www.hpinfotech.ro/html/cvavr.htm [http://courses.cit.cornell.edu/ee476/codevisionC/cvavrman.pdf Manuál] [http://www.atmel.com/dyn/resources...“
Řádek 8: Řádek 8:


[http://www.hpinfotech.ro/html/cvavr.htm download]
[http://www.hpinfotech.ro/html/cvavr.htm download]
<html>
Version:0.9
StartHTML:0000000105
EndHTML:0000006738
StartFragment:0000001499
EndFragment:0000006722
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mikroIDE</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="generator" content="SynEdit HTML exporter" />
<style type="text/css">
<!--
body { color: #000000; background-color: #FFFFFF; }
body { font-family: Courier New; font-size: 14pt; }
.cpp1-activecomment { color: #0A246A; font-style: italic; text-decoration: underline; }
.cpp1-assembler { color: #FF0000; }
.cpp1-binary { color: #800000; }
.cpp1-comment { color: #008000; font-style: italic; }
.cpp1-float { color: #800000; }
.cpp1-hexadecimal { color: #008000; }
.cpp1-character { color: #808000; }
.cpp1-identifier { color: #000000; }
.cpp1-illegalchar { color: #FF0000; }
.cpp1-imagelink { color: #800080; font-style: italic; text-decoration: underline; }
.cpp1-number { color: #008000; }
.cpp1-octal { color: #0000FF; }
.cpp1-preprocessor { color: #8000FF; font-style: italic; }
.cpp1-reservedword { color: #000000; font-weight: bold; }
.cpp1-space { color: #D4D0C8; }
.cpp1-string { color: #0000FF; }
.cpp1-symbol { color: #000000; }
.cpp1-weblink { color: #0A246A; font-style: italic; text-decoration: underline; }
-->
</style>
</head>
<body>
<!--StartFragment--><pre><code><span class="cpp1-comment">/*Chip&nbsp;type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;ATmega32
Program&nbsp;type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;Application
AVR&nbsp;Core&nbsp;Clock&nbsp;frequency:&nbsp;16,000000&nbsp;MHz
*****************************************************/
//#define&nbsp;F_CPU&nbsp;1600000UL
//#include&nbsp;&lt;mega32.h&gt;
//#include&nbsp;&lt;delay.h&gt;
//&nbsp;Declare&nbsp;your&nbsp;global&nbsp;variables&nbsp;here
</span><span class="cpp1-preprocessor">#define&nbsp;LED1&nbsp;0b10000000&nbsp;&nbsp;&nbsp;</span><span class="cpp1-comment">//definování
</span><span class="cpp1-preprocessor">#define&nbsp;LED2&nbsp;0b00000001
#define&nbsp;CEKAT&nbsp;500&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-comment">//hodnota&nbsp;500&nbsp;ms
</span><span class="cpp1-reservedword">void</span><span class="cpp1-space">&nbsp;</span><span class="cpp1-identifier">main(</span><span class="cpp1-reservedword">void</span><span class="cpp1-symbol">)
{
</span><span class="cpp1-comment">//&nbsp;Declare&nbsp;your&nbsp;local&nbsp;variables&nbsp;here
</span><span class="cpp1-reservedword">unsigned</span><span class="cpp1-space">&nbsp;</span><span class="cpp1-reservedword">int</span><span class="cpp1-space">&nbsp;</span><span class="cpp1-identifier">i;
</span><span class="cpp1-comment">//&nbsp;Port&nbsp;A&nbsp;initialization
</span><span class="cpp1-identifier">PORTA=</span><span class="cpp1-binary">0b11111111</span><span class="cpp1-symbol">;</span><span class="cpp1-space">&nbsp;</span><span class="cpp1-comment">//na&nbsp;budoucích&nbsp;výstupech&nbsp;&quot;1&quot;
</span><span class="cpp1-identifier">DDRA=</span><span class="cpp1-binary">0b11111111</span><span class="cpp1-symbol">;</span><span class="cpp1-space">&nbsp;&nbsp;</span><span class="cpp1-comment">//&nbsp;PortA&nbsp;jako&nbsp;výstupní
</span><span class="cpp1-reservedword">while</span><span class="cpp1-space">&nbsp;</span><span class="cpp1-symbol">(</span><span class="cpp1-number">1</span><span class="cpp1-symbol">);</span><span class="cpp1-space">        </span><span class="cpp1-comment">//&nbsp;Nekone&#269;ná&nbsp;smy&#269;ka
</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-symbol">{
</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-comment">//&nbsp;Place&nbsp;your&nbsp;code&nbsp;here
</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-reservedword">for</span><span class="cpp1-space">&nbsp;</span><span class="cpp1-symbol">(i=</span><span class="cpp1-number">0</span><span class="cpp1-symbol">;i&lt;</span><span class="cpp1-number">7</span><span class="cpp1-symbol">;i++);
</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-symbol">{
</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-identifier">PORTA</span><span class="cpp1-space">&nbsp;</span><span class="cpp1-symbol">=</span><span class="cpp1-space">&nbsp;</span><span class="cpp1-identifier">PORTA&lt;&lt;</span><span class="cpp1-number">1</span><span class="cpp1-symbol">;
</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-symbol">}
</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-identifier">delay_ms(CEKAT);</span><span class="cpp1-space">&nbsp;&nbsp;</span><span class="cpp1-comment">//zpo&#382;d&#283;ní
</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-identifier">PORTA=LED1;
</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-reservedword">for</span><span class="cpp1-space">&nbsp;</span><span class="cpp1-symbol">(i=</span><span class="cpp1-number">0</span><span class="cpp1-symbol">;i&lt;</span><span class="cpp1-number">7</span><span class="cpp1-symbol">;i++);
</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-symbol">{
</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-identifier">PORTA</span><span class="cpp1-space">&nbsp;</span><span class="cpp1-symbol">=</span><span class="cpp1-space">&nbsp;</span><span class="cpp1-identifier">PORTA&gt;&gt;</span><span class="cpp1-number">1</span><span class="cpp1-symbol">;
</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-symbol">}
</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-identifier">delay_ms(CEKAT);
</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-identifier">PORTA=LED2;</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-comment">//p&#345;i&#345;azení&nbsp;portuA
</span><span class="cpp1-space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="cpp1-symbol">}
}
</span></code></pre><!--EndFragment--></body>
</html>
</html>

Verze z 23. 4. 2011, 09:35