基于51单片机16x64点阵设计报告.docx
《基于51单片机16x64点阵设计报告.docx》由会员分享,可在线阅读,更多相关《基于51单片机16x64点阵设计报告.docx(25页珍藏版)》请在冰豆网上搜索。
![基于51单片机16x64点阵设计报告.docx](https://file1.bdocx.com/fileroot1/2023-7/27/5e41e6a9-bfe0-43ef-9c74-0ef5c283c67e/5e41e6a9-bfe0-43ef-9c74-0ef5c283c67e1.gif)
基于51单片机16x64点阵设计报告
物理与电子信息工程学院
电子设计竞赛设计方案
制作项目:
基于单片机的Led点阵设计
团队成员:
电子科学技术协会技术部
第一章:
实物图展示
第二章:
芯片简介
2.1点阵简介:
8x8点阵是由64个发光二极管排列成8行8列的矩阵,一个发光二极管控制着点阵的一个点。
这种显示比较逼真,能显示的字符比较多。
实际应用比较广泛,如点阵广告牌,交通灯报站台。
16*64点阵屏构成
首先,我们来分析一下16*16点阵行控线,列控线。
级联方法:
如图四个点阵。
●把00,01相同的行线相连接。
●把10,11相同的行线相连接。
●把00,10相同的列线相连接。
●把01,11相同的列线相连接。
●最后,00,01的列就作为16x16点阵的列控线。
00,10的行就作为16x16点阵的行控线。
同理:
16*64的点阵也是一样的,将同一行的所有行连在一起,同一列的所有列连在一起!
(我们这次点阵用的是共阳型点阵,即行接阳极)
这里的16*64设计我们使用的是proteus画图的,里面使用的是网络标号!
2.2AT89S52简介:
AT89S52有P0,P1,P2,P3。
四个口,18,19号引脚提供外部时钟信号。
2.374HC595简介:
74HC595是8位串行输入,8位串行或并行输出。
●QA~QH为并行输出。
可以将信号输送到LED,类似流水灯。
●Q’H为串行输出。
●10号角:
移位寄存器清零端,低电平有效。
●11号引脚:
移位寄存器时钟脉冲,高电平有效。
●12号引脚:
存储寄存器时钟脉冲,高电平有效。
●13号引脚:
控制输出的使能端,低电平有效。
●14号角传送串行信号,信号源可以来单片机。
●16,8号引脚分别接VCC,GND。
2.474HC154简介:
74HC154是一个类似于74LS138一样的译码器,它为4-16线译码,它为单片机的引脚扩展发挥了很大的作用。
●23,22,21,20号引脚:
传送地位到高位的地址码。
●18,19号引脚:
154的使能端,低电平有效。
●12,24引脚:
分别接GND,VCC。
●Y0~Y15:
译码的结果,一出来的是低电平。
第三章各部分详细电路
3.1单片机最小系统与说明及连接电路
●AT89S52的最小系统其中,C1,C2都是30pF的片状电容,C3为10μF的电解电容。
R1为10K的电阻。
●X1为12MHz的晶振,连接到单片机的18,19引脚,为单片机提供内部时钟信号,内部反相放大器自激振荡产生时钟信号。
时钟发生器对振荡脉冲2分频,即石英频率f=12MHz,则单片机时钟信号为6MHz。
●9号角接上电复位电路。
当给单片机加电,高电平脉冲通过10μF的电解电容,到达9号引脚(RST),实现主复位。
如果正常工作中产生意想不到的情况发生,可以用按键开关控制发送一个高电平实现主复位。
Protues省略了电源端,20,40号引脚分别接GND,VCC。
1.A、B、C、D作为地址数据输入线,接P1.0,P1.1,P1.2,P1.3。
2.19号角:
接GND。
3.74hc154的16行经8550放大后加载到点阵的行。
3.2行驱动
3.3列驱动
八片74HC595级联控制列数据:
●八片的11号引脚:
相连接单片机的P3.1口,作为移位时钟脉冲。
●第一片的14号角接单片机的P3.0口,提供串行数据。
●八片的12号引脚:
相连接单片机的P1.6为存储寄存器的时钟脉冲。
●10号角:
接单片机P1.5
●13:
都同时接地。
●第一片的9号引脚级联到第二片的14号引脚,第二片的9号引脚级联到第三片的14号引脚,依次类推,最后一片9号脚空着。
●100~807接到16x64的点阵的列引脚。
3.4我们使用的字模软件
字模提取软件设置如下:
3.5硬件设计注意事项:
●整个系统需要加载5V左右的电压。
●行信号经过154后要加载几百欧姆的电阻限流,而后接到8550,经其放大后接到点阵。
第四章:
Keil实现C代码与程序下载:
#include
#defineBLKN8//列锁存数(为LED显示字数*2)
#defineTOTAL8//待显示字个数,本例共八个
#defineTOTAL130//待显示字个数,本例共30个
#defineCONIOP1//显示控制口
sbitG=CONIO^7;//为154译码器显示允许控制信号,0时输出,1时输出全为高请求高阻态
sbitCLK=CONIO^6;//为595输出锁存器时钟信号端,1时输出数据,从1到0时锁存输出数据
sbitSCLR=CONIO^5;//为595移位寄存器清0口,平时为1,为0时,输出全为0
unsignedcharidatadispram[(BLKN/2)*32]={0};//显示区缓存,4字共4*32
//*****************字模表*********************//
unsignedcharcodeBmp[][32]={//我们使用的是阳码、逐行式、顺向
{0xFD,0xFF,0xFD,0xF7,0xC0,0x2F,0xFD,0xDF,0xFD,0xBF,0x00,0x01,0xFE,0xFF,0xFD,0xFF,0xC0,0x1F,0xEF,0xBF,0xDF,0x7F,0xA0,0x03,0x7F,0x7F,0xFF,0x7F,0xFD,0x7F,0xFE,0xFF},/*"孝",0*/
{0xFF,0xD7,0xFF,0xDB,0xC0,0x01,0xDF,0xDF,0xD0,0x5B,0xDF,0xDB,0xD0,0x57,0xD7,0x67,0xD7,0x6D,0xB0,0x55,0xBF,0xB9,0x7F,0x7D,0xFE,0xFF,0xB7,0x7B,0xB7,0xED,0x78,0x0D},/*"感",1*/
{0xDD,0xF7,0xEE,0xF7,0xEE,0xEF,0xFF,0xDF,0x80,0x01,0xBF,0xFD,0x7F,0xFB,0xE0,0x1F,0xFF,0xBF,0xFE,0x7F,0x00,0x01,0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xFA,0xFF,0xFD,0xFF},/*"学",2*/
{0xFF,0xBF,0x87,0xDF,0xB4,0x01,0xAD,0xFD,0xAB,0xFB,0x9E,0x07,0xAF,0xFF,0xB7,0xFF,0xB4,0x01,0xB7,0x6F,0x97,0x6F,0xAF,0x6F,0xBE,0xED,0xBE,0xED,0xBD,0xF1,0xBB,0xFF},/*"院",3*/
};
//*****************字模表*********************//
unsignedcharcodeBmp1[][32]={
{0xEF,0x7F,0xEF,0x7F,0xAF,0x7F,0xAF,0x03,0x82,0xAB,0xAD,0xAB,0x6F,0xAB,0xEF,0x6B,0xE3,0x6B,0x0E,0xDB,0xAD,0xDB,0xEF,0xBB,0xEF,0xBB,0xEF,0x7B,0xEE,0xD7,0xEF,0xEF},/*"物",0*/
{0xFE,0xFF,0xFE,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