⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ec66 中国电子技术信息网 - avr-gcc编写的数字移位显示程序.htm

📁 avr-gcc编写的数字移位显示程序,使用AVR单片机
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0050)http://www.cetinet.com/article/list.asp?indexid=35 -->
<HTML><HEAD><TITLE>EC66 中国电子技术信息网 - avr-gcc编写的数字移位显示程序</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content=avr,gcc name=keywords>
<META content=专业的电子技术网站,全面的电子信息平台 name=description>
<META content=中国电子技术信息网 name=copyright>
<META content=General name=rating>
<META content=aoe name=DC.Creator>
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<META content=FrontPage.Editor.Document name=ProgId><LINK 
href="EC66 中国电子技术信息网 - avr-gcc编写的数字移位显示程序.files/style.css" type=text/css 
rel=stylesheet>
<STYLE type=text/css>BODY {
	SCROLLBAR-FACE-COLOR: #5b9595; SCROLLBAR-HIGHLIGHT-COLOR: #ffffff; SCROLLBAR-SHADOW-COLOR: #ffffff; SCROLLBAR-3DLIGHT-COLOR: #ffffff; SCROLLBAR-ARROW-COLOR: #ffffff; SCROLLBAR-TRACK-COLOR: #ffffff; SCROLLBAR-DARKSHADOW-COLOR: #ffffff
}
</STYLE>
</HEAD>
<BODY text=#000000 bgColor=#f3f3f3>
<DIV align=center>
<TABLE height=60 cellSpacing=0 cellPadding=0 width=750 border=0>
  <TBODY>
  <TR>
    <TD width=150>
      <DIV align=center><IMG 
      src="EC66 中国电子技术信息网 - avr-gcc编写的数字移位显示程序.files/myad.gif" border=0> 
    </DIV></TD>
    <TD width=450>
      <DIV align=center><A href="http://www.cetinet.com/article/images/ad2.asp" 
      target=_blank><IMG src="EC66 中国电子技术信息网 - avr-gcc编写的数字移位显示程序.files/ad2.gif" 
      border=0></A> </DIV></TD>
    <TD width=150>
      <DIV align=center><A 
      href="http://www.cetinet.com/article/images/adsmall.asp" 
      target=_blank><IMG 
      src="EC66 中国电子技术信息网 - avr-gcc编写的数字移位显示程序.files/adsmall.gif" border=0></A> 
      </DIV></TD></TR></TBODY></TABLE></DIV>
<HR width=750 color=#5b9595 SIZE=4>

<DIV align=center>
<TABLE cellSpacing=0 cellPadding=0 width=750 border=0>
  <TBODY>
  <TR>
    <TD>文章分类:单片机 -&gt; AVR系列单片机 -&gt; avr-gcc编写的数字移位显示程序</TD></TR></TBODY></TABLE>
<TABLE height=250 cellSpacing=0 cellPadding=0 width=750 border=0>
  <TBODY>
  <TR>
    <TD vAlign=top width=150 bgColor=#5b9595 height=240>
      <TABLE cellSpacing=0 width=150 border=0>
        <TBODY>
        <TR>
          <TD height=20></TD></TR>
        <TR>
          <TD height=20><FONT color=#ffffff>文章类别:</FONT></TD></TR>
        <TR>
          <TD height=20>
            <P align=center><FONT color=#f3f3f3>AVR系列单片机</FONT></P></TD></TR>
        <TR>
          <TD height=20><FONT color=#ffffff>文章来源:</FONT></TD></TR>
        <TR>
          <TD height=20><FONT color=#f3f3f3>
            <P align=center>恒坚电器</FONT></P></TD></TR>
        <TR>
          <TD height=20><FONT color=#ffffff>文章作者:</FONT></TD></TR>
        <TR>
          <TD height=20><FONT color=#f3f3f3>
            <P align=center>hejoin</FONT></P></TD></TR>
        <TR>
          <TD height=20><FONT color=#ffffff>关 键 字:</FONT></TD></TR>
        <TR>
          <TD height=20><FONT color=#f3f3f3>
            <P align=center>avr,gcc</FONT></P></TD></TR>
        <TR>
          <TD height=20><FONT color=#ffffff>今天阅读:</FONT></TD></TR>
        <TR>
          <TD height=20><FONT color=#f3f3f3>
            <P align=center>2</FONT></P></TD></TR>
        <TR>
          <TD height=20><FONT color=#ffffff>总共阅读:</FONT></TD></TR>
        <TR>
          <TD height=20><FONT color=#f3f3f3>
            <P align=center>901</FONT></P></TD></TR>
        <TR>
          <TD height=20><FONT color=#ffffff>加入日期:</FONT></TD></TR>
        <TR>
          <TD height=20><FONT color=#f3f3f3>
            <P align=center>2002-3-12</FONT></P></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 width=150 border=0>
        <TBODY>
        <TR>
          <TD height=20><FONT color=#ffffff>相关文章:</FONT> </TD></TR>
        <TR>
          <TD height=20>
            <DIV align=center><FONT color=#ffffff>暂时没有同类文章</FONT> 
        </DIV></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 width=150 border=0>
        <TBODY>
        <TR>
          <TD height=20></TD></TR>
        <TR>
          <TD height=20>
            <P align=center><FONT color=#ffffff>==关于文章版权==</FONT></P></TD></TR>
        <TR>
          <TD height=20><FONT 
            color=#ffffff><BR>“本站”本站站主原创文章,未经本人(帝国老手/aoe)许可其他媒体一律不得转载。<BR><BR>“本站整理”本站站主根据个人见解及他人经验总结整理的文章,其他媒体转载必须标明出处为我站。<BR><BR>“某单位或个人”全文转载来自网络上的文章,其他媒体转载与我站无关。<BR><BR>“未知”(1)来自网络,由于来源混乱,无从考证作者,其他媒体转载与我站无关。<BR><BR>“未知”(2)其文章也是本站站主原创的,只所以标注“未知”,主要是因为引用文字过多或其他原因。建议其他媒体转载标明出处为我站。<BR><BR>我站版权请标注:“www.EC66.com”或“中国电子技术信息网”字样。</FONT></TD></TR>
        <TR>
          <TD height=20></TD></TR></TBODY></TABLE></TD>
    <TD vAlign=top width=600 height=240>
      <TABLE height=20 cellSpacing=0 cellPadding=0 width=600 border=0>
        <TBODY>
        <TR>
          <TD bgColor=#5b9595>&nbsp;</TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=3 cellPadding=0 width=600 border=0>
        <TBODY>
        <TR>
          <TD bgColor=#aecece height=20>
            <DIV align=center><FONT 
            color=#0a52d8><B>avr-gcc编写的数字移位显示程序</B></FONT> </DIV></TD></TR>
        <TR>
          <TD width=600>〖文章转载或出处〗≡中国电子技术信息网≡ 网址:www.EC66.com</TD></TR>
        <TR>
          <TD 
            width=600>一个用来测试avr-gcc的数字移位实验,采用avr-gcc编写<BR>在hjavr上调试通过。<BR>;*****************************************<BR>;这是数字移位显示实验,<BR>;程序运行的结果<BR>;8个数码关循环显示"1"&nbsp;-&nbsp;"f","1."&nbsp;-&nbsp;"f."<BR>;此外,本程序好用到了hj1.asm中的延时程序<BR>;代码在hjavr学习开发系统上测试通过<BR>;*****************************************<BR><BR>.include"8515def.inc"&nbsp;<BR>;包含文件要和"器件支持"相一致,否则可能出错<BR>.org&nbsp;0x00<BR>rjmp&nbsp;main<BR>.org&nbsp;0x10<BR>main:ldi&nbsp;r17,high(RAMEND)&nbsp;<BR>out&nbsp;SPH,r17&nbsp;;设置堆栈高位<BR>ldi&nbsp;r17,low(RAMEND)&nbsp;<BR>out&nbsp;SPL,r17&nbsp;;设置堆栈低位<BR>ldi&nbsp;r17,0xff&nbsp;;设置端口方向为输出<BR>out&nbsp;ddra,r17<BR>out&nbsp;ddrc,r17&nbsp;<BR>out&nbsp;ddrd,r17<BR>ldi&nbsp;r17,0&nbsp;;数据<BR>out&nbsp;portd,r17<BR>lf:&nbsp;ldi&nbsp;r16,0x01&nbsp;;位选<BR>lp:&nbsp;push&nbsp;r16<BR>ldi&nbsp;r16,0xcf&nbsp;;延时参数<BR>rcall&nbsp;delay<BR>pop&nbsp;r16<BR>rcall&nbsp;disprsg&nbsp;;调用显示输出子程序<BR>inc&nbsp;r17<BR>rol&nbsp;r16&nbsp;;移位显示<BR>brcs&nbsp;lf&nbsp;;如果进位标志被设置重新执行循环<BR>cpi&nbsp;r17,$1f&nbsp;;否则顺序执行,检查显示数据<BR>brne&nbsp;lp&nbsp;;是否完成,如果没有完成继续循环<BR>rjmp&nbsp;main&nbsp;;否则,程序重新执行<BR><BR>;&nbsp;**********&nbsp;数码显示子程序<BR>disprsg:<BR>out&nbsp;porta,r16<BR>ldi&nbsp;zh,high(tab_nu*2)<BR>clr&nbsp;zl<BR>add&nbsp;zl,r17<BR>lpm&nbsp;<BR>out&nbsp;portc,r0<BR>ret<BR><BR>;&nbsp;*********&nbsp;延时子程序&nbsp;<BR>delay:&nbsp;push&nbsp;r16&nbsp;;延时程序<BR>l1:&nbsp;push&nbsp;r16<BR>l2:&nbsp;dec&nbsp;r16<BR>brne&nbsp;l2&nbsp;<BR>pop&nbsp;r16<BR>dec&nbsp;r16<BR>brne&nbsp;l1&nbsp;<BR>pop&nbsp;r16<BR>dec&nbsp;r16<BR>brne&nbsp;delay&nbsp;<BR>ret&nbsp;<BR>;&nbsp;****************************************<BR>;&nbsp;这是数字显示表格,其中&nbsp;带小数点的数字比不带小数点的数字大16<BR>;&nbsp;比如&nbsp;0&nbsp;的显示代码为&nbsp;0;那么&nbsp;0.的显示代码为&nbsp;16;如此类推<BR>.org&nbsp;0x80<BR>tab_nu:&nbsp;.db&nbsp;0xc0&nbsp;,0xf9,&nbsp;0xa4,&nbsp;0xb0,&nbsp;0x99,&nbsp;0x92,&nbsp;0x82,0xf8&nbsp;;&nbsp;number&nbsp;0&nbsp;to&nbsp;7&nbsp;no&nbsp;dp..<BR>.db&nbsp;0x80&nbsp;,0x90,&nbsp;0x88,&nbsp;0x83,&nbsp;0xc6,&nbsp;0xa1,&nbsp;0x86,0x8e&nbsp;;&nbsp;number&nbsp;8&nbsp;to&nbsp;f&nbsp;no&nbsp;dp..<BR>.db&nbsp;0x40&nbsp;,0x79,&nbsp;0x24,&nbsp;0x30,&nbsp;0x19,&nbsp;0x12,&nbsp;0x02,0x78&nbsp;;&nbsp;number&nbsp;0&nbsp;to&nbsp;7&nbsp;with&nbsp;dp..<BR>.db&nbsp;0x00&nbsp;,0x10,&nbsp;0x08,&nbsp;0x03,&nbsp;0x46,&nbsp;0x21,&nbsp;0x06,0x0e&nbsp;;&nbsp;number&nbsp;8&nbsp;to&nbsp;f&nbsp;with&nbsp;dp..<BR>.db&nbsp;0x00&nbsp;,0x00</TD></TR>
        <TR>
          <TD width=600></TD></TR>
        <TR>
          <TD width=600><B>郑重声明</B><BR>&nbsp;&nbsp; 
            近年来我站数百篇“原创文章”被一些媒体肆意转载,不但不标明出自“中国电子技术信息网”,而且把相关字眼删除!这是无视技术价值的盗窃行为,是对技术人员辛勤劳动的蔑视,我对此种行为表示强烈的谴责。<BR>&nbsp;&nbsp; 
            “本是同根生,相煎何太急”,考虑到我们做技术的都是同门兄弟,对以前的盗窃行为不再追究,今后再有此类事件,最低处理限度是“明示于天下”。在这里向转载过又标注了出处的兄弟媒体表示崇高的敬意!<BR>&nbsp;&nbsp; 
            兄弟网站如果引用本站“原创文章”,请首先经本人许可,并标注“www.EC66.com”或“中国电子技术信息网”字样。<BR>&nbsp;&nbsp; 
            欢迎个人下载使用!</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR><BR></DIV>
<P 
align=center>本站所载文章力求原创,部分资料转自网上,转载文章均注明出处。<BR>假如您认为某些文章侵犯了您的权益,请告知我们,我们将在最短的时间内删除有关文章。<BR>如果您对文章内容有任何心得或异议,请到<A 
href="http://www.cetinet.com/bbs/index.asp" target=_blank><FONT 
color=red>技术论坛</FONT></A>发表高见!</P>
<P align=center>中国电子技术信息网 文章管理系统由:Aoe 制作<BR>Copyright (C) 2001-2004 EC66.COM All 
Rights Reserved</P></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -