基于AT89C51单片机键盘控制动态显示器的设计
基于AT89C51单片机的LED点阵显示系统设计
基于AT89C51单片机的LED点阵显示系统设计一、选取硬件平台本设计选取了AT89C51单片机作为主控芯片,其具有易于编程和接口丰富的特点,适合用于控制LED点阵显示系统。
通过单片机的IO口与LED点阵进行连接,并通过相应的驱动电路控制LED的亮灭,实现点阵显示功能。
二、软件设计在单片机上,我们需要编写相应的程序来控制LED点阵的显示。
以下是基本的软件设计功能:1. 点阵数据存储:在单片机的内部RAM中,设计一块存储区域,用来存放LED点阵的数据。
每个存储单元代表一个LED的亮灭状态,通过将相应的数据写入或读取出来,来实现相应的显示效果。
2. 数据刷新和循环:通过定时器中断,定时触发点阵数据的刷新。
在每次刷新时,通过逐行扫描点阵的方式,将相应的数据输出到点阵对应的LED上。
为了实现流畅的显示效果,需要进行快速的循环刷新,并及时更新点阵数据。
3. 外部控制:为了方便控制点阵的亮灭,可以设计外部按键或开关来实现一些功能,如调整亮度、改变显示内容等。
通过单片机的IO口读取外部的输入信号,进一步控制点阵显示的效果。
三、硬件设计除了单片机之外,还需要设计相应的硬件电路来实现LED点阵的驱动和控制。
1. 驱动电路:通过行选和列选的方式,来控制点阵中的每个LED的亮灭状态。
在每个行选时,通过给相应的引脚输出高电平,从而使得该行上的LED亮起;在每个列选时,通过给相应的引脚输出低电平,从而使得该列上的LED亮起。
2. 电流限制:为了保证LED在正常工作范围内,需要在驱动电路中加入适当的电流限制元件,如电流限制电阻或恒流源。
通过限制电流,在避免烧坏LED的同时,也可进一步控制LED的亮度。
3. 外部控制接口:为了实现外部控制功能,可以设计相应的按钮或开关与单片机的IO口相连接,通过读取按钮或开关的状态,来实现相应的操作。
同时,也需要设计合适的电平转换电路,以兼容单片机和外部控制信号之间的电平差异。
四、实验结果和分析经过硬件和软件的设计与调试,我们成功地实现了基于AT89C51单片机的LED点阵显示系统。
电子信息工程专业毕业设计--基于51单片机的12864液晶显示器的设计和研究
目录设计总说明 (I)INTRODUCTION (II)1 绪论 (1)1.1课题背景及研究意义 (1)1.2课题研究的主要内容 (1)1.3国内外发展状况与存在问题 (1)2 总体方案设计与论述 (2)2.1 系统需求分析 (2)2.2 系统总体方案设计 (2)2.2.1 设计方案论证 (2)2.2.2总体结构框图 (3)3系统单元模块设计 (3)3.1系统硬件示意图 (3)3.2主控芯片(STC89C52模块)[5] (4)3.3 时钟控制模块[13] (6)3.3.1 DS1302简介 (6)3.3.2引脚及功能表 (7)3.3.3工作原理 (7)3.3.4 DS1302电路设计图[9] (8)3.4 温度控制模块 (8)3.5 12864接口电路模块 (9)3.6 按键电路模块 (9)3.7 电源电路模块 (10)3.8 印制电路板[9] (10)4系统整体调试与结果分析 (11)4.1 系统总体程序流程介绍 (11)4.2 按键程序设计 (13)4.3 12864驱动程序设计[15] (14)4.3.1 ST7920芯片介绍[14] (14)4.3.2 ST7920驱动程序设计 (17)4.4 12864应用程序设计 (20)4.4.1 文字显示程序设计 (20)4.4.2 点、线显示程序设计 (22)4.4.3 图形、图片显示程序设计 (23)4.5 菜单程序设计 (26)5设计调试及进一步研究 (28)5.1 系统测试 (28)5.1.1 软件调试 (28)5.1.2 硬件调试 (29)5.2 进一步研究的工作 (30)6总结 (30)鸣谢................................................................................................................................ 错误!未定义书签。
06 12864LCD显示计算器键盘按键实验
目录1 课程设计概述和要求 (1)1.1 课程设计要求与任务 (2)1.2 课程设计思路 (2)1.3 课程设计需要配置的环境 (3)2 系统设计 (3)2.1 设计框图 (3)2.2 元件解析 (3)2.2.1 LCD12864芯片……………………………………………………………42.2.2 AT89C51芯片 (5)2.2.3 其他部件 (6)2.2.4 电路分析 (7)3 软件设计 (12)3.1 程序流程图 (12)3.2 程序代码 (12)4 系统的仿真与调试 (13)4.1 硬件调试 (13)4.2 软件调试 (14)4.3 软硬件调试 (14)5 总结 (14)附录1:程序代码附录2:12864LCD显示计算器键盘按键实验Proteus仿真图1 课程设计概述和要求1.1 课程设计任务与要求设计任务:利用AT89C51单片机结合12864LCD显示器设计计算器键盘按键。
设计要求1:本设计实现一个12864LCD显示12864LCD显示器设计计算器键盘按键2.利用AT89C51控制整个电路来实现. 显示12864LCD显示器设计计算器键盘按键,系统主要包括硬件和软件两部分。
重点就是各部分硬件的连接设计以及程序的编写。
本章讲述的就是系统硬件的设计,其中包括各模块的器件选择和电路设计。
将计算器按键上的信息传送至AT89C51主芯片之中,利用P2端口使之显示于12864LCD液晶显示屏上。
1.2 课程设计目的思路1、先把与题目有关的芯片资料找到,熟悉一下芯片资料2、把此程序的电路图看懂,了解一下它的实现原理,以及实现的功能。
3、分析一下此程序的各部分的功能,各零件的工作原理。
4、对程序进行调试,分析调试结果,观察并得出结论。
1.3 课程设计需要配置的环境1、一台主机,一台显示器2、Keil uVision3/Keil uVision4 应用程序软件3、ISIS 7 Professional 仿真软件4、老师交给的仿真电路图,及案例5、纸张,以及一些参考资料2 系统设计2.1.设计框图框图设计是为了能够从整体上把握系统的各个大的模块以及各个模块之间的联系。
基于AT89C51单片机键盘控制和LCD显示
依次将所有的行线Y4~Y7置为低电平,在判断4根列线的电平状态,当遇到某一列的电平
键盘扫描流程图
为低时表示此键按下。
5LCD1602液晶显示屏
液晶显示器具有显示质量高、发光恒定、不会刷新亮点和闪烁、体积小、电流小、字迹清晰以及功耗低的特点。本实验才用了16×2个字符,5×7点阵,8位数据接口的液晶显示。
{
P3=0xf7;
if(P3!=0xf7)
{
temp=P3&0xf0;
switch(temp)
{
case 0xe0:num_0=0;write_cmd(0x01);
break;
}
}
}
void keyscan() //键盘扫描程序操作
{
P3=0xf7;
if(P3!=0xf7)
{
delay(20);//延迟20ms
write_cmd(0x04);
i=0;
c=(long)(((float)sqrt(a))*1000);
while(c!=0)
{
write_dat(0x30+c%10);
c=c/10;
i++;
if(i==3)
write_dat(0x2e);
}
if(sqrt(a)<=0)
write_dat(0x30);
}
else if(fuhao==4){write_cmd(0x80+0x4f);
系统硬件设计框图如图1
图1
2AT89S52是一种带4kB闪烁可编程课擦除只读存储器的低电压、高性能CMOS型8位微处理器,俗称单片机。它是一个低功耗、高性能的8位CMOS微控制器。由片内可反复
基于AT89C51单片机的LED点阵动态显示系统设计
境 下进行 仿真 , 结果表 明该方 法 正确可行 , 可有效提 高开发效 率 , 获 得 良好 显 示效果 。
中图分类 号 : T P 2 7 4 . 2
L E D电子显示屏是集微 电子技术、 计算机技
术、 信息处 理技 术 于一体 的大 型显 示屏 系统 , 它 以
本 文在 P r o t e u s 环 境下 , 建立 以 A T 8 9 C 5 1单 片机 为核心 的控 制器 , 采用 串行 传输 、 动态 扫描 技 术, 设 计 出拥有 多功 能 的模 块 化 1 6 1 6 L E D点 阵 动态 显示 系统 。通过 仿 真验证 , 该 方法 正确 可行 ,
能有效缩短系统的开发周期 、 提高效率 、 节约成本。
1 L E D点 阵动 态 显 示 系统 原 理
1 . 1 系统 构成
联, 上下两行 L E D点阵对应的列 引脚并联 , 即构 成了一个 1 6= } = 1 6的 L E D点阵。
1 . 2 L E D动 态显示原 理
2 . 成都华商暖通设备工程有限公 司, 成都 6 1 0 0 1 7 ) 摘要
关键 词
以A T 8 9 C 5 1 单片机为核心控制器, 设计 了 1 6¥ 1 6 L E D点阵动 态显示 系统 , 并在 p r o t e u s 环
单 片机 A T 8 9 C 5 1 L E D p r o t e u s 动 态显 示
理器, 采用 A T M E L高密度非易失存储器制造技
术制 造 , 与工业 标准 的 MC S一 5 1指令 集 和输 出管 脚 相兼容 。 行、 列 驱 动器采 用 7 4 L S 2 4 5 , 它 是 8路 同相三
基于AT89C51的温度控制系统设计
基于AT89C51的温度控制系统设计冯晓锋西安翻译学院实验中心摘要:本系统是基于AT89C51单片机和DS18B20数字温度传感器的智能温度控制系统,根据要求可进行最高和最低温度的设定,通过RS-485总线标准实现与PC机的远程通信,实现PC机对采集温度的存储、处理、打印等功能。
关键字:AT89C51 数字温度传感器温度控制系统一、系统总体结构设计根据设计要求对某指定地点的温度进行实时的监测与控制,采用了分布式系统的控制方式,即在测控点配置能独立工作的从机,从机由主机进行监控管理,上下采用主从式监控管理形式,系统总体结构如图1所示。
图1 系统总体结构系统的各个部分功能和关系如下:①主机为管理机,完成参数设置、数据存储、处理及管理及打印功能。
②从机为控制机,采用单片机AT89C51,直接实现各个模块的控制功能,并能在主机关机的条件下实现所有的控制功能。
③通讯转换芯片MAX485实现RS-232信号和RS-485信号的转换,主机通过其向从机发送控制参数,从机将现场采集数据通过其传给主机。
④数据采集实现对传感器及运行设备的检测。
⑤输入输出部分包括输入模块和输出模块,输入模块将采集的信号转换后输入到从机,输出模块将系统的控制信号输出到控制器及其设备。
二、系统工作方式系统以温度监控为核心,温度参数和设备运行状态由主机根据用户要求定时向从机查询,各控制模块的设置参数修改时,将新的参数发送到从机。
主机可以对从机进行参数设置及控制,从机也可以独立工作。
从机通过温度传感器不间断地采集温度数据,根据控制模块的设置参数做出控制决策,驱动设备运行,并随时准备接受主机的指令,当受到询问时,将各项数据编码通过串行通信方式传输到主机。
主机接收到数据后,进行数据处理,在监控界面上显示当前的状态信息,并将此信息实时地存储到数据库中,为用户维护和管理准备数据。
对数据可以进行查询,也可以将一段时期的数据信息汇集成报表,报表包括各项统计数据,还可以将数据处理绘制成图形曲线,实现对数据的分析与管理。
点阵式LED“0-9”数字显示技术
目录第一章绪论 (2)第二章方案设计 (3)2.1 方案确定 (3)2.1.1 功能要求 (3)2.2.2 方案确定 (3)2.2 器件选择 (3)第三章硬件电路设计 (4)3.1 整体模块设计 (4)3.2 单片机最小系统设计 (4)3.2.1 晶振电路设计 (4)3.2.2 复位电路设计 (5)3.3 驱动电路设计 (6)3.4 LED点阵显示设计 (7)第四章软件电路设计 (10)4.1 软件设计思想 (10)4.2 主程序流程图 (13)第五章系统仿真与调试 (14)5.1 系统仿真 (14)5.2 性能分析 (14)结束语 (14)参考文献 (15)致谢 (15)附录 (16)第一章绪论LED是发光二极管LIGHT EMINTTING DIODE的英文缩写,是一种直接能将电能转化为可见光的半导体。
LED点阵是由发光二极管排列组成的显示器件,在日常生活中随处可见,其发光类型属于冷光源,效率及发热量是普通发光器件难以比拟的。
它采用低电压扫描驱动,具有耗电少、使用寿命长、成本低、亮度高、故障少、视角大、可视距离远、可靠耐用、应用灵活、安全、响应时间短、绿色环保、控制灵活等特点。
随着社会经济的不断进步,人们对LED显示器的认识不断加深,其应用领域越来越广。
本设计是基于AT89C5151的8×8点阵LED数码字符显示器的设计,LED点阵显示屏作为一种新兴的显示器件,是由多个独立的LED发光二极管封装而成. LED点阵显示屏可以显示数字或符号, 通常用来显示时间、速度、系统状态等。
本文讲述了基于AT89C51单片机8×8 LED数码字符显示器的基本原理、硬件组成与设计,Proteus软件仿真,程序设计等基本环节与相关技术。
LED电子显示屏具有所显内容信息量大,外形美观大方,操作使用方便灵活。
适用于火车,汽车站,码头,金融证券市场,文化中心,信息中心体育设施等公共场所。
该项目广泛涉及了计算机及电子技术中的电源技术,单片机技术,数据通讯技术,显示技术,存储技术,系统软件技术,接口及驱动等技术。
基于AT89C51单片机控制的LED显示屏的设计
HEBEINONGJI摘要:现代社会电子产品的应用越来越广泛,单片机作为核心控制器,其应用已经广泛渗入社会的各行各业。
LED显示屏在现代社会的各个领域里应用也越来越多。
本文主要研究如何用AT89C51单片机控制一块LED显示屏来循环滚动显示不同的汉字。
用C语言在Keil软件上编制程序代码,用Proteus软件对系统进行仿真。
关键词:LED显示屏;AT89C51;C语言程序基于AT89C51单片雌制的LED显示屏的设计苏州健雄职业技术学院赵素玲1控制要求使用AT89C51单片机控制一个8x8LED点阵显示屏,循环滚动显示不同的汉字。
不同的汉字有不同的代码,本文以作者自己所在的城市“太”'呛”“市”三个字为例来进行循环滚动演示,当然也可以显示其他的汉字。
具体要求是:1.1以AT89C51芯片为核心,加上外围辅助电路,设计出仿真电路图;1.2根■据要求用Keil软件编写出C语言程序代码;1.3用一个8x8LED点阵显示屏,"太""仓""市"三个字循环滚动显示。
2系统硬件设计2.1仿真电路图设计AT89C51芯片由电源、地、晶振和复位电路组成单片机最小系统。
Xl(晶体)与两个电容Cl、C2(30PF)组成了晶振。
1K电阻Rl、200fl电阻R2.22UF电容和一个按钮构成复位电路。
由P2口控制8x8LED显示屏的列,P3口控制8x8LED显示屏的行,电路如下图所示。
2.2元器件清单系统仿真元器件清单列表如表2-1所示:表2-1元器件清单列表序号代号名称型号与规格数量1Cl C2电容30PF22C3电容22UF13R1电阻1K14R2电阻20015XI晶体CRYSTAL16LED点阵8X817U1主控芯片AT89C5113系统软件设计系统C语言程序代码:#include<reg51,h>//包括一个51标准内核的头文件#include<intrins.h>#define uchar unsigned char#define uint unsigned intuchar code tai[]={0xf7,0xf7,0x00,0xe7,0xdb,0xad,0x7e,0xfif};//太uchar code cang[]={Oxf7,Oxe7,Oxdb,Ox81,0x5a,0xd3,0xdd,0xc1};〃仓uchar code shi[]={0xf7,0x80,0xf7,0x80,0xb6,0xb4,0xb6,0xf7};//市delay(uint z)//带有形参的延时子函数{uint x,y;fbr(x=z;x>0;x——)for(y=200;y>0;y―);}void main(void)//主程序{uchar a,b,c,u,v,w;//初始化定义P3=0x80;〃给行赋初值while(l){u=0;while(u<80)//"太"字显示的时间{a=0;while(a<8){P3二_crol_(P3,l);〃更新行P2=tai[a];〃将“太”字对应行的内容传给P2口delay(l);//调用延时子函数a++;}u++;}v=0;while(v<80)〃"仓"字显示的时间{b=0;while(b<8){P3二_cn)l_(P3,l);//更新行P2=cang[b];//将“仓”字对应行的内容传给P2口delay(l);//调用延时子函数b卄;}v++;}w=0;while(w<80)〃"市"字显示的时间{c=0;while(c<8){P3=_crol_(P3,l);//更新行P2=shi[c];//将“市”字对应行的内容传给P2口delay(l);//调用延时子函数C++;}2020年第5期何卞衣祀85H EBEINONGJIw++;}}}在程序设计中,先对用到的变量进行初始化设置,保证程序可以有效运行。
基于AT89C51单片机的多功能函数信号发生器设计毕业论文
·正弦波
正弦信号可用如下形式表示
f(t)=Asin(ωt+θ)(1)
其中,A为振幅,ω是角频率,θ为初相位。正弦函数为一周期信号如下图1所示:
图1 正弦波
·方波
方波函数是我们常用且所熟知的简单波形函数,做脉冲等,其表示形式如下:
(2)
方波波形如下:
图2 图形
当方波下半段幅值为0时,就为矩形波,一个原理,所以不再赘述矩形波。
(2)片内数据存储器有128B,地址空间为00H—7FH,片外没数据存储器。
(3)片内有4KB的程序存储器,地址空间为0000H—0FFFH,没有偏外存储器, 应接高电平。
(4)可以使用两个定时/计数器T0和T1,一个全双工的串行通信接口,5个中断源[1]。
·晶振电路工作原理及应用
单片机有18、19两引脚。分别为XTAL1和XTAL2。单片机采取内部振荡电路时,将这两引脚接石英晶体与微调电容。此设计采用的是12M晶振和两个30pF的电容。在芯片内部结构中,XTAL1和XTAL2引脚是一反相放大器的两个输入端,构成单片机内部振荡器。同样,根据需要的不同,也可采用外部时钟方式。本次设计采用内部时钟方式。如图所示。
It can control the type and the output frequency of the waveform when the microcontroller are equipped with the keyboard. Also when it coupled with the LED it can be displayed. It can be sure that it is digital signal that come from the microcontroller. So we should add the DAC0832 on the output side for D/A conversion. With the two levels of op-amp we can adjust waveform. Finally display on theoscilloscope.
数码管动态显示教案
电子综合设计实训题目数码管动态显示 _ 姓名专业学号指导教师郑州科技学院电气工程学院目录摘要 (I)1背景 (1)1.1介绍 (1)1.2设计步骤 (2)2 设计思路 (3)2.1方案对比 (3)3元件的选择 (6)3.1单片机 (6)3.2 显示元器件的选择 (6)4 设计原理及功能说明 (8)4.1 各部分功能说明 (8)5 装配与调试 (14)5.1装配 (14)5.2调试 (14)6 总结 (15)附录 (17)附录一:元件清单 (17)附录二:电路源程序 (17)数码管动态显示的设计摘要本文介绍了一种基于AT89C51单片机的8个数码管滚动显示单个数字的设计,让八位数码管滚动显示0、1、2、3、4、5、6、7,我们以液晶显示技术的发展为背景,选择了比较常用的液晶数码管显示模块,利用了单片机控制数码管模块的显示机理。
研究学习AT89C51单片机其功能,对学习过的单片机,C语言课程进行巩固,设计一款在8只数码管上流动显示单个数字的程序,并用PROTEUS进行电路设计和实时仿真。
该电路有两部分组成:AT89C51单片机和显示模块组成。
AT89C51单片机具有超低功耗和CPU外围的高度整合性;显示模块数码管是由多个发光二极管封装在一起组成“8”字型的器件,引线已在内部连接完成,只需引出它们的各个笔划,公共电极,方便易用。
实际应用中不需要外部任何元器件即可实现,具有接口电路简单、可靠,易于编程的特点,抗干扰性好等特点。
单片机技术使我们可以利用软硬件实现数码管准确显示各种数码。
而且这种技术相对简单,性价比较高,在我们生活中应用很广泛,具有一定的发展前景。
关键词:AT89C51单片机;数码管;滚动显示1背景1.1介绍随着电子技术的发展,特别是新型集成电路、分立元件的不断投入市场,使得人们对电子技术应用的关注程度已大大超过了电子技术本身。
在计时,自动报时及自动控制等领域发挥着重要的作用,在人们的日常生也愈加离不开数字化的各种生活用品,电子技术深入到社会生活的各个角落。
基于AT89C51单片机的LED显示控制系统_毕业设计外文翻译
基于AT89C51单片机的LED显示控制系统_毕业设计外文翻译毕业论文(设计)外文翻译题目:基于AT89C51单片机的LED显示控制系统系部名称:专业班级:学生姓名:学号:指导教师:教师职称7>2013 年 6月 10日本文摘译自:Application of Electronic Technique外文文献原文:Design of LED Display Control System Based on AT89C52 Single Chip MicrocomputerAbstract―This paper introduces display design processabout hardware and software based on AT89C52 single chipmicrocomputer. We use a simple external circuit to controlthe display screen, which size is 32 × 192. The displ ay screenalso can display the size of the six 32 × 32 dot matrix Chinese characters by a dynamic scan mode, and can be divided into two small display screen, which can display twenty-four Chinese characters whose size is 16×16. We can modify the code to ch ange the content of the display,subtitles can achieve scrolling function and the scroll speed can be adjusted according to requirements, subtitles can also achieve pause function. The Chinese character code stored in external data memory, the capacity of data memory is expanded according to the requirements of Chinese characters we want to show. This display screen has advantages of small volume, few hardware and simple circuit structure.Index Terms―LED, Chinese Character Display, AT89C52I. INTRODUCTIONLED display has become an important symbol of the city lighting, modernization and information society with continuous improvement and beautification of people's living environment [6]. LED lights can be seenin the large shopping malls, railway station, docks, underground station, a variety of management window and so on. LED business has become a fast-growing new industry, a huge market space and bright prospects [9]. The text, pictures, animation and video are displayed by LED’s light, and content can be changed. Some components are the display devices of the modular structure, and which usually consists of a display module, control system and power system. The display module is constituted by the lattice structure which consists of LED, and is responsible for light-emitting display; the screen can display text, pictures, video and so on by control system which can control light or dark of LED in the corresponding region; Power system is responsible for transforming input voltage an d current into voltage and current which the screen needs. LED dot matrix display extracted display character font through PC, and sent to the microcontroller, then displayed in the dot matrix screen, which mainly used for display of indoor and outdoor characters. LED dot matrix display can be divided into graphic display, image display and video display by displayed content. Compared with the image display, the characteristics of graphic display is no difference in gray color whether it is monochrome or color display. Therefore, graphic display also fails to reflect the richness of color, and video display can not only show exercise, clear and full-color images, but also show television and computer signals. Although there are some differences between the three,but the most basic principles are similar [6].SCM has excellent cost performance, small size, high reliability, strong control, and widely used in smart instruments, mechanical and electrical integration, realtime process control, robotics, domestic appliances, fuzzy control, communications systems and so on.This article described the design by the LED display relevant principle, and the design of hardware and software structure are described in detail, finally, we simulate for the overall design and analyze the results.II. System Overall Structure DesignSingle Chip Microcomputer SCM models wereselected according to the target, function, reliability, cost, accuracy and speed of the control system. According to the actual situation of the subject, the choice of SCM models mainly considered from the following two aspects: First, SCM has strong anti-interference ability; Second, SCM has a higher cost-effective. Due to MCS-51 is widely used in China, has more information and can compatible with the more peripheral chips too, in particular, ATMEL Corporation, introduced a new generation microcontroller in 2003, that is 89S series, and its typical products with high performance and low cost microcontroller is AT89C52. AT89C52 is a low voltage, high-performance CMOS 8-bit microcontroller, the chip includes 8 KB read-only program memory PEROM which erase can be repeated, 256byte random access data memory RAM , devices adopthigh-density nonvolatile memory technology to produce, compatible with the standard MCS-51 instruction set and the 8052 products, while the chip built-in general-purpose 8-bit central processing CPU , Flash storage unit, can be applied to the more complex control applications[10]. The system was realized by the circuitry which is made up of AT89C52 chip, Clock circuit, reset circuit, column scan driver circuit, line drive circuit and the six 32 × 32 LED dot matrix, the overall structure of LED characters display is shown in Fig.1. A display unit is composed of dot matrix and two 74HC154. Line data signal is divided into two parts, which is given by the two 8255A respectively, but the 8255A data are from the P0 port the master controller AT89C52. The column scanning signal of each character was given by the two 74HC154, the 74HC154 12 pieces and was divided into six groups. The input signal of 74HC154 was given by the P1.0~P1.3 of AT89C52. External data memory 6264 connected with the AT89C52 the P0 port.Figure 1 The overall structure of LED characters displayIII. SYSTEM HARDWARE CIRCUIT DESIGNA. Circuit Design of MCU Control SystemThe size of Chinese characters is 32 × 32, but microcontroller has 32 I/O port, and can’t meet design requirements, so the I/O port must expand, the data port expansion was implemented by two 8255A. The data port expansion is shown in Fig.2, 74HC373 is the address latch, and latchlow eight address, the low eight address signals of 6264 provided by it, but the high eight address signals of 6264 provided by P2.0~P2.4, Internal port of 8255A was chosen by A0 and A1. 74HC139 is 2-4 decoder, whose input signals are provided by P2.6 and P2.7 of SCM, and provided strobe for the external I / Odevices, because the system has more than one external device, make sure that they can not be gated, so that their addresses is the only and do not repeat. The clock circuit of AT89C52 composed of 18, 19feet from the clock side XTALI and XTAL2 , and 12MHz crystal X, capacitor C1 and C2, and uses on-chip oscillator mode. Reset circuit uses a simple power-on reset circuit, and mainly constitute of resistor R1, capacitor C3, connected to the AT89C52's reset input pin.Figure.2. SCM control system circuitB The Circuit Design of Display Memory UnitThe size of Chinese characters is 32×32 in thedesign, each character composed of four parts which are a , b , c , and d , and each part composed of four LED matrix which the size is 8 × 8, circuit decomposition map of display unit is shown in Fig.3.(A) BC DFigure.3. Circuit decomposition map of display unitThe line signals of a ~ b are given by two 8255A, 1PA0 ~1PA7 and 1PB0 ~1PB7 are PA and PB port of 8255A-1, 2PA0 ~ 2PA7 and 2PB0 ~ 2PB7 are PA and PB port of 8255A-2,the right figures represent column scan signals which is given by 74HC154.16 column strobes are provided by 74HC154, a ~ d requires eight signal, respectively, so a and b share a 74HC154, c and d shared a 74HC154. Display a character need two 74HC154 which provide column scan signals. When the circuit works, the a ~ d is gated by scanning signal in proper order, only one was gated at a time, and other columns are extinguished, the displayed data is given by two pieces of 8255A simultaneously, the human eye will see a stable character because of the human eye's persistence of vision. In addition, because the Chinese character for each display needs 128 bytes storage space, but AT89C52 microcontroller chip is only 256 bytes data memory, it is far less than the design requirements, so we the expanded storage space by 8K × 8 external data memory 6264. a b JOURNAL OF COMPUTERS, VOL. 6, NO. 4, APRIL 2011 719? 2011 ACADEMY PUBLISHERC The Design of Ranks Data Unit CircuitInte1 8255A is a universal programmable parallelinput/output interface chip. Its function can be set throughthe software program, and has a strong versatility. It can be directly through the CPU data bus connected to external devices, easy to use and flexible. Inte18255A interface chip has three 8-bit parallel input and output ports, programming methods can be used to set three ports as input ports or output ports. Chips work have the basic input and output, strobe input/outputand bidirectional input / output. When the data were transmitted by data bus of CPU, its can choose to unconditionally transfer, query transmission or interrupt transmission. During Inte1 8255A chip three-port, the port C can be used as not only the data port, but also the control port. When the port C is taken as a data port, it can be used as not only 8-bit data port, but also separately as two 4-bit data port, and each bit of the port C can be operated, can set a particular bit to input or output, so provide convenient conditions for bits control. Figure.4.Figure.4. Line data unit circuitLine data unit circuit In design of the display unit circuit, the lines data are given by two 8255A, as is shown in Figure 4. This design uses dynamic display means to display Chinese characters, which can be controlled the by the means of line or column scanning, The system uses the method of column scanning to control screen, Specific column scanning circuit is shown in Figure 5. Column scanningcircuit composed of 12 pieces of 74HC154.Two pieces of 74HC154 provided 32 strobes to display a character. The input signal of 74HC154 is P1.0 ~ P1.3 which is provided by AT89C52 to control screen, but 12 pieces of 74HC154 were used in the design, they work according to the order, the input of another piece of 74HC154 is P1.4 ~ P1.7 which is provided by AT89C52 to control screen.Figure.5. column scan unit circuitFigure.6. Serial Communication Interface CircuitD Serial Communication Interface CircuitPC and SCM are linked via a serial communication interface. In order to implement serial communication function between MCU and PC, and serial interface level of SCM will be changed into standard RS-232C level [11]. Where the output voltage of PC’s RS-232C port is ± 12V. MCU and PC, taking into account the short distance communication, and microcontroller is mainly responsible for receiving commands and data, so the PC is directly connected with the microcontroller, this is the simplest connection method. the signals which is from PC’s TXD-side were changed into a current signal through the communication circuit, the infrared lightemitting diodes of optocouper have current when a signal occurs, the light signals which is emitted by diode projected onto the and phototransistor,converted to electric signal, then input to the microcontroller RXD side, so photoelectric conversion is implemented, and electrical is completely isolated to avoid the feedback and interference which is produced by output side. as is shown in Figure 6 IV. SOFTWARE DESIGNThe entire software design mainly composes of display program and communication program. The Chinese characters to be displayed on the screen,character and other data for transmission control and display functions were achieved by dynamic scan. Realtime communication parts which communicate with PC receive data information by SCM serialdisruption, so real-time data information transmission with PC was implemented. The host computer software was implemented by Visual Basic. In the standard serial communication, MSCOMM which is the power communication control is provided by VB, it can set the serial communication of data sent and received, and the serial communication port status, message formats and protocols are set, directly send data by PC’s RS -232/RS-485 serial port. In order to realized to PC reliable communication with SCM, and ensure that both sides have the same data format and baud rate [11], this design uses RS-232 communications, a 10 bits data format, 9600bit / s baud rate. A Principles of Chinese characters dot matrix display and Sub-codes Chinese Times New Roman font which is UCDOS was taken as an example, each word composed of 16 ×16 dot matrix. That is, every word of the national standard Chinese character library expressed by the 256 lattice.We can understand each point as a pixel, and the shape of each word understood as an image. In fact, this character display screen not only can display Chinese characters, but also can display any graphics within the scope of 256 pixels. Due to the bus of microcontroller is the 8-bit, and a word need to split into two parts, as is shown figure 7. Figure.7. Principles of Chinese characters display In order to understand Chinese characters dot matrix composition law, at first, the characters code was obtained by column scanning method. Chinese characters are divided into upper part and lower part, the upper partcomposed of 8 ×16 lattice, the lower part was also formed by the 8 ×16 lattice. The first column of the upper left corner which was the upper part was shown by Column scanning method first, namely, P00~P07 port of 0 column, direction was P00~P07, Chinese character for "large" was displayed, P05 was on, the other is off. That is, binary is 00000100, and convert to hexadecimal as 04h. After the first column of the upper part was over, and continue to scan the bottom half of the first column, It can be seen from Figure 7, this column is not on all, that is, binary was 00000000, hex was 00h. According to this method, the second column, third column, until the sixteenth was scanned in turn. Characters "big" scan code can be drawn.04H, 00H, 04H, 02H, 04H, 02H, 04H, 04H04H, 08H, 04H, 30H, 05H, 0C0H, 0FEH, 00H05H, 80H, 04H, 60H, 04H, 10H, 04H, 08H04H, 04H, 0CH, 06H, 04H, 04H ,00H, 00HIt can be seen from this principle, no matter what font or image display, we can use this method to analyze the scan code and appears on the screen. Although above methods allow us to figure out the code for character dot-matrix process, but rely on manual methods for character code is a very complicated matter. To this end, Font software is used to find the character code, the content to display is entered after the software opens, font and size can be chosen according to requirements,you can select modulo by row or by column. Press the modulus button, the hexadecimal data character code can be automatically generated, we need to copy the data into the program.B. Address Assignment the Port and Data MemoryIn this design, we used to 8255A, 6264 and other external devices, and their gating is not the same, so strobe is controlled, which involves the address allocation problem. In the system, the address code of 8255A is 3FFCH ~ 3FFFH and 7FFCH ~ 7FFFH, the address code of 6264 is 0A000H ~ 0BFFFH. In addition, memory 6264 is divided into four zones, each space size is 2K, the TABLE I. corresponding address code is 0A000H ~ 0A7FFH,0A800H ~ 0AFFFH, 0B000H ~ 0B7FFH, 0B800H ~0BFFFH respectively. Table 1 and table 2 show the address allocation of the 8255A and 6264 respectivelyTABLE II.6264 INTERNAL PARTION TABLEZoning categories A15~A0 Partition size AddresscodingFirst district 1010 0000 0000 0000~1010 0111 1111 1111 2K0A000H~0A7FFH Second district 1010 1000 0000 0000~1010 1111 1111 1111 2K 0A800~0AFFFH Third district 1011 0000 0000 0000~1011 0111 1111 1111 2K 0B000H~0B7FFH Fourth district 1011 1000 0000 0000~1011 1111 1111 1111 2K 0B8000~0BFFFHC. Software processSoftware program composed of the beginning, initialization, display program, front, which the mainprogram and subroutine flow chart are shown in Figure.8. and Figure 9. Character code stored in the static memory 6264, and the SCM will wait for signal is given, that is, the input signal of SCM pin P3.0. When P3.0 is from low to high, display program begin to be run. First, control words written to 8255A control port, 8255A work in the form of mode 0 in the design. After control word was finished, the data will be displayed which is transferred to the 8255A from the 6264, the display data is output for four times because the line width of the characters screen is 32, a row of data is input and transported from top to bottom each, signal of the first rows which is controlled by SCM is gated after data transmission is over, so the first column data is displayed, then call delay procedures to display the contents of the stable. the next column of data is read after delay procedures is over, and the next row is gated, so that the second column of data is also displayed, and so on, because the screen size is 32 × 192, 192 rows are shown, and192 rows constitute an image. Then, scanning begin from the first column, and the starting address of display data backward shift on the basis of the original, which has an address overflow issues, it will assign start address to the address pointer when the data address is overflow, the display data content will be constantly repeated.Flow chart of communication with PC and SCM isshown in Figure 10. Real-time communication parts which communicate with PC receive data information by SCM serial disruption, so real-time data information transmission with PC was implemented.Figure.8 The flow chart of main programFigure.9 The flow chart of subroutineFigure.10 Flow chart of communication with PC and SCMV. SIMULATION RESULTS AND ANALYSISAfter the hardware and software design finished, the content of the design was simulated by Proteus, and modify circuit or optimize the program according to the simulation results. Proteus software which is EDA tool software is published by the British Labcenter electronics companies the software agent in China is the Guangzhou Electronic Technology Co. Ltd. vane [7]. It not only has simulation functions of other EDA tools, but also simulates microcontrollers and peripheral devices. It is the best simulation tool for microcontroller and external device. Although the Proteus just started in the domestic, lovers of SCM, the teachers of teaching in SCM and science and technology workers which engaged in SCM all love this software. Proteus is the world's leading EDA tools simulation software , from the schematic layout, debugging code to the MCU and the external circuit cosimulation, a key switch to the PCB design, complete design was realized from concept to product. It Is only simulation software platform which is composed of circuit simulationsoftware, PCB design software and the virtual model, the processor model supports 8051, HC11, PIC10/12/16/18/24/30/DsPIC33, AVR , ARM, 8086, and MSP430, etc. Cortex and the DSP family of processors were increased in 2010, and will increase other series processor model. In the compilation side, it also supportsIAR, Keil and MATLAB and so on.A PCB design and component assemblyTaking into account the number of components used in this design is not too much, we used the single routing strategy, and use a small amount of jumper wires on the top floor. The circuit are not stringent requirements for components parameters, as long as the component selection is correct, no damage, good circuit board manufacturing process, all electronic components can be assembled into the correct welding procedure, and to download program and debug program. When PCB board was produced and debugged, IC that is 20 pin should be installed in the AT89C52 position, in order tothe microcontroller can take down from the circuit board, and write program.B SimulationScroll of Chinese characters was implemented by software programming, we take a whole series of images which was implemented by Column scan signals to a frame, here is 192 rows. Then the next frame data backward shift on the basis of the first frame data, and dynamic display can begenerated. The images result of the simulation is shown in Figure11.Figure.11 the images result of the simulationThe simulation results shows that simulation is consistent with theoretical analysis, the data distribution of the memory is correct, the data correctly stored into the data memory, the display shows the contents of the program is the data to be displayed, the display can also be achieved pause and display speed is adjustable, indicating that the design of the hardware and software are possible.After the compilation and simulation of program was accomplished, preparing an editor that can write the AT89C52, and connected with the host computer hardware, that is, we can write AT89C52 chip and download, then, the microcontroller AT89C52 which is written program insert into the IC that has 40 pins. When power is connected, we can debug and run, As the system circuit require for parameters of the components is not very high, as long as the device is better, the parameters can meet the requirements, and work immediately after welding assembly.VI. CONCLUSIONLED display system that was designed adopted the host computer and slave structure, the host computer isPC, and communicated with slave computer display system through the serial communication interface, which can implement string modification, display mode settings, time settings and other functions; The slave mainly implement display of LED dot matrixdisplay screenwhich was controlled by SCM. Chinese character display is 32 ×32 dot matrix model, and to achieve real-time screen display changes, and have to display the current time and date functions. The design of LED dot matrix display control system has a simple circuit, stability, low power consumption, long life, easy to display characteristics, and include the LED display basic principles and procedures. As long as the microcontroller I/O interface is expanded, and increase the number of LED dot matrix and related chips, you can design a larger area and more tricks of the LED display. This article has some reference value of theory and practice. As the core control unit of the system, that is AT89C52, has lower frequency, in the future, in order to achieve LED video display in real time, and the display image can be compressed, which will increase the burden on the system. We can take advantage of high-speed DSP as the core control unit, and solve the above mentioned problems.The authors wish to thank Zhang xianjin and FanJishan for providing critical comments for this study andQiuXiuLing for editorial assistance.REFERENCES[1] Zhou Mingde. Principle and Application of MicroComputer Systems[M].Beijing: Tsinghua UniversityPress,2007[2] Chen Junxia, Huang Yuehua, Gan Wen. Large-screen LED dot matrix display system[J]. Automation Technology and Application. 2007,26(7):[3] Yan Shi. Digital Electronic Technology[M].Beijing: Higher Education Press,2006[4] Gu Deying, Luo Yunlin,Ma Shuhua. Computer Control Technology[M]. Beijing: Beijing University of Posts and Telecommunications Press, 2007[5] Peng Wei. SCM typical system design example Jingjiang [M].Beijing: Electronic Industry Press,2006[6] Yin Xiao’an, Wu Mingliang. LED dot matrix display bar screen control system design based on SCM[J]. Research and development of the world.2008,30(2): 154-155.[7] Zhu Qinghui, Zhang Fengrui, Wang Kui. Proteus Tutorial[M].Beijing: Tsinghua University Press,2008[8] Li Xueli. 8051 tutorial examples based on Proteus[M].Beijing: Electronic Industry Press,2008[9] Long guo’an. MCU-based design and production of LED display Chinese characters[J]. Modern electronic technology. 2007,13[10] Wu Gang. Application of AT89C52 microcontroller in the hospital care [J]. Electronic Component & Device Applications. 2008,10(12):23-24.[11] Hou Liling. LED dot matrix display control system Based on AT89S52[J]. Journal of Zhangzhou Technical Institute. 2008, 10 3 :70-72.字幕可以实现滚动功能关键字: LED,汉字,AT89C52一、简介LED显示屏已成为一个重要的标志,在城市照明、现代化、信息社会不断的改善和美化人们的生活环境。
基于AT89C51单片机的16x16点阵LED显示器设计
单片机课程设计报告书设计题目:基于AT89C51单片机的16*16点阵LED显示器设计姓名:院系:专业:学号:指导教师:教师职称:2012年11月25日目录摘要 (1)第1章引言 (1)1.1 LED及LED显示屏 (1)1.2 功能要求 (2)1.3 方案论证 (2)第2章系统总体方案及硬件设计 (3)2.1 AT89C51的原理及说明 (3)2.2 显示屏总体设计方案 (3)2.3 列驱动电路 (4)2.4 行驱动部分 (4)第 3 章系统硬件电路的设计 (8)3.1 单片机系统及外围电路 (8)3.2 列驱动电路 (8)3.3 行驱动电路 (9)第 4 章系统程序的设计 (10)4.1显示驱动程序 (10)4.2系统主程序 (11)4.3单片机汇编程序 (11)第5章系统调试 (22)第6章设计心得 (22)参考文献 (22)附录 (23)摘要:本设计使用简单单片机AT89C51作为主控制模块,利用简单的外围电路来驱动16×16的点阵LED显示屏。
在本设计中主要用两个74HC595来驱动16×16点阵显示屏的列,用AT89C51来驱动16×16点阵显示屏的行,可以最终实现——“十六乘十六点阵可调速显示屏设计”十五个汉字的自动左移,而且它们的“进”和“出”是以滚动形式设计的。
也就是说,硬件电路大致上可以分成单片机系统及外围电路、列驱动电路和行驱动电路三部分。
从而可以实现一个室内用的16×16点阵LED图文显示屏,在目测条件下LED显示屏各点亮度均匀、充足,可显示图形和文字,显示图形或文字应稳定、清晰无串扰,图形或文字显示有静止、移入移出等显示方式。
最后,利用烧录器可以很方便的实现单片机与PC机等外围存储设备的数据传输,并能利用软件方便的进行显示内容的多样变化,另一方面,LED点阵显示屏作为一种新兴的显示器件,是由多个独立的LED发光二极管封装而成。
进行了单片机AT89C51的软件仿真并成功完成了仿真验证。
单片机(基于AT89C51的温度采集与显示系统设计)
基于AT89C51的温度采集与显示系统设计摘要:以AT89C51单片机为核心控制元件介绍了与DS18B20和MAX7219显示驱动组成的温度采集系统的设计方案利用单片机空余I/O口以及上述元件的特性,构成该系统。
通过Proteus进行仿真。
关键词:温度采集,AT89C51,DS18B20,MAX7219目录1、系统概述……………………………………………………………….2、硬件介绍……………………………………………………………….3、软件设计……………………………………………………………….4、仿真结果……………………………………………………………….5、小结…………………………………………………………………….6、参考文献……………………………………………………………….1、系统概述温度传感器选用目前常用的数字温度传感器DS18B20,采用数码LED显示,显示驱动为MAX7219,首先设计系统的总体原理图如下:系统可以简单地分为为5个模块,由外部提供8V-24V直流电源供电。
电源模块将输入8-24V的电源电压转换为5V,为系统中的芯片供电,可以使用7805等常用的三端稳压器芯片;温度传感器采集温度信号,温度传感器有模拟输出和数字输出两种形式,这里选择具有数字输出的DS18B20;单片机是系统的核心,选用AT89C51;系统采用LED数码显示器显示温度值,LED显示屏采用独立的显示驱动芯片MAX7219,单片机将待显示的字符写入MAX7219后,MAX7219将会动态的刷新显示内容,无需占用单片机过多的资源。
尽管DS18B20的分辨率可已达到0.0625°C,但测量精确度为0.5°C,因此设计4位数的LED数码显示管就可以了,显示3位整数,1位小数。
2、硬件介绍:1、数字温度传感器DS18B20DS18B20数字温度计提供9位-24位(二进制)温度读数,以指示器件的温度,数据经过单线接口送入DS18B20或从DS18B20送出,因此从主机CPU到DS18B20仅需要一条DQ。
毕业设计-基于AT89C51单片机的电子密码锁的设计
毕业设计(论文)题目:电子密码锁的设计学院:电气与信息工程学院专业:电子信息工程姓名:学号: ********* 指导老师:**完成时间: 2013年5月28日摘要随着经济社会发展,人们生活水平的提高,如何实现家庭防盗这一问题也变的尤其的突出。
传统的机械锁,由于其构造简单,安全性能低,无法满足人们的需要。
随着电子产品向智能化和微型化的不断发展,数字密码锁作为防盗卫士的作用显得尤为重要。
而单片机以其实用,功能强大,价格低廉等功能,已成为电子产品研制和开发中首选的控制器。
本文从经济实用的角度出发,阐述一个基于单片机的液晶显示电子密码锁的设计与实现。
系统采用ATMEL公司的AT89C51单片机作为系统核心,液晶显示器LCD1602作为输出设备显示系统提示信息,4*4矩阵键盘作为输入设备,CMOS串行E2PROM存储器AT24C02作为数据存储器,配合蜂鸣器、继电器等电路构成整个系统硬件;系统软件采用C语言编写。
设计的系统液晶显示,密码修改方便,具有报警、锁定等功能,使用便捷简单,符合住宅、办公用锁需求,具有一定的实用价值。
关键词:单片机,密码锁,AT89C51,LCD1602,AT24C02AbstractWith the development of our society and the i mprovement of people’s living standard, how to ensure the family security is becoming more and more important in particular. Traditional mechanical lock is unable to meet the need of us because of its simple structure and low security. Nowadays, electronic products become smarter and smaller, electronic password anti-theft lock plays a more important role as the security guards. The MCU with its practical, strong function, low price and other functions , has become the preferred controller in electronic product research and development.This article is written from the economic perspective, elaborates the design and implementation of a LCD electronic password anti-theft lock which is based on MCU. This system is composed of AT89C51 which is designed as the core of this system, LCD1602 as the output device to display the message of this system, 4 * 4 matrix keyboard as the input device, a CMOS serial E2PROM AT24C02 as the data storage, and a buzzer, relay circuit.The software of the system is written in C language. The system displays in a LCD, it can change password easily, and has the function of alarming, locking, and so on. This system has some practical value, and it is simple and easy to use, meets the demand of residential and the need of office lock.Key Words: MCU, Password-Lock, AT89C51, LCD1602, AT24C02目录摘要 (I)Abstract ............................................................................................................................. I I 目录 ................................................................................................................................. I II 1引言 . (1)1.1课题的背景和意义 (1)1.2课题的研究现状 (1)1.3课题研究内容 (2)2 数字密码锁总体设计 (3)2.1 系统方案论证 (3)2.1.1 采用数字电路的设计方案 (3)2.1.2 采用以单片机为核心设计方案 (4)2.2 基于单片机的数字密码锁的设计原理 (5)3 系统硬件设计 (6)3.1 主要元器件介绍 (6)3.1.1 主控芯片AT89C51的的介绍 (6)3.1.2 继电器的介绍 (9)3.1.3 存储芯片AT24C02的介绍 (10)3.1.4 LCD1602显示器的介绍 (10)3.1.5 矩阵键盘模块的介绍 (11)3.2 系统硬件部分 (12)3.2.1 系统电源部分 (12)3.2.2 键盘输入部分 (13)3.2.3 密码存储部分 (14)3.2.4 显示部分 (14)3.2.5 报警部分 (15)3.2.6开锁部分 (16)4 系统软件设计 (17)4.1 系统程序流程图 (17)4.1.1主程序流程图 (17)4.1.2 键功能程序流程图 (18)4.1.3 修改密码程序流程图 (19)4.1.4 开锁程序流程图 (20)4.2 子程序举例 (21)4.2.1 按键扫描子程序 (21)4.2.2 显示子程序 (22)4.2.3 开锁子程序 (22)4.3 系统软件调试及结果 (24)4.3.1 Proteus软件介绍 (24)4.3.2 系统软件调试 (25)4.3.3 仿真结果 (25)5 硬件系统制作及调试 (29)5.1焊接注意事项 (29)5.2硬件调试问题及解决办法 (30)5.3硬件调试效果 (31)总结 (34)致谢 (35)参考文献 (36)附录 (37)附录A 电路原理图 (37)附录B 系统总体程序 (38)1引言1.1课题的背景和意义随着人们生活水平的提高,如何实现家庭防盗这一问题也变的尤为突出,传统的机械锁由于其构造简单,被撬的事件屡见不鲜。
基于-AT89C51单片机简易计算器的设计
《微机原理与单片机课程设计》课程设计报告基于51单片机的简易计算器设计一、设计目的单片机的出现是计算机制造技术高速发展的产物,它是嵌入式控制系统的核心,如今,它已广泛的应用到我们生活的各个领域,电子、科技、通信、汽车、工业等。
本设计是基于51系列单片机来进行的简单数字计算器设计,可以完成计算器的键盘输入,进行加、减、乘、除六位整数数范围内的基本四则运算,并在LED上显示相应的结果。
软件方面使用C语言编程,并用PROTUES仿真。
二、总体设计及功能介绍根据功能和指标要求,本系统选用MCS-51系列单片机为主控机,实现对计算器的设计。
具体设计及功能如下:(1)由于要设计的是简单的计算器,可以进行四则运算,为了得到较好的显示效果,采用LED 显示数据和结果。
(2)另外键盘包括数字键(0~9)、符号键(+、-、×、÷)、清除键和等号键,故只需要16 个按键即可,设计中采用集成的计算键盘。
(3)执行过程:开机显示零,等待键入数值,当键入数字,通过LED显示出来,当键入+、-、*、/运算符,计算器在内部执行数值转换和存储,并等待再次键入数值,当再键入数值后将显示键入的数值,按等号就会在LED上输出运算结果。
(4)错误提示:当计算器执行过程中有错误时,会在LED上显示相应的提示,如:当输入的数值或计算得到的结果大于计算器的表示范围时,计算器会在LED上显示“CUO”,提示溢出。
三、系统模块组成框图:二、硬件设计(一)、总体硬件设计本设计选用AT89C51单片机为主控单元。
显示部分:采用LED动态显示。
按键部分:采用4*4集成计算键盘;总电路图:(1)4×4集成计算键盘集成计算键盘本质上是4×4矩阵键盘,矩阵键盘采用四条I/O 线作为行线,四条I/O 线作为列线组成键盘,在行线和列线的每个交叉点上设置一个按键。
这样键盘上按键的个数就为4×4个。
这种行列式键盘结构能有效地提高单片机系统中I/O 口的利用率。
用单片机AT89C51设计一个2位的LED数码显示作为“秒表”—单片机课程设计
目录一、设计题目和要求: (2)二、设计目的: (2)三、设计内容: (3)四、课程设计心得体会 (25)五、参考文献 (26)六、课程设计指导教师评审标准及成绩评定 (27)附件1:秒表原理图(实际接线图) (28)附件2:仿真图1 (30)附件3:仿真图2 (31)一、设计题目和要求:题目三:秒表应用AT89C51的定时器设计一个2位的LED数码显示作为“秒表”:显示时间为00~99s,每秒自动加1,设计一个“开始”键,按下“开始”键秒表开始计时。
设计一个“复位”键,按下“复位”键后,秒表从0开始计时。
任务安排:李座负责绘制电路原理图;梁宗林负责收集资料及电子版整理;付忠林负责程序和仿真。
二、设计目的:1.进一步掌握AT89C51单片机的结构和工作原理;2.掌握单片机的接口技术及外围芯片的工作原理及控制方法;3.进一步掌握单片机程序编写及程序调试过程,掌握模块化程序设计方法;4.掌握PROTEUS仿真软件的使用方法;5.掌握LED数码管原理及使用方法。
6.掌握定时器、外部中断的设置和编程原理。
7.通过此次课程设计能够将单片机软硬件结合起来,对程序进行编辑,校验。
8.该课程设计通过单片机的定时器/计数器定时和计数原理,设计简单的计时器系统,拥有正确的计时、暂停、清零、复位功能,并同时可以用数码管显示。
三、设计内容:了解8051芯片的的工作原理和工作方式,使用该芯片对LED数码管进行显示控制,实现用单片机的端口控制数码管,显示分、秒,并能用按钮实现秒表起动、停止、清零功能,精确到1秒。
AT89C51单片机的主要工作特性:·内含4KB的FLASH存储器,擦写次数1000次;·内含28字节的RAM;·具有32根可编程I/O线;·具有2个16位可编程定时器;·具有6个中断源、5个中断矢量、2级优先权的中断结构;·具有1个全双工的可编程串行通信接口;·具有一个数据指针DPTR;·两种低功耗工作模式,即空闲模式和掉电模式;·具有可编程的3级程序锁定定位;AT89C51的工作电源电压为5(1±0.2)V且典型值为5V,最高工作频率为24MHz.AT89C51各部分的组成及功能:振荡器和时钟电路数据存储器128字节程序存储器14KBCPU 两个16位定时器计数器中断控制总线扩展控制器并行可编程I/O口可编程串行口内部总线外部中断扩展控制P0 P1 P2 P3 RXD TXD1.单片机的中央处理器(CPU )是单片机的核心,完成运算和操作控制,主要包括运算器和控制器两部分。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
键盘控制动态显示器目录摘要-----------------------------------------------------------------------------------------3 关键字--------------------------------------------------------------------------------------3 第一章绪论-------------------------------------------------------------------------------4 1.1 课题简介---------------------------------------------------------------------------4 1.2 系统功能要求---------------------------------------------------------------------4 1.3技术指标----------------------------------------------------------------------------4 第二章方案论证及硬件设计----------------------------------------------------------5 2.1 方案论证---------------------------------------------------------------------------5 2.2 单片机简介------------------------------------------------------------------------5 2.2.1 MSC-51系列单片机简介-------------------------------------------------------6 2.2.2MSC-51系列单片机内部结构-----------------------------------------------7 2. 2.3 MSC-51系列单片引脚及其功能----------------------------------------------8 2.3 键盘部分--------------------------------------------------------------------------9 2.4 LED显示器简介----------------------------------------------------------------10 2.5 电路工作过程---------------------------------------------------------------------10 第三章键盘控制电路原理图----------------------------------------------------------11 3.1 硬件框图---------------------------------------------------------------------------11 3.2 电路原理图------------------------------------------------------------------------12 第四章软件设计-------------------------------------------------------------------------13 4.1键盘扫描、按键判断程序------------------------------------------------------13 4.2显示子程序------------------------------------------------------------------------13 4.3程序框图----------------------------------------------------------------------------15 4.4 完整的源程序---------------------------------------------------------------------16 第五章检测与调试--------------------------------------------------------19 5.1 硬件调试---------------------------------------------------------------------------19 5.2 软件调试---------------------------------------------------------------------------19 第六章元器件清单----------------------------------------------------------------------20 第七章心得体会-------------------------------------------------------------------------21 第八章参考文献-------------------------------------------------------------------------23键盘控制动态显示器摘要随着现代化信息,技术的飞速发展和传统工业改造的逐步实现,单片机的应用正在不断地走向深入,同时带动传统控制检测日新月益的更新。
在实时检测和自动控制的单片机应用系统中,单片机往往是作为一个核心部件来使用,单片机的发展越来越快,由于单片机具有体积小,重量轻,价格便宜,功耗小,控制能力强及运算速度快等特点,因而在国民经济建设,军事及家用电器等各个领域的到了广泛的运用。
但仅单片机方面知识是不够的,还应根据具体硬件结构,以及针对具体应用对象特点的软件结合,以作完善。
在单片机应用系统中,键盘往往是必不可少的输入设备。
键盘已成为人们日常生活中必不可少是必需品,广泛用于电脑、手机以及银行电话等,给人们的生活、学习、工作、娱乐带来极大的方便。
利用键盘可以输入数据,单片机根据指令来完成指定的功能。
键盘控制动态显示器是利用家盘的简单输入在指定的程序下完成指令的任务。
本产品的主要功能是利用键盘输入在显示器上从左到右依次移位显示指定的数字。
如有输入错误,按S10一位一位删除。
按S12则全部删除。
关键词:键盘单片机 8051 位控制 8位LED显示器第一章绪论1.1课题简介该产品介绍一个采用8051单片机芯片制作的“键盘控制动态显示器”,该LED数码管显示电路采用动态显示方式,并用八位数码管显示。
该电路采用8051单片机,使用5V电池供电(亦可使用桥式整流电路和变压器将交流电转化为直流电),其具有电路简单、制作容易、设置方便、使用灵活等优点。
1.2系统功能要求1、本电路采用的内部振荡器方式,晶体振荡频率为6MHz,具有较高的频率稳定性。
2、当按下一个键时,则会在显示器上显示那个键所对应的数字。
3、本电路允许用户随时改按键输入设置新的参数。
按最后一行的第一个键,则是一位一位删除,最后一个键则是全部删除。
4、本电路的外接电源可用5V直流电池电源,亦可将交流电压转变为直流电,简单方便。
使用中应谨慎,避免硬件设施被烧坏。
1.3技术指标R0=(5-1.8)V/(5~12)mA=267~640ΩR1=R2=R3=R4=R5=R6=R7=510ΩR8=R9=R10=R11=R12=R13=R14=R15=R16=1KΩ电阻具体位置详见图(3.2)第二章方案论证及硬件设计2.1 方案论证:为了达到本次设计的要求,有众多方法可以选择,如:运用电子电路设计就是其中一种。
采用大量门元件组成显示器电路,但因条件有限,再加上其十分烦琐、焊接复杂、精度不高,达不到本次设计的目的,故不采用。
为了达到实现LED显示器的数字显示,可采用动态显示法和静态显示法。
由于静态显示法需要数据锁存器等硬件,接口又稍微复杂一些,而本身此次设计键盘动态显示只有八位,并且系统本身又没有其它什么繁重的处理任务,所以决定采用动态扫描法实现LED的显示。
设计中单片机采用容易购买的8051系列,单片机就具有足够的空余硬件资源实现其它的扩展功能,如果考虑到要采用电池供电的话,则可采用其它适合型号的单片机。
在软件方面,通过程序的编制,可以很快的通过运用伟福软件进行修改,大大的提高了工作效率,程序灌输也很迅速。
单片微型计算机作为微型计算机发展的一个分支,十几年发展十分迅速。
由于单片机具有可靠性高,体积小,功耗低,环境适应性强,成本低和容易产品化等从上面几种方案可以看出,利用单片机所设计的键盘控制显示器要比采用电子电路所设计的显示器有明显的优越性。
利用8051单片机控制的硬件电路比较简单,软件方面程序也不复杂。
因此制作原理简单,可在功能作用上要比电子电路设计的显示器精确广泛,方便小巧又通俗易懂。
现在的产品普遍要求体积小、重量轻,这就要求单片机除了功能强和功耗低外,还要求其体积要小。
现在的许多单片机都具有多种封装形式,其中SMD(表面封装)越来越受欢迎,使得由单片机构成的系统正朝微型化方向发展。
单片机在智能仪器,仪表,工业实时控制,智能终端,通信设备,医疗器械,汽车电器,导航系统和家用电器等领域有着广泛的用途。
而数字集成电路,由于系统内部结构复杂,硬件庞大,价格高,功能不灵活,所以在处理速度,应用领域等方面远不及单片机好。
单片机正在取代各种类型的传统电子产品,只要一个单片机就能起到使各类产品升级换代的功效,它不仅能构成简单的应用系统,而且更适合于各类复杂的要求较高的实时应用系统。
MCS-51系列单片机的推广应用进一步促进了我国工业技术的改造以及其他领域的技术更新,向全自动化,小型化,智能化方向方向迈进。
单片机应用的重要意义还在于,它从根本上改变了传统的控制系统设计思想和设计方法。
原来必须由模拟电路,数字电路实现的大部分功能,现在已经通过单片机由软件方法来实现了。
所以,本显示器的核心部件就是单片机在本次设计采用单片机设计中,动态扫描显示法又有静态扫描法无法比拟的优点,故本次设计采用了以8051为核心,利用其外部电路和数码管的动态扫描的设计思想。
随着社会科技文化的发展,电子、电脑技术的不断提高。