📄 mega8学习笔记(6)-------cocoguojia 原创--单片机实验室-----嘉哥.htm
字号:
face="Times New Roman"> </FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-US><o:p><FONT
face="Times New Roman"> </FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-US><FONT face="Times New Roman">void
main(void)</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-US><FONT
face="Times New Roman">{</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-US><FONT face="Times New Roman"><SPAN
style="mso-spacerun: yes">
</SPAN>init();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-US><FONT face="Times New Roman"><SPAN
style="mso-spacerun: yes">
</SPAN>while(1)</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-US><FONT face="Times New Roman"><SPAN
style="mso-spacerun: yes">
</SPAN>{</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-US><FONT face="Times New Roman"><SPAN
style="mso-spacerun: yes">
</SPAN>PORTB.0=1 ;<SPAN
style="mso-spacerun: yes">
</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-US><FONT face="Times New Roman"><SPAN
style="mso-spacerun: yes">
</SPAN>}</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-US><FONT
face="Times New Roman">}</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-US><o:p><FONT
face="Times New Roman"> </FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-US><FONT
face="Times New Roman">/*</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">小记:一开始我在中断利用</SPAN><SPAN
lang=EN-US><FONT face="Times New Roman"><SPAN
style="mso-spacerun: yes"> </SPAN>if(
ACSR&(1<<5)==0x00 ) </FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个语句,但调试结果不对,我就查原因,最中发现我在中断里</SPAN><FONT
face="Times New Roman"> </FONT><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不管是用</SPAN><SPAN
lang=EN-US><FONT face="Times New Roman"><SPAN
style="mso-spacerun: yes"> </SPAN>if(
ACSR&(1<<5)==0x00 )</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">还是</SPAN><SPAN
lang=EN-US><FONT face="Times New Roman"><SPAN
style="mso-spacerun: yes"> </SPAN>if(
ACSR&(1<<5)</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">!</SPAN><SPAN
lang=EN-US><FONT face="Times New Roman">=0x00
)</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">都不执行</SPAN><SPAN
lang=EN-US><FONT
face="Times New Roman">if</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里的语句,真是无奈了,查看资料说</SPAN><SPAN
lang=EN-US><FONT
face="Times New Roman">ACSR</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的第</SPAN><SPAN
lang=EN-US><FONT
face="Times New Roman">5</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为是只读,对啊,我这个句子就是读它啊,但就是读不出来,不是</SPAN><SPAN
lang=EN-US><FONT
face="Times New Roman">1</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也不是</SPAN><SPAN
lang=EN-US><FONT
face="Times New Roman">0</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,我就纳闷了,难道它是</SPAN><SPAN
lang=EN-US><FONT face="Times New Roman">
0.5------</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">狂晕!我到现在还是没查出来原因,若有谁知道,就帮我一下,告诉我其中的原因。用了一上午调试这个,被这个句子绊了</SPAN><SPAN
lang=EN-US><FONT
face="Times New Roman">--------</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">非</SPAN><SPAN
lang=EN-US><FONT
face="Times New Roman">1</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">非</SPAN><SPAN
lang=EN-US><FONT
face="Times New Roman">0</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">(数字量</SPAN><SPAN
lang=EN-US><FONT
face="Times New Roman">---</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">瞬时也是非</SPAN><SPAN
lang=EN-US><FONT
face="Times New Roman">1</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">非</SPAN><SPAN
lang=EN-US><FONT
face="Times New Roman">0</FONT></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">)的现象还是头一次遇到!!!</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">望高人指点一二,感激</SPAN><SPAN
lang=EN-US><FONT
face="Times New Roman">*/</FONT></SPAN></P></SPAN></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD height=3> </TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY class=seyle99>
<TR>
<TD>
<DIV align=right><A
href="http://www.mcublog.com/blog/blog2007/cocoguojia/archives/2008/28231.html#">阅读全文<SPAN
id=ob_logreaded></SPAN></A> | <A
href="http://www.mcublog.com/blog/blog2007/cocoguojia/archives/2008/28231.html#cmt">回复(1)</A>
<SPAN id=ob_logm28231></SPAN>| <A
href="http://www.mcublog.com/blog/showtb.asp?id=28231"
target=_blank>引用通告<SPAN id=ob_tbnum></SPAN></A> | <A
href="http://www.mcublog.com/blog/user_post.asp?logid=28231"
target=_blank>编辑</A></DIV></TD></TR></TBODY></TABLE>
<TABLE height=14 cellSpacing=0 cellPadding=0 width="100%"
align=center border=0>
<TBODY>
<TR>
<TD
class=content5></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<DIV id=blogaddon>
<LI>标签:<SPAN><A
href="http://www.mcublog.com/blog/blog2007/cocoguojia/cmd.html?uid=16550&do=tag_blogs&id=5599">ACSR</A></SPAN> <SPAN><A
href="http://www.mcublog.com/blog/blog2007/cocoguojia/cmd.html?uid=16550&do=tag_blogs&id=5600">ACO</A></SPAN> <SPAN><A
href="http://www.mcublog.com/blog/blog2007/cocoguojia/cmd.html?uid=16550&do=tag_blogs&id=485">mega8</A></SPAN> <SPAN><A
href="http://www.mcublog.com/blog/blog2007/cocoguojia/cmd.html?uid=16550&do=tag_blogs&id=33">avr</A></SPAN> <SPAN><A
href="http://www.mcublog.com/blog/blog2007/cocoguojia/cmd.html?uid=16550&do=tag_blogs&id=5559">cvavr</A></SPAN> <SPAN><A
href="http://www.mcublog.com/blog/blog2007/cocoguojia/cmd.html?uid=16550&do=tag_blogs&id=5591">自学</A></SPAN> </LI></DIV>
<DIV id=morelog>
<UL>
<LI>上一篇:<A
href="http://www.mcublog.com/blog/blog2007/cocoguojia/archives/2008/28227.html">Mega8学习笔记(5)-------cocoguojia 原创</A>
<LI>下一篇:<A
href="http://www.mcublog.com/blog/blog2007/cocoguojia/archives/2008/28232.html">Mega8学习笔记(7)-------cocoguojia 原创</A>
</LI></UL></DIV>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD>
<TABLE class=seyle4 cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD> </TD></TR>
<TR>
<TD
class=content9><STRONG>Re:Mega8学习笔记(6)-------cocoguojia 原创<A
name=15385></A></STRONG></TD></TR>
<TR>
<TD>
<DIV align=right>[ <SPAN id=t_15385>2008-6-1
19:31:42</SPAN> | By: <SPAN class=style3><SPAN
id=n_15385>大雁(游客)</SPAN></SPAN>
]</DIV></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD height=3> </TD></TR></TBODY></TABLE>
<TABLE style="TABLE-LAYOUT: fixed" cellSpacing=0 cellPadding=0
width="100%" align=center border=0>
<TBODY>
<TR>
<TD><SPAN class=oblog_text><A
href="http://www.mcublog.com/blog/go.asp?url=http://blog.sina.com.cn/yasiaFly "
target=_blank><IMG class=ob_face height=48 alt=大雁(游客)
src="Mega8学习笔记(6)-------cocoguojia 原创--单片机实验室-----嘉哥.files/ico_default.gif"
width=48 align=absMiddle></A><SPAN id=c_15385>if(
ACSR&(1<<5)==0x00 ) 改成
if((ACSR&(1<<5))==0x00 )
试试<BR>http://blog.sina.com.cn/yasiaFly 多多交流
^_^</SPAN></SPAN></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD height=3> </TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY class=seyle99>
<TR>
<TD>
<DIV align=right><A
href="http://www.mcublog.com/blog/go.asp?url=http://blog.sina.com.cn/yasiaFly "
target=_blank>个人主页</A> | <A
href="javascript:reply_quote('15385')">引用</A> | <A
href="http://www.mcublog.com/blog/blog2007/cocoguojia/archives/2008/28231.html#top">返回</A>
| <A
href="http://www.mcublog.com/blog/user_comments.asp?action=del&id=15385"
target=_blank>删除</A> | <A
href="http://www.mcublog.com/blog/user_comments.asp?action=modify&re=true&id=15385"
target=_blank>回复</A></DIV></TD></TR></TBODY></TABLE>
<TABLE height=14 cellSpacing=0 cellPadding=0 width="100%"
align=center border=0>
<TBODY>
<TR>
<TD
class=content5></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<DIV id=form_comment>
<DIV id=gg_usercomment></DIV><A name=cmt></A>
<DIV class=title>发表评论:</DIV>
<FORM id=commentform name=commentform
onsubmit="return Verifycomment()"
action=/blog/savecomment.asp?logid=28231 method=post>
<DIV class=d1><LABEL>昵称:<INPUT id=UserName maxLength=20
name=UserName></LABEL></DIV>
<DIV class=d2><LABEL>密码:<INPUT id=Password type=password
maxLength=20 name=Password> (游客无须输入密码)</LABEL></DIV>
<DIV class=d3><LABEL>主页:<INPUT id=homepage maxLength=50 size=42
value=http:// name=homepage></LABEL></DIV>
<DIV class=d4><LABEL>标题:<INPUT id=commenttopic maxLength=50 size=42
value=Re:Mega8学习笔记(6)-------cocoguojia 原创
name=commenttopic></LABEL></DIV>
<DIV class=d5><INPUT id=edit type=hidden name=edit>
<DIV id=oblog_edit>数据载入中...</DIV></DIV>
<DIV class=d6><SPAN id=ob_code></SPAN><INPUT onclick='oblog_edittext.createTextRange().execCommand("Copy");' type=submit value= 提 交 ></DIV></FORM></DIV></TD></TR></TBODY></TABLE></DIV></TD>
<TD vAlign=top align=right width=205><IMG height=425 alt=""
src="Mega8学习笔记(6)-------cocoguojia 原创--单片机实验室-----嘉哥.files/index_04.jpg"
width=150></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=1004 border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=#f4f4f4><IMG height=18 alt=""
src="Mega8学习笔记(6)-------cocoguojia 原创--单片机实验室-----嘉哥.files/index_16.jpg"
width=1004> </TD></TR></TBODY></TABLE><SPAN id=gg_userbot></SPAN>
<DIV id=powered><A href="http://www.mcublog.com/" target=_blank><IMG
alt="Powered by McuBLog."
src="Mega8学习笔记(6)-------cocoguojia 原创--单片机实验室-----嘉哥.files/mcublog_powered.gif"
border=0></A></DIV>
<SCRIPT
src="Mega8学习笔记(6)-------cocoguojia 原创--单片机实验室-----嘉哥.files/200805.htm"></SCRIPT>
<SCRIPT
src="Mega8学习笔记(6)-------cocoguojia 原创--单片机实验室-----嘉哥.files/count.htm"></SCRIPT>
<SCRIPT
src="Mega8学习笔记(6)-------cocoguojia 原创--单片机实验室-----嘉哥.files/commentedit.htm"></SCRIPT>
<SCRIPT
src="F:\download\mega8学习笔记\Mega8学习笔记(6)-------cocoguojia 原创--单片机实验室-----嘉哥.files\count(1).htm"></SCRIPT>
<SCRIPT src=""></SCRIPT>
<SCRIPT
src="Mega8学习笔记(6)-------cocoguojia 原创--单片机实验室-----嘉哥.files/ShowXml.htm"></SCRIPT>
<SCRIPT
src="F:\download\mega8学习笔记\Mega8学习笔记(6)-------cocoguojia 原创--单片机实验室-----嘉哥.files\count(2).htm"></SCRIPT>
</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -