您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > 简易led电子广告牌设计
电子与信息学院《微机原理及其应用》课程设计报告广告牌设计专业信息工程班级1学生姓名陈宗成实验台号6指导教师宁更新提交日期2009年2月27日报告评分批改老师设计内容:实验箱上设有一个共阳极8×8点阵的红黄两色LED显示器。编程使LED显示器循环显示一条广告语,例如:北京你好。要求:广告语可以自己任意选择,但字数不少于3个;广告语的颜色红黄交替显示,例如:先显示红色广告语,再显示黄色广告语,如此交替循环;广告语中每个字符显示的时间由8253定时器控制,定时时间到显示下一个字符,设置每个字符显示的时间为数秒不等,可以自行设置;若键盘输入“R”则返回DOS,结束程序。硬件电路连接:重要芯片功能说明:8*8LED显示器:三个片选端,分别为行片选,红色列片选,黄色列片选。8253可编程定时/计数器:本实验中只使用计数器0,并将其设置为工作方式0,16为计数。8255可编程并行接口:8255有3种工作方式,在8255中有一个控制字用来选择工作方式和A、B、C三个端口。D6D5工作方式00方式001方式110方式211方式2本实验中使A口作为简单的输入口。做查询方式的输入信号使用。程序流程图:clk0out0gate0CS8253PA0CSCS0CS1CS2LED82551MHZ+5V红列片选有效开始主程序流程图CX10HPUSHCXCX8HCX=0?取行代码,显示一行CX=0?黄片选有效有建按下?调用退出程序YYYNNN开始BX指向“可”字?BX指向“口”字?BX指向“可”字?将BX指向“口”字?将BX指向“可”字?将BX指向“乐”字?YYNN程序跳转子程序源程序及注释:ioportequ0c400h-0280hprothequioport+280hprotlrequioport+288hprotlyequioport+290hBX指向“乐”字?将BX指向“可”字?返回主程序YYN开始设PA口为输入设计数器0为方式0写计数初值开始计数计数到0返回Y从PA口读输入值N延时子程序DATASEGMENTMESSDB'StrikeRreturntodos!',0AH,0DH,'$'min1DB00h,01h,02h,03h,04h,05h,06h,07hcountdb0KEDB80H,0FFH,82H,0B8H,0A8H,0B8H,80H,80HKOUDB00H,7EH,42H,42H,42H,42H,7EH,00HLEEDB02H,14H,90H,0FFH,92H,0F4H,02H,00HDATAENDS;-----------------------------------------------------------CODESEGMENTASSUMECS:CODE,DS:DATA;------------------------------------------------------------START:MOVAX,DATAMOVDS,AXMOVDX,OFFSETMESSMOVAH,09INT21H;显示提示信息;------------------------------------------------------------agn_ke:movcx,0600hd2_ke:movah,01hpushcxmovcx,0008hmovsi,offsetmin1next_ke:moval,[si]movbx,offsetkexlat;得到第一行码movdx,prothoutdx,almoval,ahmovdx,protlroutdx,al;显示第一行红shlah,01incsipushcxmovcx,0ffffhdelay2_ke:loopdelay2_ke;延时popcxloopnext_kepopcxcalldelayloopd2_kemoval,00movdx,protlroutdx,almovah,01;有无键按下int16hjzagn_koumovah,0int16hcmpal,52hjet1;检测8253,到时间就到JINGagn_kou:movcx,0600hd2_kou:movah,01hpushcxmovcx,0008hmovsi,offsetmin1next_kou:moval,[si]movbx,offsetkouxlat;得到第一行码movdx,prothoutdx,almoval,ahmovdx,protlroutdx,al;显示第一行红shlah,01incsipushcxmovcx,0ffffhdelay2_kou:loopdelay2_kou;延时popcxloopnext_koupopcxcalldelayloopd2_koumoval,00movdx,protlroutdx,almovah,01;有无键按下int16hjzagn_ke1movah,0int16hcmpal,52ht1:jet2;检测8253,到时间就到niagn_ke1:movcx,0600hd2_ke1:movah,01hpushcxmovcx,0008hmovsi,offsetmin1next_ke1:moval,[si]movbx,offsetkexlat;得到第一行码movdx,prothoutdx,almoval,ahmovdx,protlroutdx,al;显示第一行红shlah,01incsipushcxmovcx,0ffffhdelay2_ke1:loopdelay2_ke1;延时popcxloopnext_ke1popcxcalldelayloopd2_ke1moval,00movdx,protlroutdx,almovah,01;有无键按下int16hjzagn_leemovah,0int16hcmpal,52ht2:jetiao;检测8253,到时间就到haoagn_lee:movcx,0600hd2_lee:movah,01hpushcxmovcx,0008hmovsi,offsetmin1next_lee:moval,[si]movbx,offsetleexlat;得到第一行码movdx,prothoutdx,almoval,ahmovdx,protlroutdx,al;显示第一行红shlah,01incsipushcxmovcx,0ffffhdelay2_lee:loopdelay2_lee;延时popcxloopnext_leepopcxcalldelayloopd2_leemoval,00movdx,protlroutdx,almovah,01;有无键按下int16hjzagn1_kemovah,0int16hcmpal,52hjetiaojmpagn1_ke;==============================================================tiao:jmpexit;================================================================agn1_ke:movcx,0600h;agn1为显示黄色d1_ke:movsi,offsetmin1movah,01pushcxmovcx,0008hnext1_ke:moval,[si]movbx,offsetkexlatmovdx,prothoutdx,almoval,ahmovdx,protlyoutdx,alshlah,01incsipushcxmovcx,0ffffhdelay1_ke:loopdelay1_kepopcxloopnext1_kepopcxcalldelayloopd1_kemoval,00movdx,protlyoutdx,almovah,01int16hjzagn1_koumovah,0int16hcmpal,52hjet11agn1_kou:movcx,0600h;agn1为显示黄色d1_kou:movsi,offsetmin1movah,01pushcxmovcx,0008hnext1_kou:moval,[si]movbx,offsetkouxlatmovdx,prothoutdx,almoval,ahmovdx,protlyoutdx,alshlah,01incsipushcxmovcx,0ffffhdelay1_kou:loopdelay1_koupopcxloopnext1_koupopcxcalldelayloopd1_koumoval,00movdx,protlyoutdx,almovah,01int16hjzagn1_ke1movah,0int16hcmpal,52ht11:jet22;8253,daojiushunxuzhixing,fouzejiudaojingagn1_ke1:movcx,0600h;agn1为显示黄色d1_ke1:movsi,offsetmin1movah,01pushcxmovcx,0008hnext1_ke1:moval,[si]movbx,offsetkexlatmovdx,prothoutdx,almoval,ahmovdx,protlyoutdx,alshlah,01incsipushcxmovcx,0ffffhdelay1_ke1:loopdelay1_ke1popcxloopnext1_ke1popcxcalldelayloopd1_ke1moval,00movdx,protlyoutdx,almovah,01int16hjzagn1_leemovah,0int16hcmpal,52ht22:jet33;8253,daojiushunxuzhixing,fouzejiudaoniagn1_lee:movcx,0600h;agn1为显示黄色d1_lee:movsi,offsetmin1movah,01pushcxmovcx,0008hnext1_lee:moval,[si]movbx,offsetleexlatmovdx,prothoutdx,almoval,ahmovdx,protlyoutdx,alshlah,01incsipushcxmovcx,0ffffhdelay1_lee:loopdelay1_leepopcxloopnext1_leepopcxcalldelayloopd1_leemoval,00movdx,protlyoutdx,almovah,01int16hjzbackmovah,0int16hcmpal,52ht33:jeexitjmpback;8253,daojiushunxuzhixing,fouzejiudaohao;=============================================================================back:jmpagn_ke;黄色红色交替显示;----------------------------------------------------------------DELAYPROCNEAR;延迟子程序pushcxmovcx,0ffffhccc:loopcccpopcxretDELAYENDPexit:movah,4chint21hCODEENDSENDSTART;----------------------------------------------------------
本文标题:简易led电子广告牌设计
链接地址:https://www.777doc.com/doc-78661 .html