初识AtmelStudio7,创建ASF项目成功但无实验现象,求大神帮看看

2019-11-22 15:42发布

<p>本人接触AVR单片机不久,参见网上创建ASF项目操作流程,程序编译成功,通过智峰软件设置熔丝并下载成功后,实验板(网购)上At</p><p>mega16单片机PC6控制的继电器,无任何现象。不知参数是否设置完整,求各位大神解答!!!</p> <br><p> 程序如下:</p> <p><br></p><pre style="max-width: 100%;"><code class="cpp hljs" codemark="1">#include &lt;asf.h&gt;<br><br>#define RELAY IOPORT_CREATE_PIN(PORTC,6)<br><br>int main (void)<br>{<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;/* Insert system&nbsp;<a href="http://www.elecfans.com/tags/Clock/" target="_blank">clock</a>&nbsp;ini<a href="http://bbs.elecfans.com/zhuti_715_1.html" target="_blank">ti</a>alization code here (sysclk_init()). */<br><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;board_init();<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;delay_init();<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;ioport_init();<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;ioport_set_pin_dir(RELAY,IOPORT_DIR_OUTPUT);<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;ioport_set_pin_level(RELAY,IOPORT_PIN_LEVEL_LOW);&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;while(1)<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; ioport_toggle_pin_level(RELAY);<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; delay_ms(500);<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;/* Insert application code here, after the board has been initialized. */<br>}</code></pre><p><br></p><asf.h> } <ignore_js_op> <dl class="tattl attm"> <dd> <img src="data/attach/1911/b6v69rssf9kimxexkwhp2aqljqyloi75.jpg" alt="213637myobj6vhboo55x19(2).jpg" title="213637myobj6vhboo55x19(2).jpg"> </dd> </dl> </ignore_js_op> </asf.h><p><br></p>
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。