1.AT89C51单片机C语言编程16*16点阵程序
#include <reg52.h>
unsigned char code tab[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe}; //控制列,P2控制,低电平显示
unsigned char code digittab[10][8]={{0x00,0x00,0x3e,0x41,0x41,0x41,0x3e,0x00}, //0 控制行,P0控制,高电平显示,八行十个数字
{0x00,0x00,0x00,0x00,0x21,0x7f,0x01,0x00}, //1
{0x00,0x00,0x27,0x45,0x45,0x45,0x39,0x00}, //2
{0x00,0x00,0x22,0x49,0x49,0x49,0x36,0x00}, //3
{0x00,0x00,0x0c,0x14,0x24,0x7f,0x04,0x00}, //4
{0x00,0x00,0x72,0x51,0x51,0x51,0x4e,0x00}, //5
{0x00,0x00,0x3e,0x49,0x49,0x49,0x26,0x00}, //6
{0x00,0x00,0x40,0x40,0x40,0x4f,0x70,0x00}, //7
{0x00,0x00,0x36,0x49,0x49,0x49,0x36,0x00}, //8
{0x00,0x00,0x32,0x49,0x49,0x49,0x3e,0x00} //9
};
unsigned int time;
unsigned char a,b;
sbit duan=P3^6;//数码管段显示
sbit wei=P3^7;//数码管位显示
/***************************************/
/* 主程序 */
/***************************************/
void main(void)
{
duan=1;
P0=0X00;
duan=0; //关闭数码管段显示
wei=1; //数码管位显示,,点阵行控制
TMOD=0x01;//初装中断值
TH0=(65536-3000)/256;
TL0=(65536-3000)%256;
TR0=1;
ET0=1;
EA=1;
while(1)
{;}
}
/***************************************/
/* 中断子程序 */
/***************************************/
void t0(void) interrupt 1 using 0 //中断
{
TH0=(65536-3000)/256;
TL0=(65536-3000)%256;
P2=tab[a]; //共阳点阵,P2控制低电平,P0控制高电平
P0=digittab[b][a]; //P0控制锁存器74HC573输出高电平控制行
a++;
if(a==8)
{
a=0;
}
time++;
if(time==233)
{
time=0;
b++;
if(b==10)
{
b=0;
}
}
}
2.基于单片机16*16点阵C语言各种方式结合的显示程序
这是我以前写的,给你参考参考,现在懒得再细究了,Keil51的#include "..\mcu.h"sbit screenSW = P3 ^ 3;code unsigned char wordModel[32] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; code unsigned char wordModel1[32] = {0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10,0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x08, 0x08, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00}; void Display16x16(unsigned char displayMatrix[]);void DisplayTop(unsigned char displayBlock[]);void DisplayBottom(unsigned char displayBlock[]);void DelayMs(unsigned char ms);void main(void){ while(1) { unsigned char i; for(i = 0; i < 200; i++) Display16x16(wordModelKe); Delay(100); for(i = 0; i < 5; i++) { Display16x16(wordModel); Delay(10); Display16x16(wordModel1); Delay(10); } for(i = 0; i < 200; i++) Display16x16(wordModelCheng); Delay(100); for(i = 0; i < 5; i++) { Display16x16(wordModel); Delay(10); Display16x16(wordModel1); Delay(10); } }}void Display16x16(unsigned char displayMatrix[]){ DisplayTop(displayMatrix); DisplayBottom(displayMatrix + 16);} void DisplayTop(unsigned char displayBlock[]){ unsigned char i, colSelect; P2 = 0x00; colSelect = 0x83; for(i = 0; i < 16; i++) { P0 = displayBlock[i]; P3 = colSelect; DelayMs(10); screenSW = 1; colSelect += 0x10; }}void DisplayBottom(unsigned char displayBlock[]){ unsigned char i, colSelect; P0 = 0x00; colSelect = 0x83; for(i = 0; i < 16; i++) { P2 = displayBlock[i]; P3 = colSelect; DelayMs(10); screenSW = 1; colSelect += 0x10; }} void DelayMs(unsigned char ms){ unsigned char i; for(i = 0; i < ms; i++) ;}。
3.AT89C51单片机C语言编程16*16点阵程序
#include
4.急求基于单片机的LED显示屏点阵控制论文
摘要本设计是一16*16点阵LED电子显示屏的设计。
整机以美国ATMEL 公司生产的40脚单片机AT89C51为核心,介绍了以它为控制系统的LED点阵电子显示屏的动态设计和开发过程。通过该芯片控制一个行驱动器 74HC154和两个列驱动器74HC595来驱动显示屏显示。
该电子显示屏可以显示各种文字或单色图像,全屏能显示1个汉字,采用4块8*8点阵LED显示模块来组成16*16点阵显示模式。显示采用动态显示,使得图形或文字能够实现静止、移入移出等多种显示方式。
文中详细介绍了LED点阵显示的硬件设计思路、硬件电路各个部分的功能及原理、相应软件的程序设计,以及使用说明等。单片机控制系统程序采用单片机汇编语言进行编辑,通过编程控制各显示点对应LED阳极和阴极端的电平,就可以有效的控制各显示点的亮灭。
所显示字符的点阵数据可以自行编写(即直接点阵画图),也可从标准字库中提取。LED显示以其组构方式灵活、显示稳定、功耗低、寿命长、技术成熟、成本低廉等特点在车站、证券所、运动场馆、交通干道及各种室内/外显示场合的信息发布,公益宣传,环境参数实时,重大活动倒计时等等得到广泛的应用。
经实践证明,该系统显示误差小,性能稳定,结构合理,扩展能力强。关键词:AT89C51单片机; LED; 点阵显示; 动态显示; 汇编语言。
AbstractThis design is a 16 *16 lattice LED electron display monitor design.The whole equipment is with the 40-pin AT89C51 MCU (Micro Controller Unit) produced by the American ATMEL company at the core, introduced take it as the control system LED lattice electron display monitor dynamic design and the development process. Controls good driver 74HC154 and two row driver 74HC595 through this chip actuates the display monitor demonstration. The electronic screen can show all kinds of written or monochrome images, one full screen display Chinese characters, four pieces of 8*8 dot-matrix LED display modules to form the 16*16 dot matrix display mode. Show dynamic show that makes static graphic or text can be achieved, shifted out of various formats. This paper describes the hardware design of the LED dot matrix display, and the principle function of the various parts of the circuit, the corresponding software program design and the use of some such.SCM process control system used for editing MCU assembly language, Programming control points indicated by the corresponding LED anode and overcast extreme level. We can effectively control the defense showed bright spots. The lattice data shows characters can prepare themselves (that is, direct lattice Painting), which can also be extracted from the standard font.LED display with fabric means flexibility, stability, low power consumption, long life, mature technology, low-cost features at the station, securities, sports venues, transportation corridors and various indoor / dissemination of information on foreign shows occasions, good publicity, real-time environmental parameters, etc. countdown major activities are widely used. As the practice proves, the system possesses advantages in low shows errors, stable, rational structure and strong extensible abilities.Key words: AT89C51 Micro Controller Unit; LED; Lattice display; Dynamic display; Assembly language.目录摘要 IAbstract II第一章 前言 1第二章 系统整体设计方案 22.1 需要实现的功能 22.2 LED显示特点 22.3 设计方案论证 32.3.1 显示模式方案 32.3.2 数据传输方案 4第三章 系统硬件部分设计 53.1 电源设计 53.2 单片机系统及外围电路 63.2.1 单片机的选择 63.2.2 AT89C51芯片介绍 63.2.3 单片机系统外围电路 93.3 列驱动电路 103.4 行驱动电路 123.4.1 行驱动芯片74HC154 介绍 123.4.2 行驱动电路 133.5 LED显示屏电路 15第四章 系统软件部分设计 174.1 系统主程序 174.2 显示驱动程序 18第五章 调试及性能分析 205.1 软件调试 205.2 硬件调试 205.3 性能分析 21结束语 22致谢 23附录一 系统综合电路原理图 24附录二 系统程序清单 25主要参考文献 32。
转载请注明出处众文网 » 单片机16x16点阵程序毕业论文