《电路设计仿真实践报告.doc》由会员分享,可在线阅读,更多相关《电路设计仿真实践报告.doc(8页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、_ 成绩: 电路与系统仿真实践报告实践课题:基于单片机的2424点阵LED汉字显示屏 专业: 电子信息工程 学号: 241099429 姓名: 陈远辉 指导老师: 廖一鹏 福州大学阳光学院电子信息工程系一 设计目的与意义LED汉字显示屏应用极为广泛,有单色大屏幕、单色条幅屏、双基色大屏幕、双基色条幅屏、彩色大屏幕、彩色条幅屏等。有与上位计算机连机显示的,也有可脱离上位计算机而由单片机控制显示的,类型多种多样,款式形形色色。本设计主要讲述2424点阵单色条幅显示屏的设计和实时仿真,只要掌握这基本知识,其他显示问题都能迎刃而解。二 功能与操作说明1.功能(1)可显示汉字、英文和符号。(2)分幅静止
2、显示功能。(3)移动循环显示功能,上移依次显示字符为“托普信息职业技术学院”2.操作上电运行即可三 硬件设计原理图如图1所示图1 原理图电路设计:单片机控制电路行控制显示屏列控制图2统框图点阵LED显示屏硬件电路控制系统框图如图1示,控制电路分为单片机控制电路,行控制和列控制,显示电路三个部分,本系统由AT89C51作为控制单元,列控制选用3线-8线译码器74HC138行数据传输选用8位串行输入并行输出寄存器74HC595。显示屏用9块8*8点阵显示模块组合成24*24点阵显示屏。图3控制电路和含数据传输电路列控制电路采用3片74HC138级联组成,如图(a)示。每个输出端接470的电阻器限流
3、作用,然后P1口相连接,E1 E2 E3为片使能端,当E1和E3为低电平是第一片译码器使能控制列。行数据传输电路采用3片74HC595串联,如图(b)数据在SH-CP的上升沿输入,在ST-CP的上升沿进入到存储寄存器中去。移位寄存器有一个串行移位输入和一个串行输出,和一个异步的低电平复位,74HC595的8位数据储存寄存器,具备三态的总线输出当使能OE时,储存寄存器的数据输出到总线,在移位过程中储存寄存器输出端数据可以保留不变,数码管没有闪烁感,595还有输出端使能、禁止控制端,可使输出为高阻态。图4显示屏电路由于PROTUSE 中没有24*24点阵显示屏,所以采用9块8*8点阵屏组合成24*
4、24点阵,此点阵按共阴式组合,控制列选端低电平有效,r 0r23为行数据端,a2h为列控制端,如图3所示。四 软件设计程序如下:8_ORG 0H LJMP START ORG 0BH LJMP INTT0START:MOV 20H,#00H MOV A,#0FFH MOV R7,#0 MOV P1,A MOV P2,A MOV P3,A MOV P0,A CLR P1.6 MOV TMOD,#01H MOV TH0,#0FEH MOV TL0,#18H MOV SCON,#0 MOV IE,#82H MOV SP,#70H MOV R0,#0MAIN:LCALL DIS1 MOV DPTR,#
5、TAB LCALL MOVDISP LJMP MAINMOVDISP:MOV B,#00HDISLOOP:MOV R3,#07HDISMOV:JNB 02H,AAA DEC DPH CLR 02AAA: MOV R2,#0 MOV R1,B SETB TR0WAITMOV:JBC 01H,DISMOV1 AJMP WAITMOVDISMOV1:DJNZ R3,DISMOV JNB 02H,BBB DEC DPH CLR 02BBB: INC B MOV A,B CJNE A,#0,CC0 INC DPH INC R7CC0: INC B MOV A,B CJNE A,#0,CC1 INC DP
6、H INC R7CC1: INC B MOV A,B CJNE A,#0,CCC INC DPH INC R7CCC: MOV A,R1MOVOUT:CJNE R7,#3,DISLOOP MOV A,B CJNE A,#24,DISLOOP MOV R7,#0 RETDIS1: MOV R3,#0AH CLR P1.3 CLR P1.4 CLR P1.5DIS11: MOV R2,#0 MOV DPTR,#TAB MOV R1,#0H SETB TR0WAIT11: JBC 01H,DIS111 AJMP WAIT11DIS111:DJNZ R3,DIS11 RETINTT0: INC R0
7、PUSH ACC MOV TH0,#0FEH MOV TL0,#18H JBC 00H,GOEND MOV A,R1 MOVC A,A+DPTR MOV SBUF,AWAIT: JBC TI,GO AJMP WAITGO: INC R1 CJNE R1,#0,AA INC DPH SETB 02HAA: MOV A,R1 MOVC A,A+DPTR MOV SBUF,AWAIT1: JBC TI,GO1 AJMP WAIT1GO1: INC R1 CJNE R1,#0,BB INC DPH SETB 02HBB: MOV A,R1 MOVC A,A+DPTR MOV SBUF,AWAIT2:
8、JBC TI,GO2 AJMP WAIT2GO2: CLR P1.3 CLR P1.4 CLR P1.5 NOP SETB P1.6 NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP CLR P1.6 MOV A,R2 ANL A,#7H ANL P1,#0F8H ORL P1,AP122: INC R2 CJNE R2,#8,PAN1 LJMP PAN1APAN1: JC PAN1A CJNE R2,#10H,PAN2 LJMP PAN1BPAN2: JC PAN1B CJNE R2,#018H,PAN3 LJMP PAN1CPAN3: JC PAN1C
9、 AJMP PANTPAN1A: SETB P1.3 AJMP PANTPAN1B: SETB P1.4 AJMP PANTPAN1C: SETB P1.5PANT: INC R1 CJNE R1,#0,CC INC DPH SETB 02HCC: MOV A,R2GO3: CJNE R2,#24,GO4 SETB 00HGO4: POP ACC RETIGOEND: CLR TR0 SETB 01H POP ACC RETIORG 0A00HTAB:DB 00H,00H,00H,00H,010H,00H,00H,010H,00H,00H,038H,00H DB 00H,038H,00H,00
10、H,038H,00H,00H,07CH,00H,00H,07CH,00HDB 00H,07CH,00H,0FFH,0FFH,0FEH,07FH,0FFH,0FCH,01FH,0FFH,0F0HDB 0FH,0FFH,0E0H,03H,0FFH,080H,01H,0FFH,00H,03H,0FFH,080HDB 03H,0FFH,080H,03H,0FFH,080H,07H,0EFH,0C0H,07H,083H,0C0HDB 07H,01H,0C0H,0CH,00H,060H,08H,00H,020H,00H,00H,00HDB 06H,00H,00H,07,00H,00H,03H,00H,00
11、H,03H,01H,0C0H DB 03H,01H,0E0H,03H,03H,0C0H,03H,07H,00H,03H,09EH,00HDB 07H,0F6H,00H,03FH,06H,00H,013H,06H,0F0H,03H,087H,0E0HDB 03H,01EH,00H,07H,076H,00H,0FH,06H,02H,03BH,06H,02HDB 0F3H,06H,03H,0E3H,06H,07H,043H,07H,0FH,0FH,03H,0FEHDB 07H,00H,0FCH,06H,00H,00H,00H,00H,00H,00H,00H,00HDB 00H,01H,080H,01
12、H,0C3H,080H,00H,0C6H,00H,00H,049H,0C0H DB 00H,03FH,0E0H,03H,0FEH,00H,00H,066H,040H,00H,066H,0E0HDB 06H,067H,080H,03H,067H,00H,03H,066H,07CH,00H,0FFH,0FEHDB 0FFH,0E0H,00H,078H,00H,00H,00H,01FH,00H,03H,0F3H,080HDB 03H,03H,080H,01H,0BBH,080H,01H,0F3H,00H,01H,083H,00HDB 01H,083H,00H,01H,0FBH,00H,01H,0C7
13、H,00H,01H,083H,00HDB 00H,00H,00H,03H,07H,080H,03H,083H,080H,03H,081H,080H DB 03H,00H,08H,07H,01H,0FEH,06H,0FFH,0FEH,0CH,060H,00HDB 0EH,00H,0C0H,01EH,0FH,0E0H,036H,00H,00H,066H,00H,00HDB 046H,07H,0C0H,086H,0EH,00H,06H,00H,00H,06H,01H,0F0HDB 06H,03FH,0F8H,06H,018H,070H,06H,018H,060H,06H,018H,0E0HDB 06
14、H,0FH,0E0H,06H,08H,00H,00H,00H,00H,00H,00H,00HDB 00H,030H,00H,00H,038H,00H,00H,030H,00H,00h,060H,00H DB 00H,05FH,080H,03H,0FBH,0C0H,03H,081H,0C0H,01H,09DH,080HDB 01H,0F9H,080H,01H,081H,080H,01H,09FH,080H,01H,0FBH,00HDB 01H,083H,00H,01H,08FH,00H,01H,0FFH,00H,00H,083H,070HDB 08H,018H,03CH,0AH,01CH,01E
15、H,01BH,0CH,04H,039H,080H,040HDB 030H,0E0H,060H,010H,078H,030H,00H,03FH,0F8H,00H,0FH,0E0HDB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,0F0H,00H DB 01FH,0F0H,070H,07EH,0CFH,0FCH,0CH,0E6H,038H,0CH,0C6H,030HDB 0FH,0C6H,030H,0EH,0C6H,060H,0CH,0C3H,0F0H,0DH,0C3H,080HDB 0FH,0C0H,00H,0CH,0C2H,060H,0CH,0F3H,030
16、H,0FH,0C6H,018HDB 01FH,0C6H,01CH,07CH,0CCH,0EH,020H,0D8H,06H,00H,0F0H,06HDB 00H,0C0H,00H,00H,0C0H,00H,00H,040H,00H,00H,00H,00HDB 00H,00H,00H,00H,0EH,00H,00H,07H,00H,01H,0C6H,00H DB 00H,0E6H,00H,00H,0E6H,00H,00H,066H,00H,00H,066H,030HDB 00H,066H,070H,08H,066H,070H,0CH,066H,0E0H,06H,066H,0C0HDB 07H,06
17、7H,080H,03H,066H,00H,00H,066H,00H,00H,066H,00HDB 00H,066H,00H,00H,067H,0FCH,03H,0FFH,0FEH,03FH,080H,00HDB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00HDB 06H,06H,00H,07H,07H,00H,03H,083H,080H,03H,083H,00H DB 03H,03H,00H,03H,03H,070H,03H,07H,0E0H,07H,0DFH,00HDB 07FH,03H,00H,033H,03H,00H,03H,03H,060
18、H,03H,087H,0F0HDB 03H,03CH,060H,0FH,010H,0C0H,03BH,0DH,080H,0F3H,07H,080HDB 063H,03H,00H,03H,07H,080H,03H,0DH,0E0H,03H,038H,0F8HDB 0FH,0E0H,07FH,07H,00H,01CH,02H,00H,00H,00H,00H,00HDB 00H,060H,00H,00H,070H,00H,00H,039H,0C0H,00H,030H,0E0H DB 00H,030H,060H,00H,030H,00H,00H,030H,00H,00H,03FH,0C0HDB 03H
19、,0FFH,080H,0FH,0F0H,00H,00H,078H,00H,00H,0FCH,00HDB 01H,0F6H,00H,01H,0B3H,00H,03H,031H,080H,06H,031H,0E0HDB 0CH,030H,0F8H,018H,030H,07FH,030H,030H,038H,040H,030H,00HDB 00H,030H,00H,00H,030H,00H,00H,030H,00H,00H,00H,00HDB 00H,01H,080H,00H,031H,0C0H,03H,039H,080H,03H,099H,080H DB 01H,09BH,00H,00H,083H
20、,00H,00H,0FH,0F8H,09H,0FCH,01CHDB 01FH,00H,03CH,018H,06H,030H,038H,07FH,00H,031H,0E6H,00HDB 010H,0CH,00H,00H,018H,00H,00H,0DH,0F0H,00H,0FFH,0F8HDB 01FH,0CCH,00H,0CH,0CH,00H,00H,0CH,00H,00H,0CH,00HDB 00H,0CH,00H,00H,07CH,00H,00H,03CH,00H,00H,018H,00H DB 00H,00H,00H,00H,0CH,00H,03H,0EH,00H,07H,087H,00
21、H DB 07FH,00H,0F0H,033H,02FH,0F8H,036H,070H,078H,034H,060H,040HDB 036H,043H,00H,033H,05FH,00H,03FH,00H,00H,037H,01H,0E0HDB 032H,03FH,0C0H,030H,07BH,00H,030H,01BH,00H,030H,01BH,04HDB 030H,033H,04H,030H,033H,06H,030H,063H,0EH,030H,0C3H,0FEHDB 033H,01H,0FCH,00H,00H,00H,00H,00H,00H,00H,00H,00HDB 00H,00H
22、,00H,00H,010H,00H,00H,010H,00H,00H,038H,00H DB 00H,038H,00H,00H,038H,00H,00H,07CH,00H,00H,07CH,00HDB 00H,07CH,00H,0FFH,0FFH,0FEH,07FH,0FFH,0FCH,01FH,0FFH,0F0HDB 0FH,0FFH,0E0H,03H,0FFH,080H,01H,0FFH,00H,03H,0FFH,080HDB 03H,0FFH,080H,03H,0FFH,080H,07H,0EFH,0C0H,07H,083H,0C0HDB 07H,01H,0C0H,0CH,00H,060
23、H,08H,00H,020H,00H,00H,00HEND程序框图如图5五 仿真结果仿真结果图如图6图6 仿真结果图运行实验仿真,LED灯显示“托普信息职业技术学院“。六 心得体会通过本次仿真设计中,我体会到在设计一个电路之前都要用仿真软件进行仿真,一方面可以检验设计的准确性,另一方面,又可以进节省时间,减少器件的浪费。在仿真过程中,遇到的困难是,会不明白点阵的逻辑引脚,导致连好的电路不能正确的显示,经过仔细的分析和检查,我明白了每个点阵的引脚都要有引脚定义,经过修改后,点阵能够正常的显示。同时经过查资料,设计电路,编写程序,撰写设计报告,使我们得到一次全面的工程实践训练。理论联系实际,提高和培养创新能力,为后续的学习打下基础。同时,进行仿真设计,可以体现现代化的设计方法和理念,使我能力方面有较大的提高。