📄 ʰ
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0037)http://go.163.com/~czlyzhj/yjkf_2.htm -->
<HTML><HEAD><TITLE>银行利率屏的设计</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR>
<META content=none name="Microsoft Theme">
<META content="none, default" name="Microsoft Border"></HEAD>
<BODY background=""><B>
<P align=center><FONT face=宋体 size=6>银行利率屏的设计</FONT></P></B><FONT face=宋体
size=3>
<P align=justify> </P></FONT>
<P align=justify><FONT face=宋体 size=3>
银行利率屏多采用单片机控制的</FONT><FONT face=Arial size=3>LED</FONT><FONT face=宋体
size=3>显示,尽管单片机控制</FONT><FONT face=Arial size=3>LED</FONT><FONT face=宋体
size=3>显示已不是什么新技术,但由于利率屏所用</FONT><FONT face=Arial size=3>LED</FONT><FONT face=宋体
size=3>数量多(达到数百到上千),每个</FONT><FONT face=Arial size=3>LED</FONT><FONT face=宋体
size=3>的驱动电流大(达数百毫安时),压降大(达</FONT><FONT face=Arial size=3>2-3</FONT><FONT
face=宋体 size=3>伏)时,依然有一些实际问题要解决。</FONT></P><B>
<P align=justify><FONT face=宋体 size=4>一、</FONT><FONT face=Arial
size=4>LED</FONT><FONT face=宋体 size=4>的驱动形式</FONT></P></B>
<P align=justify><FONT face=宋体 size=3> 一般而言,当系统中</FONT><FONT
face=Arial size=3>LED</FONT><FONT face=宋体
size=3>数量较多时,采用动态扫描的方法较为经济,但当系统中</FONT><FONT face=Arial size=3>LED</FONT><FONT
face=宋体 size=3>的数量达到数百只,且每只</FONT><FONT face=Arial size=3>LED</FONT><FONT
face=宋体
size=3>的驱动电流达到数百毫安时,如仍采用动态扫描的方法,会使系统变得较为复杂,可靠性降低,且成本下降有限。为此选用静态法,为每一只</FONT><FONT
face=Arial size=3>LED</FONT><FONT face=宋体 size=3>配一只</FONT><FONT face=Arial
size=3>CD4094</FONT><FONT face=宋体 size=3>和</FONT><FONT face=Arial
size=3>MC1413</FONT><FONT face=宋体 size=3>七达林顿驱动器,见图</FONT><FONT face=Arial
size=3>1(A)</FONT><FONT face=宋体
size=3>。由于利率屏显示时小数点固定,所以可以不用驱动小数点,直接用一个限流电阻将需点亮的小数点接到地即可。</FONT></P><B>
<P align=justify><FONT face=宋体 size=4>二、单片机驱动</FONT><FONT face=Arial
size=4>CD4094</FONT><FONT face=宋体 size=4>的方式</FONT></P></B>
<P align=justify><FONT face=Arial
size=3> CD4094</FONT><FONT face=宋体
size=3>是串</FONT><FONT face=Arial size=3>/</FONT><FONT face=宋体
size=3>并转换器,显然单片机应用串行口驱动,但如果将系统中所有的</FONT><FONT face=Arial
size=3>CD4094</FONT><FONT face=宋体
size=3>全部串接,然后接到串行口上,不仅串行口难以驱动,就算扩展驱动能力后能够驱动,在编写程序时也会很麻烦。为此采用扩展并行口,然后将并行口模拟成串行口的方法来解决,电路参考图</FONT><FONT
face=Arial size=3>1(B)</FONT><FONT face=宋体 size=3>,假设将数据端接到</FONT><FONT
face=Arial size=3>P1.2</FONT><FONT face=宋体 size=3>,而脉冲输入端接到</FONT><FONT
face=Arial size=3>P3.3</FONT><FONT face=宋体 size=3>则输出一个数的完整程序如下</FONT><FONT
face=Arial size=3>:</FONT></P>
<P align=justify><FONT face=Arial
size=3> ORG
0000H<BR> LJMP
START<BR>START:<BR> SETB P3.3
;</FONT><FONT size=3>将</FONT><FONT face=Arial size=3>P3.3</FONT><FONT
size=3>置为高电平为后面作准备<FONT size=3><BR></FONT></FONT><FONT face=Arial
size=3> </FONT> <FONT face=Arial size=3>MOV 30H</FONT><FONT
size=3>,</FONT><FONT face=Arial size=3>#01H ; 30H</FONT><FONT size=3>为显示缓冲区<FONT
size=3><BR></FONT></FONT><FONT face=Arial size=3>S_1:
<BR> LCALL
DISP<BR> SJMP $<BR>;</FONT><FONT
size=3>以上主程序<FONT size=3><BR></FONT></FONT><FONT face=Arial
size=3>DISP:<BR> MOV A</FONT><FONT
size=3>,</FONT><FONT face=Arial
size=3>30H<BR> MOV DPTR</FONT><FONT
size=3>,</FONT><FONT face=Arial size=3>#ZX_TAB ;</FONT><FONT size=3>字形表首地址<FONT
size=3><BR></FONT></FONT><FONT face=Arial size=3> </FONT>
<FONT face=Arial size=3>MOVC A</FONT><FONT size=3>,</FONT><FONT face=Arial
size=3>@A+DPTR ;</FONT><FONT size=3><FONT size=3>查字形</FONT> <BR></FONT><FONT
face=Arial size=3> MOV R7</FONT><FONT
size=3>,</FONT><FONT face=Arial size=3>#2 ;R7</FONT><FONT size=3>用于控制循环次数<FONT
size=3><BR></FONT></FONT><FONT face=Arial
size=3>DISP_LOOP:<BR> RL
A<BR> DJNZ R7</FONT><FONT
size=3>,</FONT><FONT face=Arial size=3>DISP_LOOP <BR>;</FONT><FONT
size=3>由于用</FONT><FONT face=Arial size=3>P1.2</FONT><FONT
size=3>作为数据输出端,所以必须先把待送出的数左移二次将数据的第</FONT><FONT face=Arial size=3>0</FONT><FONT
size=3>位<FONT size=3><BR></FONT></FONT><FONT face=Arial size=3>;</FONT><FONT
size=3>移到第</FONT><FONT face=Arial size=3>2</FONT><FONT
size=3>位,例要送的数为</FONT><FONT face=Arial size=3>05H</FONT><FONT
size=3>即</FONT><FONT face=Arial size=3>00000101</FONT><FONT
size=3>,移位二次变成</FONT><FONT face=Arial
size=3>00010100<BR> MOV P1</FONT><FONT
size=3>,</FONT><FONT face=Arial size=3>A ;</FONT><FONT
size=3>将移位后的数据送到</FONT><FONT face=Arial size=3>P1</FONT><FONT size=3>口<FONT
size=3><BR></FONT></FONT><FONT face=Arial size=3> </FONT>
<FONT face=Arial size=3>CLR P3.3<BR>
SETB P3.3 ;</FONT><FONT size=3>形成一次脉冲的上升沿,将第一位数据<FONT
size=3><BR></FONT></FONT><FONT face=Arial size=3>;</FONT><FONT
size=3>送到</FONT><FONT face=Arial size=3>CD4094</FONT><FONT
size=3>去,以刚才例,即</FONT><FONT face=Arial size=3>P1.2</FONT><FONT
size=3>为</FONT><FONT face=Arial size=3>;</FONT><FONT size=3>高电被送到</FONT><FONT
face=Arial size=3>CD4094</FONT><FONT size=3>中<FONT
size=3><BR></FONT></FONT><FONT face=Arial size=3> </FONT>
<FONT face=Arial size=3>MOV R7</FONT><FONT size=3>,</FONT><FONT face=Arial
size=3>#7<BR>DISP_LOOP1:<BR> RR A
;</FONT><FONT size=3>数据右移<FONT size=3><BR></FONT></FONT><FONT face=Arial
size=3> </FONT> <FONT face=Arial size=3>MOV P1</FONT><FONT
size=3>,</FONT><FONT face=Arial size=3>A ;</FONT><FONT size=3>数据送</FONT><FONT
face=Arial size=3>P1</FONT><FONT size=3>口<FONT size=3><BR></FONT></FONT><FONT
face=Arial size=3> </FONT> <FONT face=Arial size=3>CLR
P3.3<BR> SETB P3.3 ;</FONT><FONT
size=3>形成一次脉冲上升沿,送入一位数据<FONT size=3><BR></FONT></FONT><FONT face=Arial
size=3> </FONT> <FONT face=Arial size=3>DJNZ R7</FONT><FONT
size=3>,</FONT><FONT face=Arial size=3>DISP_LOOP1 ;</FONT><FONT
size=3>循环</FONT><FONT face=Arial size=3>7</FONT><FONT size=3>次,送入</FONT><FONT
face=Arial size=3>7</FONT><FONT size=3>位数据<FONT size=3><BR></FONT></FONT><FONT
face=Arial size=3> </FONT> <FONT face=Arial
size=3>RET<BR>;</FONT><FONT size=3>以刚才的例子,移位</FONT><FONT face=Arial
size=3>7</FONT><FONT size=3>次分别是</FONT><FONT face=Arial
size=3>00001<I><B>0</B></I>10</FONT><FONT size=3>、</FONT><FONT face=Arial
size=3>00000<I><B>1</B></I>01</FONT><FONT size=3>、</FONT><FONT face=Arial
size=3>;10000<I><B>0</B></I>10</FONT><FONT size=3>、</FONT><FONT face=Arial
size=3>01000<I><B>0</B></I>01</FONT><FONT size=3>、</FONT><FONT face=Arial
size=3>10100<I><B>0</B></I>00</FONT><FONT size=3>、</FONT><FONT face=Arial
size=3>01010<I><B>0</B></I>00</FONT><FONT size=3>、</FONT><FONT face=Arial
size=3>00101<I><B>0</B></I>00</FONT><FONT size=3>请注意粗、斜体的数字,它位加上第一次送出<FONT
size=3><BR></FONT></FONT><FONT face=Arial size=3>;</FONT><FONT
size=3>的</FONT><I><B><FONT face=Arial size=3>1</FONT><FONT
size=3>,</FONT></B></I><FONT size=3>正好就是</FONT><FONT face=Arial
size=3>10100000</FONT><FONT size=3>,与串行口发送是相同<FONT
size=3><BR></FONT></FONT><FONT face=Arial
size=3>ZX_TAB:<BR> DB 3FH</FONT><FONT
size=3>,</FONT><FONT face=Arial size=3>06H</FONT><FONT size=3>,</FONT><FONT
face=Arial size=3>5BH</FONT><FONT size=3>,</FONT><FONT face=Arial
size=3>4FH</FONT><FONT size=3>,</FONT><FONT face=Arial size=3>66H</FONT><FONT
size=3>,</FONT><FONT face=Arial size=3>6DH</FONT><FONT size=3>,</FONT><FONT
face=Arial size=3>7DH</FONT><FONT size=3>,</FONT><FONT face=Arial
size=3>07H</FONT><FONT size=3>,</FONT><FONT face=Arial size=3>7FH</FONT><FONT
size=3>,</FONT><FONT face=Arial size=3>6FH
<BR> END</FONT></P>
<P align=justify><FONT face=宋体 size=3>
以上例子是发送一个数据,稍作修改,即可一次发送多个数据。如果用其它的并行口位作数据输出端或脉冲输出端,也只要对程序稍作改动即可。</FONT></P>
<TABLE border=1 width="100%">
<TBODY>
<TR>
<TD width="50%"><IMG alt="llp1.gif (4882 字节)" height=308
src="银行利率屏的设计.files/llp1.gif" width=591></TD>
<TD width="50%"><IMG alt="llp2.gif (5418 字节)" height=301
src="银行利率屏的设计.files/llp2.gif" width=604></TD></TR>
<TR>
<TD height=25 width="50%">
<P align=center>图1(A)</P></TD>
<TD height=25 width="50%">
<P align=center>图1(B)</P></TD></TR></TBODY></TABLE>
<P align=justify><FONT face=宋体 size=3> 采用这一方法后,我们将</FONT><FONT
face=Arial size=3>LED</FONT><FONT face=宋体 size=3>分组,一般利率屏中一行的</FONT><FONT
face=Arial size=3>LED</FONT><FONT face=宋体 size=3>数量为</FONT><FONT face=Arial
size=3>18</FONT><FONT face=宋体 size=3>到</FONT><FONT face=Arial
size=3>20</FONT><FONT face=宋体 size=3>多只不等,将两行或三行为一个单元为其配一个驱动单元</FONT><FONT
face=Arial size=3>(</FONT><FONT face=宋体 size=3>即并行口的两位</FONT><FONT face=Arial
size=3>)</FONT><FONT face=宋体 size=3>,这样一个由</FONT><FONT face=Arial
size=3>300</FONT><FONT face=宋体 size=3>到</FONT><FONT face=Arial
size=3>500</FONT><FONT face=宋体 size=3>个左右的</FONT><FONT face=Arial
size=3>LED</FONT><FONT face=宋体 size=3>构成的屏约需</FONT><FONT face=Arial
size=3>30</FONT><FONT face=宋体 size=3>个左右的并行口位,这只需要扩展一片</FONT><FONT face=Arial
size=3>8255</FONT><FONT face=宋体 size=3>加上</FONT><FONT face=Arial
size=3>P1</FONT><FONT face=宋体 size=3>口和</FONT><FONT face=Arial
size=3>P3</FONT><FONT face=宋体 size=3>口的一些位就够了。串行口可以留作键盘扩展或作远距遥控等用。</FONT></P><B>
<P align=justify><FONT face=宋体 size=4>三、电平转换及驱动能扩展</FONT></P></B>
<P align=justify><FONT face=宋体 size=3> 由于大尺寸</FONT><FONT
face=Arial size=3>LED</FONT><FONT face=宋体
size=3>的压降较高,因此需要较高的驱动电压,这样在</FONT><FONT face=Arial size=3>CD4094</FONT><FONT
face=宋体 size=3>和单片机电路中就要有一个电平转换,选用集电极开路同相器</FONT><FONT face=Arial
size=3>7406</FONT><FONT face=宋体 size=3>就可以完成这一工作</FONT><FONT face=Arial
size=3>(</FONT><FONT face=宋体 size=3>见图</FONT><FONT face=Arial
size=3>3)</FONT><FONT face=宋体 size=3>,同时它还兼有扩展驱动能力的作用,实践证明,当</FONT><FONT
face=Arial size=3>7406</FONT><FONT face=宋体 size=3>的上拉电阻取</FONT><FONT face=Arial
size=3>2.2K</FONT><FONT face=宋体 size=3>,</FONT><FONT face=Arial
size=3>8031</FONT><FONT face=宋体 size=3>的晶振为</FONT><FONT face=Arial
size=3>6MHZ</FONT><FONT face=宋体 size=3>时,即便给电路加上</FONT><FONT face=Arial
size=3>0.047UF</FONT><FONT face=宋体 size=3>的电容负载,电路仍能正常工作,可靠性很高。</FONT> </P>
<P align=justify><IMG alt="llp3.gif (1987 字节)" height=121
src="银行利率屏的设计.files/llp3.gif" width=296></P>
<P align=justify>图2</P>
<P align=center><A href="http://go.163.com/~czlyzhj/other.htm"><IMG alt=返回上一页
border=0 height=55 src="银行利率屏的设计.files/back1.gif" width=43></A>
</P></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -