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

📄 【006】多位数码管动态显示 [51] -- 一步一脚印 -- 编程爱好者blog.htm

📁 本人写的STC单片机EEPROM功能程序
💻 HTM
📖 第 1 页 / 共 5 页
字号:
            <TABLE cellSpacing=5 cellPadding=0 width="95%" align=center 
border=0>
              <TBODY>
              <TR>
                <TD class=tb_title height=20>BLOG介绍</TD></TR>
              <TR>
                <TD class=tb_content 
                  height=20>新BLOG:blog.liuwentao.net<BR>-----------------------------<BR>C学习笔记<BR>-----------------------------<BR>出于对单片机及EDA技术的热爱,吾以日志的形式记录了相关的实验过程。新手上路,还望各路高手多多指教!<BR>-----------------------------<BR>本博客文章如未做特殊说明,均为本人原创,转载请注明出处,谢谢!<BR>-----------------------------</TD></TR>
              <TR>
                <TD class=tb_title height=20>文章类别</TD></TR>
              <TR>
                <TD class=tb_content height=20>·<A class=a1 
                  href="http://www.programfan.com/blog/blog.asp?blogid=2189&amp;columnid=2597">C学习笔记[]</A><BR>·<A 
                  class=a1 
                  href="http://www.programfan.com/blog/blog.asp?blogid=2189&amp;columnid=5588">电子技术()</A><BR>·<A 
                  class=a1 
                  href="http://www.programfan.com/blog/blog.asp?blogid=2189&amp;columnid=2598">51单片机【】</A><BR>·<A 
                  class=a1 
                  href="http://www.programfan.com/blog/blog.asp?blogid=2189&amp;columnid=3995">AVR单片机&lt;&gt;</A><BR>·<A 
                  class=a1 
                  href="http://www.programfan.com/blog/blog.asp?blogid=2189&amp;columnid=2599">EDA·HDL〖〗</A><BR>·<A 
                  href="http://www.programfan.com/blog/blog.asp?blogid=2189">所有文章</A></TD></TR>
              <TR>
                <TD class=tb_title height=20>最新评论</TD></TR>
              <TR>
                <TD class=tb_content height=20>·<A 
                  href="http://www.programfan.com/blog/article.asp?id=25450#comment" 
                  target=_blank>这个是可以根据指令的执行次序算出来的,这</A><BR>·<A 
                  href="http://www.programfan.com/blog/article.asp?id=25450#comment" 
                  target=_blank>真的很准确吗???回去试&nbsp;试&amp;</A><BR>·<A 
                  href="http://www.programfan.com/blog/article.asp?id=10067#comment" 
                  target=_blank>写得很详细,不错,谢谢!!</A><BR>·<A 
                  href="http://www.programfan.com/blog/article.asp?id=10226#comment" 
                  target=_blank>我感觉还是用数组好的多呀也很容易</A><BR>·<A 
                  href="http://www.programfan.com/blog/article.asp?id=10388#comment" 
                  target=_blank>能不能用for语句啊!</A><BR>·<A 
                  href="http://www.programfan.com/blog/article.asp?id=12535#comment" 
                  target=_blank>I&nbsp;like&nbsp;thi</A><BR>·<A 
                  href="http://www.programfan.com/blog/article.asp?id=11166#comment" 
                  target=_blank>Your&nbsp;pictures&amp;n</A><BR>·<A 
                  href="http://www.programfan.com/blog/article.asp?id=15371#comment" 
                  target=_blank>if(k&nbsp;==&nbsp;(i</A><BR>·<A 
                  href="http://www.programfan.com/blog/article.asp?id=16138#comment" 
                  target=_blank>高手,敬佩!</A><BR>·<A 
                  href="http://www.programfan.com/blog/article.asp?id=25346#comment" 
                  target=_blank>我叫你一声老师因为我什莫都不懂,你说的很</A><BR></TD></TR>
              <TR>
                <TD class=tb_title height=20>最新留言</TD></TR>
              <TR>
                <TD class=tb_content height=20>·<A 
                  href="http://www.programfan.com/blog/guestbook.asp?blogid=2189#20164">你那有最小二乘的c语言程序吗?</A><BR>·<A 
                  href="http://www.programfan.com/blog/guestbook.asp?blogid=2189#18780">指针</A><BR>·<A 
                  href="http://www.programfan.com/blog/guestbook.asp?blogid=2189#18668">高手!你的博客很好了!我看你C的</A><BR>·<A 
                  href="http://www.programfan.com/blog/guestbook.asp?blogid=2189#17838">好的,有空来深圳逛逛,我可以做做导游呀。</A><BR>·<A 
                  href="http://www.programfan.com/blog/guestbook.asp?blogid=2189#17831">hasomeboy:我在西安,做手机基带</A><BR>·<A 
                  href="http://www.programfan.com/blog/guestbook.asp?blogid=2189#17830">涛哥:&nbsp;&nbsp;不</A><BR>·<A 
                  href="http://www.programfan.com/blog/guestbook.asp?blogid=2189#17829">感谢这位hasomeboy朋友的关注!有</A><BR>·<A 
                  href="http://www.programfan.com/blog/guestbook.asp?blogid=2189#17828">此文涛是那个文涛拍案里的文涛吗???好样</A><BR>·<A 
                  href="http://www.programfan.com/blog/guestbook.asp?blogid=2189#17827">很好的东东。真是送人玫瑰,手留余香呀。主</A><BR>·<A 
                  href="http://www.programfan.com/blog/guestbook.asp?blogid=2189#13020">很有价值的BG,谢谢希望内容更丰</A><BR>&nbsp;&nbsp;&gt;<A 
                  href="http://www.programfan.com/blog/guestbook.asp?blogid=2189"><B>填写留言</B></A>&lt;</TD></TR>
              <TR>
                <TD class=tb_title height=20>收藏夹</TD></TR>
              <TR>
                <TD class=tb_content height=20>·<A 
                  href="http://blog.liuwentao.net/" 
                target=_blank>我的新Blog</A><BR></TD></TR>
              <TR>
                <TD class=tb_title height=20>BLOG 统计</TD></TR>
              <TR>
                <TD class=tb_content 
                  height=20>&nbsp;·创建于:2006-2-10<BR>&nbsp;·共<SPAN 
                  style="COLOR: #ff0000">152</SPAN>篇文章<BR>&nbsp;·共<SPAN 
                  style="COLOR: #ff0000">34</SPAN>条留言<BR>&nbsp;·共<SPAN 
                  style="COLOR: #ff0000">233</SPAN>条评论<BR>&nbsp;·访问统计:<SPAN 
                  style="COLOR: #ff0000">193679<BR><A 
                  href="http://www.programfan.com/blog/rss.asp?author=wentao"><IMG 
                  src="【006】多位数码管动态显示&nbsp;[51] -- 一步一脚印 -- 编程爱好者BLOG.files/rss2.gif" 
                  border=0></A></SPAN></TD></TR></TBODY></TABLE></TD>
          <TD class=tb_top vAlign=top width=556>
            <DIV 
            style="MARGIN-LEFT: 10px; WIDTH: 95%; WORD-BREAK: break-all; WORD-WRAP: break-word">
            <DIV 
            style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: #ff0000; TEXT-ALIGN: center"><BR>【006】多位数码管动态显示&nbsp;[51]</DIV>
            <DIV align=center>点击数:3511&nbsp;&nbsp;&nbsp;&nbsp;发布日期:2006-4-16 
            16:04:00&nbsp;&nbsp;<BR><A title="保存至编程爱好者收藏夹 myweb.pfan.cn" 
            href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(myweb=window.open('http://www.programfan.com/club/mywebedit.asp?title='+escape(d.title)+'&amp;url='+escape(d.location.href),'myweb','scrollbars=no,width=480,height=480,left=75,top=20,status=no,resizable=yes'));">【收藏】</A>&nbsp;<A 
            href="http://www.programfan.com/blog/article.asp?id=12535#comment">【评论】</A>&nbsp;<A 
            href="javascript:window.print()">【打印】</A>&nbsp;<A 
            href="http://bbs.programfan.com/" 
            target=_blank>【编程爱好者论坛】</A>&nbsp;<A 
            href="javascript:window.close()">【关闭】</A><BR></DIV>
            <DIV style="TEXT-ALIGN: right"><BR>&nbsp;</DIV>
            <DIV 
            style="WIDTH: 520px; WORD-BREAK: break-all; WORD-WRAP: break-word">
            <DIV id=td_content>
            <P>实验目的:数码管动态显示多位数字。<BR>实验参考:笨笨工作室 <FONT 
            color=#000000>实验五、多位数码动态显示</FONT>。(<A 
            href="http://www.bbmcu.com/Article/ShowArticle.asp?ArticleID=12" 
            target=_blank><FONT color=#0066ff 
            target="_blank">查看原文</FONT></A>)<BR>实验板: <FONT 
            color=#000000>FB51A(<A 
            href="http://blog.programfan.com/article.asp?id=11695" 
            target=_blank><FONT color=#0066ff>查看</FONT></A>)</FONT>。 
            <HR>
            该实验用到实验板的资源电路图如下: <BR>
            <P align=center><IMG 
            src="【006】多位数码管动态显示&nbsp;[51] -- 一步一脚印 -- 编程爱好者BLOG.files/fb51a_8_01_off.gif"></P>
            <P>其中P0口是段码,低电平有效。P2口是位码,高电平有效。P2.0口控制第1个数码管,一直到P2.7口控制第8个。该板的段码表如下:</P>
            <DIV class=quote-content><SPAN 
            style="FONT-FAMILY: 宋体">┌─────┬────────────────┬────┐<BR>ㄧ &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp;ㄧ P0.*: &nbsp;7 &nbsp;6 &nbsp;5 &nbsp;4 
            &nbsp;3 &nbsp;2 &nbsp;1 &nbsp;0 &nbsp;ㄧ P0口值 ㄧ<BR>ㄧ 十进制数 ㄧ &nbsp;段 : 
            &nbsp;d dp &nbsp;e &nbsp;c &nbsp;g &nbsp;b &nbsp;f &nbsp;a &nbsp;ㄧ 
            即段码 ㄧ<BR>├─────┼────────────────┼────┤<BR>ㄧ &nbsp; &nbsp;0 &nbsp; 
            &nbsp; ㄧ &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp;1 &nbsp;0 &nbsp;0 
            &nbsp;1 &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;ㄧ &nbsp;48H &nbsp; ㄧ<BR>ㄧ 
            &nbsp; &nbsp;1 &nbsp; &nbsp; ㄧ &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp;1 
            &nbsp;1 &nbsp;0 &nbsp;1 &nbsp;0 &nbsp;1 &nbsp;1 &nbsp;ㄧ &nbsp;ebH 
            &nbsp; ㄧ<BR>ㄧ &nbsp; &nbsp;2 &nbsp; &nbsp; ㄧ &nbsp; &nbsp; &nbsp; 
            &nbsp;0 &nbsp;1 &nbsp;0 &nbsp;1 &nbsp;0 &nbsp;0 &nbsp;1 &nbsp;0 
            &nbsp;ㄧ &nbsp;52H &nbsp; ㄧ<BR>ㄧ &nbsp; &nbsp;3 &nbsp; &nbsp; ㄧ 
            &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp;1 &nbsp;1 &nbsp;0 &nbsp;0 &nbsp;0 
            &nbsp;1 &nbsp;0 &nbsp;ㄧ &nbsp;62H &nbsp; ㄧ<BR>ㄧ &nbsp; &nbsp;4 
            &nbsp; &nbsp; ㄧ &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp;1 &nbsp;1 &nbsp;0 
            &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;1 &nbsp;ㄧ &nbsp;e1H &nbsp; ㄧ<BR>ㄧ 
            &nbsp; &nbsp;5 &nbsp; &nbsp; ㄧ &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp;1 
            &nbsp;1 &nbsp;0 &nbsp;0 &nbsp;1 &nbsp;0 &nbsp;0 &nbsp;ㄧ &nbsp;64H 
            &nbsp; ㄧ<BR>ㄧ &nbsp; &nbsp;6 &nbsp; &nbsp; ㄧ &nbsp; &nbsp; &nbsp; 
            &nbsp;0 &nbsp;1 &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;1 &nbsp;0 &nbsp;0 
            &nbsp;ㄧ &nbsp;44H &nbsp; ㄧ<BR>ㄧ &nbsp; &nbsp;7 &nbsp; &nbsp; ㄧ 
            &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp;1 &nbsp;1 &nbsp;0 &nbsp;1 &nbsp;0 
            &nbsp;1 &nbsp;0 &nbsp;ㄧ &nbsp;eaH &nbsp; ㄧ<BR>ㄧ &nbsp; &nbsp;8 
            &nbsp; &nbsp; ㄧ &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp;1 &nbsp;0 &nbsp;0 
            &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;ㄧ &nbsp;40H &nbsp; ㄧ<BR>ㄧ 
            &nbsp; &nbsp;9 &nbsp; &nbsp; ㄧ &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp;1 
            &nbsp;1 &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;ㄧ &nbsp;60H 
            &nbsp; ㄧ<BR>├─────┼────────────────┼────┤<BR>ㄧ &nbsp; &nbsp;0. 
            &nbsp; &nbsp;ㄧ &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;0 
            &nbsp;1 &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;ㄧ &nbsp;08H &nbsp; ㄧ<BR>ㄧ 
            &nbsp; &nbsp;1. &nbsp; &nbsp;ㄧ &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp;0 
            &nbsp;1 &nbsp;0 &nbsp;1 &nbsp;0 &nbsp;1 &nbsp;1 &nbsp;ㄧ &nbsp;abH 
            &nbsp; ㄧ<BR>ㄧ &nbsp; &nbsp;2. &nbsp; &nbsp;ㄧ &nbsp; &nbsp; &nbsp; 
            &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;1 &nbsp;0 &nbsp;0 &nbsp;1 &nbsp;0 
            &nbsp;ㄧ &nbsp;12H &nbsp; ㄧ<BR>ㄧ &nbsp; &nbsp;3. &nbsp; &nbsp;ㄧ 
            &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp;0 &nbsp;1 &nbsp;0 &nbsp;0 &nbsp;0 
            &nbsp;1 &nbsp;0 &nbsp;ㄧ &nbsp;22H &nbsp; ㄧ<BR>ㄧ &nbsp; &nbsp;4. 
            &nbsp; &nbsp;ㄧ &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp;0 &nbsp;1 &nbsp;0 
            &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;1 &nbsp;ㄧ &nbsp;a1H &nbsp; ㄧ<BR>ㄧ 
            &nbsp; &nbsp;5. &nbsp; &nbsp;ㄧ &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp;0 
            &nbsp;1 &nbsp;0 &nbsp;0 &nbsp;1 &nbsp;0 &nbsp;0 &nbsp;ㄧ &nbsp;24H 
            &nbsp; ㄧ<BR>ㄧ &nbsp; &nbsp;6. &nbsp; &nbsp;ㄧ &nbsp; &nbsp; &nbsp; 
            &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;1 &nbsp;0 &nbsp;0 
            &nbsp;ㄧ &nbsp;04H &nbsp; ㄧ<BR>ㄧ &nbsp; &nbsp;7. &nbsp; &nbsp;ㄧ 
            &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp;0 &nbsp;1 &nbsp;0 &nbsp;1 &nbsp;0 
            &nbsp;1 &nbsp;0 &nbsp;ㄧ &nbsp;aaH &nbsp; ㄧ<BR>ㄧ &nbsp; &nbsp;8. 
            &nbsp; &nbsp;ㄧ &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;0 
            &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;ㄧ &nbsp;00H &nbsp; ㄧ<BR>ㄧ 
            &nbsp; &nbsp;9. &nbsp; &nbsp;ㄧ &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp;0 
            &nbsp;1 &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;0 &nbsp;ㄧ &nbsp;20H 
            &nbsp; ㄧ<BR>└─────┴────────────────┴────┘</SPAN><BR></DIV>
            <P>各个数码管的段码都是p0口的输出,即各个数码管输入的段码都是一样的, 为了使其分别显示不同的数字, 
            可采用动态显示的方式,即先只让最低位显示0(含点),经过一段延时,再只让次低位显示1,如此类推。由视觉暂留,只要我们的延时时间足够短,就能够使得数码的显示看起来非常的稳定清楚。过程如下图。</P>
            <P><SPAN style="FONT-FAMILY: 宋体">┌─────┬────┬─────────┐<BR>ㄧ &nbsp; 
            段码 &nbsp; ㄧ &nbsp;位码 &nbsp;ㄧ &nbsp; &nbsp;显示器状态 &nbsp; 
            &nbsp;ㄧ<BR>├─────┼────┼─────────┤<BR>ㄧ &nbsp; 08H &nbsp; &nbsp;ㄧ 
            &nbsp;01H &nbsp; ㄧ □□□□□□□0. ㄧ<BR>ㄧ &nbsp; abH &nbsp; &nbsp;ㄧ 
            &nbsp;02H &nbsp; ㄧ □□□□□□1.□ ㄧ<BR>ㄧ &nbsp; 12H &nbsp; &nbsp;ㄧ 
            &nbsp;04H &nbsp; ㄧ □□□□□2.□□ ㄧ<BR>ㄧ &nbsp; 22H &nbsp; &nbsp;ㄧ 
            &nbsp;08H &nbsp; ㄧ □□□□3.□□□ ㄧ<BR>ㄧ &nbsp; a1H &nbsp; &nbsp;ㄧ 
            &nbsp;10H &nbsp; ㄧ □□□4.□□□□ ㄧ<BR>ㄧ &nbsp; 24H &nbsp; &nbsp;ㄧ 
            &nbsp;20H &nbsp; ㄧ □□5.□□□□□ ㄧ<BR>ㄧ &nbsp; 04H &nbsp; &nbsp;ㄧ 
            &nbsp;40H &nbsp; ㄧ □6.□□□□□□ ㄧ<BR>ㄧ &nbsp; aaH &nbsp; &nbsp;ㄧ 
            &nbsp;80H &nbsp; ㄧ 7.□□□□□□□ 
            ㄧ<BR>└─────┴────┴─────────┘</SPAN><BR></P>
            <P>采用上述方法思路编写如下:</P>
            <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; org&nbsp;&nbsp; 0000h</P>

⌨️ 快捷键说明

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