8X8_LED点阵显示的设计

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

专业综合课程设计报告第1章系统概述LED点阵显示系统中各模块的显示方式有静态和动态显示两种。静态显示原理简单、控制方便,但硬件接线复杂,在实际应用中一般采用动态显示方式,动态显示采用扫描的方式工作,由峰值较大的窄脉冲驱动,从上到下逐次不断地对显示屏的各行进行选通,同时又向各列送出表示图形或文字信息的脉冲信号,反复循环以上操作,就可显示各种图形或文字信息。本文将介绍一种采用单片机AT89S51进行控制的8*8LED点阵。该点阵可实现动态显示数字0~9及字符A~Z的功能。1.1设计任务及目的利用8*8LED点阵显示数字0~9和26个英文字符的字样。采用AT89S51单片机作为整个控制搭电路的核心,并编制软件程序,实现动态轮流显示。通过此设计来巩固单片机硬件系统的设计及软件系统的编程,通过设计将平时所学知识付诸实践,提高动手能力。第2章系统硬件设计与分析本系统从经济性,电路结构,系统性能等多方面考虑,选用如下主要元器件:1单片机AT89S51、电阻10K和100欧、三极管8550、按钮开关、共阳8*8LED点阵显示块、稳压块7805。2.1电源电路本设计实验所需电源为直流五伏电压源,采用的是固定式三端稳压器7805还实现。其线路接线图如图1所示:图1电源电路2.2复位电路单片机在启动运行时需要复位,使CPU以及其他功能部件处于一个确定的初始状态,并从这个状态开始工作,另外,在单片机工作过程中,如果出现死机时,也必须对单片机进行复位,使其重新开始工作。本设计中采用按键复位电路,复位电路如图2所示:2图2复位电路2.3主体电路通过单片机AT89S51的P0口和P1口去驱动点阵LED芯片块。电路如图3所示:图3主体电路32.4硬件电路连线1.把“单片机系统”区域中的P0.0~P0.7端口分别通过八个100欧电阻连接到“点阵模块”区域中的“L1-L8”端口上;2.把“单片机系统”区域中的P1.0~P1.7端口通过三极管8550和10K电阻连接到“点阵模块”区域中的“S1-S8”端口上。2.5显示部分1.8X8点阵LED工作原理说明图4为8×8点阵LED外观及引脚图,其等效电路如图(2)所示,只要其对应的X、Y轴顺向偏压,即可使LED发亮。例如如果想使左上角LED点亮,则Y0=1,X0=0即可。应用时限流电阻可以放在X轴或Y轴。图48×8点阵LED外观及引脚图其等效电路图如下:4图58×8点阵LED等效电路2.点阵LED扫描法介绍点阵LED一般采用扫描式显示,实际运用分为三种方式:(1)点扫描;(2)行扫描;(3)列扫描。若使用第一种方式,其扫描频率必须大于16×64=1024Hz,周期小于1ms即可。若使用第二和第三种方式,则频率必须大于16×8=128Hz,周期小于7.8ms即可符合视觉暂留要求。此外一次驱动一列或一行(8颗LED)时需外加驱动电路提高电流,否则LED亮度会不足。4.1数字的编码各个数字对应的编码如下:{0x0C,0x12,0x12,0x12,0x12,0x12,0x0C,0x00},/*0,0*///显示数字`0`/{0x04,0x06,0x04,0x04,0x04,0x04,0x0E,0x00},/*1,1*///显示数字`1`/{0x0C,0x12,0x10,0x08,0x04,0x02,0x1E,0x00},/*2,2*///显示数字`2`/{0x0C,0x12,0x10,0x0C,0x10,0x12,0x0C,0x00},/*3,3*///显示数字`3`/{0x08,0x0C,0x0C,0x0A,0x0A,0x1E,0x08,0x00},/*4,4*///显示数字`4`/5{0x1E,0x02,0x02,0x0E,0x10,0x10,0x0E,0x00},/*5,5*///显示数字`5`/{0x0C,0x12,0x02,0x0E,0x12,0x12,0x0C,0x00},/*6,6*///显示数字`6`/{0x1E,0x12,0x10,0x08,0x04,0x04,0x04,0x00},/*7,7*///显示数字`7`/{0x0C,0x12,0x12,0x0C,0x12,0x12,0x0C,0x00},/*8,8*///显示数字`8`/{0x0C,0x12,0x12,0x1C,0x10,0x12,0x0C,0x00},/*9,9*///显示数字`9`/4.2字母的编码各个字母所对应的编码如下:{0x0C,0x12,0x12,0x12,0x1E,0x12,0x12,0x00},/*A,0*///显示字母`A`/{0x0E,0x12,0x12,0x0E,0x12,0x12,0x0E,0x00},/*B,1*///显示数字`B`/{0x0C,0x12,0x02,0x02,0x02,0x12,0x0C,0x00},/*C,2*///显示数字`C`/{0x0E,0x12,0x12,0x12,0x12,0x12,0x0E,0x00},/*D,3*///显示数字`D`/{0x1E,0x02,0x02,0x0E,0x02,0x02,0x1E,0x00},/*E,4*///显示数字`E`/{0x1E,0x02,0x02,0x0E,0x02,0x02,0x02,0x00},/*F,5*///显示数字`F`/{0x0C,0x12,0x02,0x1A,0x12,0x12,0x0C,0x00},/*G,6*///显示数字`G`/{0x12,0x12,0x12,0x1E,0x12,0x12,0x12,0x00},/*H,7*///显示数字`H`/{0x0E,0x04,0x04,0x04,0x04,0x04,0x0E,0x00},/*I,8*///显示数字`I`/{0x10,0x10,0x10,0x10,0x12,0x12,0x0C,0x00},/*J,9*///显示数字`J`/{0x12,0x12,0x0A,0x06,0x0A,0x12,0x12,0x00},/*K,10*///显示数字`K`/{0x02,0x02,0x02,0x02,0x02,0x02,0x1E,0x00},/*L,11*///显示数字`L`/{0x12,0x1E,0x1E,0x12,0x12,0x12,0x12,0x00},/*M,12*///显示数字`M`/{0x12,0x16,0x16,0x1A,0x1A,0x12,0x12,0x00},/*N,13*///显示数字`N`/{0x1E,0x12,0x12,0x12,0x12,0x12,0x1E,0x00},/*O,14*///显示数字`O`/{0x0E,0x12,0x12,0x0E,0x02,0x02,0x02,0x00},/*P,15*///显示数字`P`/{0x0C,0x12,0x12,0x12,0x16,0x1A,0x1C,0x00},/*Q,16*///显示数字`Q`/6{0x0E,0x12,0x12,0x0E,0x06,0x0A,0x12,0x00},/*R,17*///显示数字`R`/{0x0C,0x12,0x02,0x0C,0x10,0x12,0x0C,0x00},/*S,18*///显示数字`S`/{0x1E,0x04,0x04,0x04,0x04,0x04,0x04,0x00},/*T,19*///显示数字`T`/{0x12,0x12,0x12,0x12,0x12,0x12,0x0C,0x00},/*U,20*///显示数字`U`/{0x12,0x12,0x12,0x12,0x0C,0x0C,0x0C,0x00},/*V,21*///显示数字`V`/{0x12,0x12,0x12,0x12,0x1E,0x1E,0x12,0x00},/*W,22*///显示数字`W`/{0x12,0x12,0x0C,0x0C,0x0C,0x12,0x12,0x00},/*X,23*///显示数字`X`/{0x11,0x11,0x0A,0x04,0x04,0x04,0x04,0x00},/*Y,24*///显示数字`Y`/{0x1E,0x10,0x08,0x0C,0x04,0x02,0x1E,0x00},/*Z,25*///显示数字`Z`/{0x08,0x3E,0x7F,0x24,0x1A,0x49,0x78,0x00},/*老,0*/{0x72,0x24,0xFE,0xAE,0xEE,0x24,0x22,0x21},/*师,0*/{0x0A,0xEA,0x9F,0xFA,0x4A,0x44,0x6A,0x51},/*好,0*/4.3程序流程图开始THO,TLO装入初值开始74.4完整程序TF0=1吗?有复位键按下?TF0=0NYYTMOD初始化TR0置1启动T0调用数组赋给P0Cnta++Cntb++Cntb=57?Cnta=8?YNYN8#includereg52.h#defineucharunsignedchar#defineuintunsignedint#includeintrins.hunsignedcharcodetab1[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};unsignedcharcodetab2[]={0x10,0xFE,0x92,0x92,0xFE,0x92,0x10,0x10};voiddelayms(uinta){uchari;while(a--)for(i=0;i10;i++);}voidmain(){uchari;P0=0xfe;P3=0x10;while(1){for(i=0;i8;i++){P0=~tab1[i];P3=~tab2[i];delayms(10);}}}此字为:中附录C元件清单元件名称规格数量备注AT89C51单片机一块附底座晶振12MHZ一块NPN三极管9012八支8×8点阵共阳LED显示器共阳一块按钮开关一个四脚或两脚9极性电容10uf、0.01uf一个、一个瓷片电容30pf两个电阻1kΩ、470Ω八个、八个电源插座一个

1 / 10
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功