按键翻页12864

合集下载

LCD12864图形液晶并口显示2

LCD12864图形液晶并口显示2

LCD12864图形液晶并口显示【教学引入】液晶屏,在生活中很常见,我们常见的液晶显示器,如电脑的显示器,电视机,手机等等。

液晶屏在生活中已得到了普遍应用,它显示个各种各样的画面。

上次呢,我们让12864显示了汉字,这次我们让它显示图形。

【教学目标】1、掌握LCD12864液晶屏的绘图用法;2、编写LCD12864液晶屏的指令代码;【知识目标】1、掌握LCD12864液晶屏的绘图用法;2、掌握LCD12864液晶屏指令代码;【教学准备】电脑、Proteus、Keil、MCS-51系列单片机综合实验箱【教学方法】教法:讲授法、讨论法学法:练习法、探究法【教学课时】四课时【教学过程】一、12864液晶介绍12864液晶屏不仅能显示汉字,还能显示图形。

今天呢,我们就来看看液晶屏怎么显示图形的。

首先呢,我们看看显示坐标关系1、图形显示坐标水平方向X——以字节为单位垂直方向Y——以位为单位由图可知,水平方向为0~31,以位为单位;垂直方向为0~7、8~16,以2个字节为单位,分为上下两个块。

如下图2、图片取模有了图像显示的坐标,我们该把图片变成代码了,PCtoLCD2002不仅能取模汉字,还能取模图片。

字模软件PCtoLCD2002双击图标打开软件可以看到下图所示的画面,此软件也是绿色软件打开后可以直接使用。

软件有两种工作模式:字符模式和图形模式;上图界面是字符模式。

可以通过菜单栏模式(C)切换工作模式。

我们选择图形模式,最大化,如下图。

单击工具栏中的图标按钮,看到如下图所示的对话框。

我们可以根据自己的实际需要而进行的设置,因其简单易用这里不再详细讲述其使用方法。

设置完成后,单击左下角的确定保存。

设置如下图回到PCtoLCD2002完美版-(图形模式)界面,单击按钮,导入要显示的128X64的bmp图片,单击图标按钮,可以看到软件下方的数据显示区域出现的对应的显示数据。

如下图阅“12864M.PDF”12864M液晶显示模块技术手册——四、用户指令集1、指令表2:(RE=1:扩充指令集),如下图,讲解了12864的扩充指令集。

实验(二十一)PS2键盘控制LCD12864显示

实验(二十一)PS2键盘控制LCD12864显示

华南理工大学无线电爱好者协会F D R 工作室实验二十一:PS2键盘控制LCD12864实验一. 实验目的:1. 认识ps2键盘协议2. 掌握12864液晶模块的使用方法。

3. 学会利用12864实现小型可视化图形界面 二. 实验原理:12864与单片机连接原理图12864跟ps2键盘的底层通讯较为复杂,我们在文件夹里提供了相应的资料给读者。

在此不再累述。

提醒读者一下:12864 驱动电流加大,使用时请先调lcd 座旁的蓝色可调电阻,使lcd 上能显示一个一个的小方格。

然后才能正常显示。

12864有并行跟串行两种通讯方式。

当psb 脚为高平时是并行,反之为串行。

华南理工大学F D R 工作室华南理工大学无线电爱好者协会F D R 工作室键盘要注意通码(按下键盘时发出)跟断码(松开键盘时发出)之间的联系。

三.硬件链接图:12864连线:如图所示的红线排针连到单片机各IO口,12864的几个控制脚都是连接在P0口上,从右到左依次是RS、RW、E、PSB、NC(我们提供的12864用不到该引脚)、RST,依次连接到P0^0,P0^1,P0^2,P0^3,P0^4,P0^5; 而数据线则直接接到P1口。

键盘连线:键盘的两条控制线在排针P7靠近红外接收头的两根上,最后一根是时钟线sclk,上边一根是数据线dat,将数据线接到单片机P3^2上靠近单片机一侧的排针上,将时钟线接到单片机INT1上。

12864连线图四.实验程序:#include<AT89X52.h>#include"led.h" //该头文件包含数码管显示数字驱动 #include"tg12864p.h"//该头文件包含lcd12864驱动sbit dat =P3^2;//DATA IN华南理工大学F D R 工作室华南理工大学无线电爱好者协会F D R 工作室#define uchar unsigned char // 即 uchar 等同与unsigned char #define uint unsigned int uchar sp2key_scan();/*****************常量声明区******************************************/ uchar code key_table[47]={'0','1','2','3','4','5','6','7','8','9', 'a','b','c','d','e','f','g','h','i','j', 'k','l','m','n','o','p','q','r','s','t', //说明:存放键盘上按键的as2码值 'u','v','w','x','y','z',' ','-','=',']', ';','"',',','.','/','[',' ' //作用:方便日后传值到液晶上 };/****************全局变量声明区************************************/ uchar key=0; //用于存放键盘解码函数的解码结果 uchar key_temp=0; bit BF=0; //接收到通码的标志位uchar key_count=0; //记录键盘传任一个数据时传来时钟脉冲个数 uchar key_buffer[5]={0,0,0,0,0};//接收键盘传来数据的缓冲区uchar key_num=0;//一个按键动作,键盘会发出通码,段吗,这用于记录收到编码个数。

PFC-12控制器说明书

PFC-12控制器说明书

数)进行修改;操作“确定”键:操作生效;操作“菜单”键:返回上一级菜单。
各设置项下的参数设置内容为:
“设备设置”包括:设备编号、变比、有功电度、无功电度。如图 13 所示。 该界面中所有参数均按位设置。
“补偿设置”包括:投入系数、切除系数、投入延时、切除延时。如图 14 所 示。
“电容设置”包括:设备中△型、Y 型电容器的组数、容量及电容器的配置方 案。如图 15 所示。
Http:
一、产品概述:
PFC 无功补偿控制器采用全数字化设计、交流采样、四象限分析,人机界面 为 12864 点阵大屏幕液晶显示器,监测配电变压器、配电线路运行状态和补偿电网 无功。集实时数据采集、历史数据存储、通讯、无功补偿、谐波分析、故障报警、 配电综合监测等功能于一体的新型配电监控设备,适用于三相四线制配电网的综合 监测及无功补偿控制。也可单独作为配电负荷综合监测仪使用。具有 232/485 通讯 接口;支持 GPRS 网络远程通讯;支持短距离(1000 米以内)无限抄表,配套手持式 数据抄表器。可以直接连接电脑,进行联机操作。
广州阿珂法电器 Tel:020-82029012 / 82051945 Fax:82051079
Http:
4.2 电压信号线兼作监控终端电源输入,所以安3 电流信号线宜选用大于 1.5MM 平方的单股铜导线,且导线尽可能短。 4.4 带电采集、设置数据时,均不得接触带电部分、以确保人身设备安全。
图 17
图 18
按键操作说明: 在设置界面下(图 12 所示),操作“▲”键、“▼”键:可选
择不同的修改设置项,在图 13——图 18 所示的界面中,对当前的参数(反显的参
广州阿珂法电器 Tel:020-82029012 / 82051945 Fax:82051079

AT89s52LCD12864多页菜单按键选择操作

AT89s52LCD12864多页菜单按键选择操作
判忙函数 ***********************************************/ void Check_Busy()
{ RS=0; //写命令 RW=1; //读状态 E=1; DataPort=0xff; while((DataPort&0x80)==0x80);//忙则等待 E=0;
用户自定义字符 ***********************************************/ void CGRAM() {
int i; Write_Cmd(0x30); Write_Cmd(0ite_Data(*s); s++; DelayUs2x(50); } } /***********************************************
液晶屏初始化 ***********************************************/ void Init_ST7920() {
DelayMs(40); //大于 40MS 的延时程序 PSB=1; //设置为 8BIT 并口工作模式 DelayMs(1); //延时
Write_Cmd(0x30); //选择基本指令集 DelayUs2x(50); //延时大于 100us Write_Cmd(0x30); //选择 8bit 数据流 DelayUs2x(20); //延时大于 37us Write_Cmd(0x0c); //开显示(无游标、不反白) DelayUs2x(50); //延时大于 100us Write_Cmd(0x01); //清除显示,并且设定地址指 针为 00H DelayMs(15); //延时大于 10ms Write_Cmd(0x06); //指定在资料的读取及写入时, 设定游标的移动方向及指定显示的移位,光标从右向左 加 1 位移动 DelayUs2x(50); //延时大于 100us } /***********************************************

12864液晶按键菜单程序

12864液晶按键菜单程序
{
write_dat(dis3[i]);
}
write_cmd(0x98);
for(i=0;i<16;i++)
{
write_dat(dis4[i]);
}
}
if(count1==2) //按下选择按钮2次
uchar code dis1_[] = {"系统初始化. "};
uchar code dis2_[] = {"系统初始化.. "};
uchar code dis3_[] = {"系统初始化.. "};
uchar code dis4_[] = {"按选择键开始! "};
uchar code dis1_6[] = {" 摄像头 "};
uchar code dis2_6[] = {" "};
uchar code dis3_6[] = {" "};
uchar code dis4_6[] = {"保存拍照——返回 "};
write_cmd(0x90);
for(i=0;i<16;i++)
{
write_dat(dis3_[i]);
}
delay_1ms(500);
write_cmd(0x90);
for(i=0;i<16;i++)
{
write_dat(dis4_[i]);
}
write_cmd(0x30); //基本指令操作
delay_1ms(2);
write_cmd(0x0C); //显示开,关光标

12864汉字液晶显示--按键电子时钟程序(具有闪烁,移位,加一,减一功能)

12864汉字液晶显示--按键电子时钟程序(具有闪烁,移位,加一,减一功能)

//12864汉字液晶显示--按键电子时钟程序(具有闪烁,移位,加一,减一功能)#include &lt;reg52.h&gt;#include &lt;intrins.h&gt;#define uchar unsigned charvoid lcd_ini();void ascii_change(void);void delay();void wri_add(uchar com);void wri_dat(uchar com1);void shan(void);void disp();void tkey(void);sbit cs=P1^7;sbit sid=P1^6;sbit sclk=P1^5;bit flag=1;uchar dat,count,f=1;//f测试哪个单元为当前闪烁状态uchar data clock[3]={23,45,12};uchar code clockname[10]={&quot;北京时间:&quot;};uchar data num[6];/*******主程序*************/void main(){lcd_ini();count=10;//机器周期为1us,每次定时50ms,此变量用来控制循环次数,在下面赋值为20,共定时1秒TMOD=0x01;TL0=0XB0;TH0=0X3C;EA=1;ET0=1;IT0=1;EX0=1;TR0=1;while(1){back:ascii_change();disp();delay();if(flag==1)goto back;tkey();shan();delay();}}/****lcd初始化*******/void lcd_ini(){wri_add(0x30);delay();wri_add(0x0c);delay();wri_add(0x01);delay();wri_add(0x06);delay();}/********定时程序*************/ void timer1() interrupt 1 using 2 {TL0=0XB0;TH0=0X3C;count--;if(count==0){count=10;clock[2]++;//秒//}elsegoto out;if(clock[2]==60){clock[2]=0;clock[1]++;//分//}if(clock[1]==60){clock[1]=0;clock[0]++;}if(clock[0]==24)//时//clock[0]=0;out:_nop_();}/*******十位个位转换成ASCII码************/ void ascii_change(void){num[5]=clock[2]-(clock[2]/10)*10+0x30;num[4]=clock[2]/10+0x30;num[3]=clock[1]-(clock[1]/10)*10+0x30;num[2]=clock[1]/10+0x30;num[1]=clock[0]-(clock[0]/10)*10+0x30;num[0]=clock[0]/10+0x30;}/********廷时程序*************/void delay(){uchar i,j;for (i=250;i&gt;0;i--)for (j=250;j&gt;0;j--);}/*****Write address*********/void wri_add(uchar com){uchar i,j,k;cs=0;cs=1;dat=0xf8;for(i=1;i&lt;=8;i++){sid=(bit)(dat&amp;0x80);sclk=0;sclk=1;sclk=0;dat=dat&lt;&lt;1;}dat=com;dat=dat&amp;0xf0;for(j=1;j&lt;=8;j++){sid=(bit)(dat&amp;0x80);sclk=0;sclk=1;sclk=0;dat=dat&lt;&lt;1;}dat=com;dat=_cror_(dat,4);// 此为高低四位交换dat=dat&amp;0xf0;for(k=1;k&lt;=8;k++){sid=(bit)(dat&amp;0x80);sclk=0;sclk=1;sclk=0;dat=dat&lt;&lt;1;}}/*********Write data*************/ void wri_dat(uchar com1){uchar i,j,k;cs=0;cs=1;dat=0xfa;for(i=1;i&lt;=8;i++){sid=(bit)(dat&amp;0x80);sclk=0;sclk=1;sclk=0;dat=dat&lt;&lt;1;}dat=com1;dat=dat&amp;0xf0;for(j=1;j&lt;=8;j++){sid=(bit)(dat&amp;0x80);sclk=0;sclk=1;sclk=0;dat=dat&lt;&lt;1;}dat=com1;dat=_cror_(dat,4);// 此为高低四位交换dat=dat&amp;0xf0;for(k=1;k&lt;=8;k++){sid=(bit)(dat&amp;0x80);sclk=0;sclk=1;sclk=0;dat=dat&lt;&lt;1;}}/******display program***********/ void disp(){uchar i,k=0;wri_add(0x80);for (i=1;i&lt;=9;i++)wri_dat(clockname[i-1]);wri_add(0x90);for (i=1;i&lt;=6;i++) {k++;if(k==3||k==5)wri_dat(clockname[8]);//时间之间的冒号。

C51单片机12864液晶带按键制作俄罗斯方块C源码

C51单片机12864液晶带按键制作俄罗斯方块C源码

************说明******************************此程序包含一个俄罗斯方块.c 文件和一个12864.h 文件********************俄罗斯方块.c文件**************************#include "reg51.h"#include "12864.h"#define uchar unsigned char#define uint unsigned intstatic unsigned long Seed = 1;#define A 48271L#define M 2147483647L#define Q (M / A)#define R (M % A)sbit K1=P3^4;sbit K2=P3^5;sbit K3=P3^6;sbit K4=P3^7;unsigned int idata num[19+2]={0xfff,//第1行,最下面0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,0x801,//第2行到第20行共19行0xfff//第21行,最上面};//定义共21行,其中num[0]为下墙壁行,num[20]为上墙壁行,每行12格,最左一格为左墙壁列,最右一格为右墙壁列unsigned char code Block[28][2]={/** 口口口口口口* 口口口口* 口口口口口口*/{0x88,0xc0},{0xe8,0x00},{0x62,0x20},{0x02,0xe0},/** 口口口口口口* 口口口口* 口口口口口口*/{0x22,0x60},{0x08,0xe0},{0xc8,0x80},{0xe2,0x00},/** 口* 口口口口* 口口口*/{0x8c,0x40},{0x6c,0x00},{0x8c,0x40},{0x6c,0x00},/** 口口口* 口口口口* 口*/{0x4c,0x80},{0xc6,0x00},{0x4c,0x80},{0xc6,0x00},/** 口口* 口口口口口口口口* 口口口口口口*/{0x04,0xe0},{0x8c,0x80},{0xe4,0x00},{0x26,0x20},/*口* 口* 口口口口口* 口*/{0x44,0x44},{0x0f,0x00},{0x44,0x44},{0x0f,0x00},/** 口口* 口口*/{0x06,0x60},{0x06,0x60},{0x06,0x60},{0x06,0x60}};#define PASSSCORE 20struct Jimu{unsigned int dat;char x;unsigned char y;unsigned char type;unsigned char change;}Sign[3];//积木结构体unsigned char SysFlag=0;#define NEWSIGNFLAG 0#define DEADFLAG 1#define PAUSEFLAG 2unsigned char Score=0;unsigned char Level=1;unsigned char DelayCnt=5;/*********************************************************/#define N 25/************************************伪随机数发生器*************************************/ double Random(void){long TmpSeed;TmpSeed=A*(Seed%Q)-R*(Seed/Q);if(TmpSeed>=0)Seed=TmpSeed;elseSeed=TmpSeed+M;return (double)Seed/M;}/************************************** 为伪随机数发生器播种***************************************/ void InitRandom(unsigned long InitVal){Seed=InitVal;}//延时子程序void Delay(unsigned int t){unsigned int i,j;for(i=0;i<t;i++)for(j=0;j<10;j++);}/*********************************初始化MPU**********************************/void InitCpu(void){TMOD=0x0;TH0=0;TL0=0;TR0=1;ET0=1;EX1=1;EA=1;TCON|=0x04;}/**************************** welcome 游戏选择界面/**********************/void welcome(){Lcd_WriteStr(0,0,"欢迎来玩");Lcd_WriteStr(0,1,"俄罗斯方块");Lcd_WriteStr(0,2,"设置按K1");Lcd_WriteStr(0,2,"开玩按K2");}/*************俄罗斯方块部分/******************************画墙壁,初始化界面*******************************/void DrawBoard(void){unsigned char n;for(n=0;n<12;n++){Lcd_Rectangle(3*n,0,3*n+2,2,1);Lcd_Rectangle(3*n,60,3*n+2,62,1);}for(n=0;n<20;n++){Lcd_Rectangle(0,3*n,2,3*n+2,1);Lcd_Rectangle(33,3*n,35,3*n+2,1);}Lcd_WriteStr(4,0,"经典游戏");Lcd_WriteStr(3,2,"Score:");Lcd_WriteStr(3,3,"Level:");}/*********************************** 游戏结束处理************************************/ void GameOver(void){if((SysFlag&(1<<DEADFLAG))!=0)Lcd_WriteStr(3,1,"You Fail");elseLcd_WriteStr(3,1,"You Pass");}unsigned int code MaskTab[16]={0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,0x0200,0x0400,0x0800,0x1000,0x2000,0x4000,0x8000};/**********************************根据积木图标左下坐标X,Y来画出积木图标***********************************/void DrawSign(struct Jimu Temp,unsigned char DrawMode){unsigned char m,n;for(m=0;m<4;m++)for(n=0;n<4;n++){if((Temp.dat&MaskTab[4*m+n])!=0)Lcd_Rectangle(Temp.x+n*3,Temp.y-2-3*m,Temp.x+n*3+2,Temp.y-3*m,DrawMode);}}/********************************将积木图标值融入num数据中也即把积木图标固定,无法再下降*********************************/FixSign(void){unsigned char m,n;for(m=0;m<4;m++)//行循环for(n=0;n<4;n++)//列循环{if((Sign[0].dat&MaskTab[4*m+n])!=0){num[20-(Sign[0].y-2)/3+m]|=MaskTab[11-Sign[0].x/3-n];}}}/********************************判断积木图标中方块是否与障碍方块重合*********************************/unsigned char CheckIf(void){unsigned char m,n;for(m=0;m<4;m++)//行循环for(n=0;n<4;n++)//列循环{if((Sign[1].dat&MaskTab[4*m+n])!=0){if((num[20-(Sign[1].y-2)/3+m]&MaskTab[11-Sign[1].x/3-n])!=0)return 0;}}return 1;}/********************************判断积木图标是否可以继续下降一格********************************/unsigned char CheckIfDown(void){Sign[1]=Sign[0];//Sign[1].y+=3;//假设下降一格return CheckIf();}/********************************判断积木图标是否可以向左移动*********************************/unsigned char CheckIfLeft(void){Sign[1]=Sign[0];Sign[1].x-=3;return CheckIf();}/********************************判断积木图标是否可以向右移动*********************************/unsigned char CheckIfRight(void){Sign[1]=Sign[0];Sign[1].x+=3;return CheckIf();}/********************************判断是否可以旋转*********************************/unsigned char CheckIfRoll(void){unsigned char i;unsigned int Temp;Sign[1]=Sign[0];if(++Sign[1].change>3)Sign[1].change=0;i=Sign[1].type*4+Sign[1].change;Temp=(unsigned int)Block[i][0]<<8;Temp=Temp|Block[i][1];Sign[1].dat=Temp;return CheckIf();}/********************************寻找满格的行并做消除处理最多寻找4个满行并做消除*********************************/void DelFull(void){unsigned char m,n;unsigned char Temp;unsigned char Flag=0;Temp=(Sign[0].y-2)/3;if(Temp>=20)//防止越过了下边界Temp=1;elseTemp=20-Temp;for(n=Temp+3;n>=Temp;n--)//积木图标的最顶行开始寻找满行比较有利于运算{if(num[n]==0xfff){Flag=1;for(m=n+1;m<=19;m++){num[m-1]=num[m];}num[m]=0x801;Score++;//每找到一个满行,则分数加1}}if(Flag)//为加速而设置并判断的标志,有已固定的积木有满格消行变化则重画积木界面{for(m=Temp;m<=19;m++)//为加速,不必要重第一行重画起,只需要从积木图标最下行开始往上的重画for(n=1;n<=10;n++){if((num[m]&MaskTab[n])==0){if(Lcd_ReadPixel(30-(n-1)*3,57-(m-1)*3)!=0)//为加速而做的读象素操作{Lcd_Rectangle(30-(n-1)*3,57-(m-1)*3,30-(n-1)*3+2,57-(m-1)*3+2,0);}}else{if(Lcd_ReadPixel(30-(n-1)*3,57-(m-1)*3)==0)//为加速而做的读象素操作{Lcd_Rectangle(30-(n-1)*3,57-(m-1)*3,30-(n-1)*3+2,57-(m-1)*3+2,1);}}}}}/*******************************随机产生一个积木图标放到预产生区域并显示出来********************************/void CreatSign(void){unsigned char n;unsigned int Temp;DrawSign(Sign[2],0);//先清除n=Random()*28;Temp=(unsigned int)Block[n][0]<<8;Temp=Temp|Block[n][1];Sign[2].dat=Temp;Sign[2].x=45;Sign[2].y=4*3+2;Sign[2].type=n/4;Sign[2].change=n%4;DrawSign(Sign[2],1);//后画出}void PrintScore(void){unsigned char Str[3];Str[0]=(Score/10)|0x30;Str[1]=(Score%10)|0x30;Str[2]=0;Lcd_WriteStr(6,2,Str);}void PrintLevel(void){unsigned char Str[3];Str[0]=(Level/10)|0x30;Str[1]=(Level%10)|0x30;Str[2]=0;Lcd_WriteStr(6,3,Str);}/********************************游戏的具体过程,也是俄罗斯方块算法的关键部分*********************************/void GamePlay(void){unsigned char m,n;unsigned int Temp;SysFlag|=1<<NEWSIGNFLAG;//刚开始初始化为需要产生新的积木图标InitRandom(TL0);Lcd_WriteStr(3,1,"Playing");PrintScore();PrintLevel();CreatSign();while(1){if((SysFlag&(1<<NEWSIGNFLAG))==1)//判是否需要产生新的积木图标{SysFlag&=~(1<<NEWSIGNFLAG);Sign[0]=Sign[2];CreatSign();Sign[0].x=12;Sign[0].y=14;for(m=0;m<4;m++)//行循环{for(n=0;n<4;n++)//列循环{if((Sign[0].dat&MaskTab[15-m*4-n])==0)break;}if(n==4)Sign[0].y-=3;}//将积木图标出现置顶for(m=0;m<4;m++)//行循环for(n=0;n<4;n++)//列循环{if((Sign[0].dat&MaskTab[4*m+n])!=0){if((num[20-(Sign[0].y-2)/3+m]&MaskTab[11-Sign[0].x/3-n])!=0)SysFlag|=1<<DEADFLAG;}}if((SysFlag&(1<<DEADFLAG))!=0)break;//如果产生新的积木图标中的方块与已固定好的方块重合,则死亡。

12864+键盘按键控制

12864+键盘按键控制

LCD12864_data=dat; DelayMs(5); LCD12864_E=1; DelayMs(5); LCD12864_E=0; } //------设定显示位置-----------void set_LCD12864_pos(uchar x,uchar y) { uchar pos; if(x==0) x=0x80; if(x==1) x=0x90; if(x==2) x=0x88; if(x==3) x=0x98; pos=x+y; write_12864cmd(pos); //地址 } //------------写字符串---------------void write_12864str(uchar *s) { while(*s) {
#endif
Lcd12864.h #ifndef __LCD12864_H__ #define __LCD12864_H__ #include"keyboard.h" #define uchar unsigned char #define uint unsigned int //-----端口定义-----------#define LCD12864_data P0 sbit LCD12864_RS =P2^4; sbit LCD12864_RW =P2^5; sbit LCD12864_E = P2^6; sbit LCD12864_PSB=P2^1; sbit LCD12864_RES=P2^3; //------------------------//extern void delay_1ms(uint x); extern void set_LCD12864_pos(uchar x,uchar y);//x 确定行,y 确定起始位置 extern void LCD12864_init(); extern void write_12864cmd(uchar cmd);

12864按键显示任意两位数

12864按键显示任意两位数
delay(5);
send_cmd(0x01); //清除LCD显示内容
delay(5);
}
uchar getkey()
{
unsigned char row,col,k;
for(row=0;row<4;row++) //行值依次为0xfe, 0xfd, 0xfb, 0xf7
{
LCD_SID=(bit)(i_dat&0x80);
LCD_SCLK=0;
LCD_SCLK=1;
i_dat=i_dat<<1;
}
LCD_CS=0;
delay(10);
}
/*写数据程序,指令由3个字节组成,第一个为写数据*/
/*第二个为数据高4位,第三个为数据低4位*/
#include <reg52.h>
#include <intrins.h>
#define uchar unsigned char
#define uint unsigned int
#define NOP _nop_();
sbit LCD_CS=P3^7; //片选,高电平有效(RS)
i_dat=i_dat<<1;
}
i_dat=cmd_dat;
i_dat&=0xf0;
for(i=0;i<8;i++)
{
LCD_SID=(bit)(i_dat&0x80);
LCD_SCLK=0;
LCD_SCLK=1;
i_dat=i_dat<<1;
}
uchar i;

万年历12864,键盘控制,新手

万年历12864,键盘控制,新手

#include<reg52.h>#include<intrins.h>#define uchar unsigned char#define uint unsigned intchar Adjust_Flag=0;uchar shi,fen,miao,nian,yue,ri,week,temp,s1num; sbit ACC0=ACC^0;sbit ACC7=ACC^7;sbit T_CLK = P3^6; /*实时时钟时钟线引脚*/ sbit T_IO = P3^4; /*实时时钟数据线引脚*/ sbit T_RST = P3^5; /*实时时钟复位线引脚*/ #define lcddate P0sbit lcdrs=P2^4;sbit lcdrw=P2^5;sbit lcden=P2^6;sbit lcdpsb=P2^1;sbit key1=P3^0;sbit key2=P3^1;sbit key3=P3^2;uchar code table1[]=" 20 -- -- "; uchar code table2[]=" :: :: "; uchar code table3[]=" "; uchar code table4[]="我爱中国!!!!";uchar shi,fen,miao,nian,yue,ri,week,temp,s1num; void delay(uint x){uint i,j;for(i=x;i>0;i--)for(j=110;j>0;j--);}/*bit lcd_busy(){bit result;lcdrs = 0;lcdrw = 1;lcden = 1;_nop_();_nop_();_nop_();_nop_();result = (bit)(P0&0x80);lcden = 0;return result;}*/void write_com(uchar com){//while(lcd_busy());lcden=0;lcdrs=0;lcdrw=0;P0=com;delay(5);lcden=1;delay(5);lcden=0;}void write_date(uchar dat){//while(lcd_busy());lcden=0;lcdrs=1;lcdrw=0;P0=dat;delay(5);lcden=1;delay(5);lcden=0;}void lcd_init(){lcdpsb=1;write_com(0x30); //基本指令操作delay(5);write_com(0x0c); // 显示开,关光标delay(5);write_com(0x01); //清屏delay(5);}//时分秒显示子函数void write_sfm(uchar add,uchar dat)//向LCD写时分秒,有显示位置加、现示数据,两个参数{uchar gw,sw;gw=dat%10;//取得个位数字sw=dat/10;//取得十位数字write_com(0x90+add);write_date(0x30+sw);//数字+30得到该数字的LCD1602显示码write_date(0x30+gw);//数字+30得到该数字的LCD1602显示码}//-------------------------------------//年月日显示子函数void write_nyr(uchar add,uchar dat)//向LCD写年月日,有显示位置加数、显示数据,两个参数{uchar gw,sw;gw=dat%10;//取得个位数字sw=dat/10;//取得十位数字write_com(0x80+add);//设定显示位置为第一个位置+addwrite_date(0x30+sw);//数字+30得到该数字的LCD1602显示码write_date(0x30+gw);//数字+30得到该数字的LCD1602显示码}//-------------------------------------------void write_week(uchar week)//写星期函数{write_com(0x88+3);//星期字符的显示位置switch(week){case 1:write_date('M');//delay(5);write_date('O');//delay(5);write_date('N');break;case 2:write_date('T');//delay(5);write_date('U');//delay(5);write_date('E');break;case 3:write_date('W');//delay(5);write_date('E');//delay(5);write_date('D');break;case 4:write_date('T');//delay(5);write_date('H');//delay(5);write_date('U');break;case 5:write_date('F');//delay(5);write_date('R');//delay(5);write_date('I');break;case 6:write_date('S');//delay(5);write_date('T');//delay(5);write_date('A');break;case 7:write_date('S');//delay(5);write_date('U');//delay(5);write_date('N');break;}}/******************************************************************** * 功能: 往DS1302写入1Byte数据********************************************************************* **/void write_byte(uchar dat){uchar i;ACC = dat;T_RST = 1;for(i=8; i>0; i--){T_IO = ACC0;T_CLK = 1;T_CLK = 0;ACC = ACC >> 1;}}/******************************************************************** * 功能: 从DS1302读取1Byte数据********************************************************************* **/uchar read_byte(void){uchar i;T_RST = 1;for(i=8; i>0; i--){ACC = ACC >>1;ACC7 = T_IO;T_CLK = 1;T_CLK = 0;}return(ACC);}/******************************************************************** * 名称: W1302(uchar Add, uchar dat)* 功能: 往DS1302写入数据********************************************************************* **/void W1302(uchar Add, uchar dat){T_RST = 0;T_CLK = 0;T_RST = 1;write_byte(Add); // 写地址_nop_();_nop_();write_byte(dat); // 写1Byte数据T_CLK = 1;T_RST = 0;}/******************************************************************** * 名称: R1302(uchar ucAddr)* 功能: 读取DS1302某地址的数据***********************************************************************/uchar R1302(uchar Add){int dat;T_RST = 0;T_CLK = 0;T_RST = 1;write_byte(Add); //写地址,命令_nop_();_nop_();dat = read_byte(); //读1Byte数据T_CLK = 1;T_RST = 0;return(dat);}/******************************************************************** * 名称: dectobcd(uchar dec)* 功能: DEC码转换为BCD码********************************************************************* **/uchar dectobcd(uchar dec){uchar bcd;bcd = 0;while(dec >= 10){dec -= 10;bcd++;}bcd <<= 4;bcd |= dec;return bcd;}/******************************************************************** * 功能: BCD码转换为DEC码********************************************************************* **/uchar bcdtodec(uchar bcd){uchar data1;data1 = bcd & 0x0f; //取BCD低4位bcd = bcd & 0x70; //剔除BCD的最高位和低4位。

50KW384VDC(中文)中性工频三相系列逆变器12864显示电池优先使用手册

50KW384VDC(中文)中性工频三相系列逆变器12864显示电池优先使用手册

使用说明书User’s Manual一、简介 (1)(一)使用说明 (1)(二)注意事项 (1)二、安装与接线 (2)(一)安装环境 (2)(二)安装前检查 (2)(三)安装位置 (2)(四)连接 (2)三、操作程序 (4)(一)术语解释 (4)(二)开机操作步骤 (4)(三)关机操作步骤 (4)四、工作原理 (5)(一)正常运行 (5)(二)电池运行 (5)(三)市电运行 (6)五、技术参数 (6)(一)三进三出技术参数 (6)(二)三进三出技术参数 (6)六、结构功能介绍 (7)(一)控制面板结构功能 (8)(二)前后板结构功能 (10)七、维护与保养 (13)(一)逆变器保养维护和注意事项 (13)(二)电池保养维护 (13)(三)逆变器储存 (13)八、故障处理 (14)九、搬运要求 (15)十、维修与服务 (17)(一)使用说明1、该系列产品采用高速微处理器(MCU)和可编程逻辑器件(CPLD),经软件编程控制。

功率器件采用当今最先进的第五代低损耗大功率IGBT和静态开关。

该系列产品是集国际最新的控制器件和最先进的软件为一体的电源产品。

广泛应用于大楼照明、道路交通照明、电力、通讯、医疗、工矿企业等行业。

2、在某种情况下,逆变器设备可能引起电波干扰,一些敏感的设备(如电视、收音等)可能受到干扰,此时应将其与受干扰物的距离拉远。

3、在安装和使用逆变器时,请详尽阅读此说明书。

(二)注意事项1、如果逆变器应有连接“接地”系统,首先将主输入电源的地线接到逆变器注明有"PE"或“G”的接线端子排上。

2、逆变器在输入,电池及输出开关断开的情况下仍然可能带电,非专业技术人员不要擅自打开逆变器的外壳,否则可能会对逆变器及操作者造成伤害。

3、需要更换保险丝时,应采用相同型号规格的保险丝。

4、逆变器的专用电池应由专业技术人员进行更换,更换出来的电池必须送交回收机构处理,废旧电池根据法律被定为“有毒废料”。

12864液晶按键显示

12864液晶按键显示

#include<msp430x14x.h>#include "Keypad.h" //键盘扫描#include "Keypad.c"#include "HB12864.h"#include "Uart.H"#define uchar unsigned char#define uint unsigned int#define ulong unsigned longulong temp; //矩阵键盘中间变量//**************************引用外部变量的声明************************** extern unsigned char key_val;extern unsigned char key_Flag;//***************************主函数**************************************void main( void ){WDTCTL = WDTPW + WDTHOLD;//关闭看门狗Uart_Init();//液晶初始化_EINT();Screen_Con(LIGHT_SET);//开背光m1: Screen_Con(SCREEN_CLA);//清屏uchar yi=1; //检测输入的状态//Screen_Cont(CUR_SET,0X00);//关光标Display_StrChar(STR_CHAR,0,4,"液晶键盘测试");//第一排的显示部分Display_StrChar(STR_CHAR,2,0,"键盘输入:");//第三排的显示部分Screen_Cont(CUR_SET,0X0A);//设置光标长度Display_Dot(CUR_LOC_SET,47,72);//设置光标位子Init_Keypad();while(1){Key_Event();if(key_Flag==1){ key_Flag=0;if(yi==1){temp= key_val;//QSPL=temp*10000;Display_shuzi(STR_NUM_6_12,36,72,0x30+temp); //第一位的输入值}if(yi==2){temp = key_val;if (temp==67) //OK键break;if(temp==79) //清除键{yi=0; //归位Display_StrChar(STR_CHAR,2,9," "); //清零Display_Dot(CUR_LOC_SET,47,72);//设置光标位子}else{Display_shuzi(STR_NUM_6_12,36,78,0x30+temp);}}if(yi==3){temp = key_val;if (temp==67) //okbreak;if(temp==79) //清除键{ yi=0; //归位Display_StrChar(STR_CHAR,2,9," "); //清零Display_Dot(CUR_LOC_SET,47,72);//设置光标位子}else{//QSPL=QSPL+temp*100;Display_shuzi(STR_NUM_6_12,36,84,0x30+temp);}}if(yi==4){temp = key_val;if (temp==67)break;if(temp==79) //清除键{yi=0; //归位Display_StrChar(STR_CHAR,2,9," "); //清零Display_Dot(CUR_LOC_SET,47,72);//设置光标位子}else{Display_shuzi(STR_NUM_6_12,36,90,0x30+temp);}}if(yi==5){temp = key_val;if (temp==67)break;if(temp==79) //清除键{yi=0; //归位Display_StrChar(STR_CHAR,2,9," "); //清零Display_Dot(CUR_LOC_SET,47,72);//设置光标位子}else{Display_shuzi(STR_NUM_6_12,36,96,0x30+temp);}}if(yi==6){temp = key_val;if (temp==67)break;if(temp==79) //清除键{yi=0; //归位Display_StrChar(STR_CHAR,2,9," "); //清零Display_Dot(CUR_LOC_SET,47,72);//设置光标位子}else{Display_shuzi(STR_NUM_6_12,36,102,0x30+temp);}}if(yi==7){temp = key_val;if (temp==67)break;if(temp==79) //清除键{yi=0; //归位Display_StrChar(STR_CHAR,2,9," "); //清零Display_Dot(CUR_LOC_SET,47,72);//设置光标位子}else{Display_shuzi(STR_NUM_6_12,36,108,0x30+temp);}}if(yi==8){temp = key_val;if (temp==67)break;if(temp==79) //清除键{yi=0; //归位Display_StrChar(STR_CHAR,2,9," "); //清零Display_Dot(CUR_LOC_SET,47,72);//设置光标位子}else{Display_shuzi(STR_NUM_6_12,36,114,0x30+temp);yi++;break;}}yi++;//P2IFG = 0;}}while(1){Key_Event();if(key_Flag==1){ key_Flag=0;temp=key_val;if(temp==25)goto m1;}}}。

12864汉字和图片的显示

12864汉字和图片的显示

12864汉字和图片的显示课程设计报告书设计题目:12864汉字和图片的显示课程名称:单片机快速入门系部:电子信息系专业:应用电子技术班级:电子0901姓名:组长:学号:成绩:2011年6月16日目录任务安排 (3)一、项目介绍 (3)1.1 设计内容 (3)1.2 设计要求 (3)1.3 系统主要功能 (4)二、硬件设计 (4)2.1 原理电路图 (4)2.2主要元件功能说明 (5)三、系统软件设计 (10)3.1 分析论证 (10)3.2 程序流程图 (12)3.3 源程序清单 (13)四、个人心得 (19)五、结束语 (20)六、参考文献 (21)七、12864汉字和图片的显示原理图 (21)任务安排一、项目介绍1.1 设计内容利用单片机和12864液晶显示屏通过按键功能实现汉字和图片的显示1.2 设计要求(1)在12864上第一次显示汉字“安徽财贸职业学院大学城翡翠路900/doc/dd174fd133d4b14e852468a7.ht ml ”(2)在12864上第二次显示汉字“单片机实训周6月11日星期六”(3)第三次显示图片:服装,帽子,鞋,皮包等(4)第四次显示汉字:“这就是我们小组的设计方案谢谢欣赏”1.3系统主要功能:12864LCD指令系统及时序该类液晶显示模块(表1-1)控制信号控制代码指令名称R/W RS DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 显示开关0 0 0 0 1 1 1 1 1 1/0 起始行设置0 0 1 1 X X X X X X 页设置0 0 1 0 1 1 1 X X X 列地址设置0 0 0 1 X X X X X X 读状态 1 0 BUSY 0 ON/OFF RST 0 0 0 0 写数据0 1 写数据读数据 1 1 读数据二、硬件设计2.1 原理电路图12864显示屏(图2-1a)独立按键原理图(图2-1b)2.2主要元件功能说明1)12864显示屏内部功能器件及相关功能如下指令寄存器(IR): IR是用于寄存指令码,与数据寄存器数据相对应。

12864翻页显示汉字源程序

12864翻页显示汉字源程序

12864翻页显示汉字源程序#include#include#define GDM12864ADataPort P1 //LCD数据线sbit DI=P2^2; // 数据\指令选择sbit RW=P2^1; // 读\写选择sbit EN=P2^0; // 读\写使能sbit cs1=P2^4; // 片选1sbit cs2=P2^3; // 片选2sbit UP=P0^0;//定义UPsbit DOWN=P0^1;//定义DOWNsbit TEST=P3^0;//定义DOWNunsigned char i,j,t;static int nxx;int t0,t1,t2,t3,tx,k,k0,k1,k2,k3;//*--------函数列表-------//状态检查void CheckState(){unsigned char dat;DI=0;RW=1;do{GDM12864ADataPort=0x00;EN=1;dat=GDM12864ADataPort;EN=0;dat=0x80 & dat; //仅当第7位为0时才可操作(判别busy信号) }while(!(dat==0x00));}/*-----------------------------------------------------------------------------------------------------*///向LCD发送命令//command :命令SendCommandToLCD(unsigned char command){CheckState();RW=0;GDM12864ADataPort=command;EN=1; EN=0;}/*----------------------------------------------------------------------------------------------------*///写显示数据//dat:显示数据void WriteByte(unsigned char dat){CheckState();DI=1; RW=0;GDM12864ADataPort=dat;EN=1; EN=0;}/*----------------------------------------------------------------------------------------------------*///读显示数据unsigned char ReadByte(){unsigned char dat;CheckState();DI=1; RW=1;GDM12864ADataPort=0xff;EN=1; dat=GDM12864ADataPort; EN=0;return(dat);}/*----------------------------------------------------------------------------------------------------*///设定行地址(页)--X 0-7void SetLine(unsigned char line){line=line & 0x07; // 0<=line<=7line=line|0xb8; //1011 1xxxSendCommandToLCD(line);}/*----------------------------------------------------------------------------------------------------*///设定列地址--Y 0-63void SetColumn(unsigned char column){column=column &0x3f; // 0=<column<=63column=column | 0x40; //01xx xxxxSendCommandToLCD(column);}/*----------------------------------------------------------------------------------------------------*///设定显示开始行--XXvoid SetStartLine(unsigned char startline) //0--63{startline=startline & 0x07;startline=startline|0xc0; //1100 0000SendCommandToLCD(startline);}/*----------------------------------------------------------------------------------------------------*///开关显示void SetOnOff(unsigned char onoff){onoff=0x3e | onoff; //0011 111xSendCommandToLCD(onoff);}/*---------------------------------------------------------------------------------------------------*///选择屏幕//screen: 0-全屏,1-左屏,2-右屏void SelectScreen(unsigned char screen){ //cs1: 1--左; cs2: 1--右switch(screen){ case 0: cs1=0;//全屏_nop_(); _nop_(); _nop_();cs2=0;_nop</column<=63_(); _nop_(); _nop_();break;case 1: cs1=0;//左屏_nop_(); _nop_(); _nop_();cs2=1;_nop_(); _nop_(); _nop_();break;case 2: cs1=1;//右屏_nop_(); _nop_(); _nop_();cs2=0;_nop_(); _nop_(); _nop_();break;}}/*---------------------------------------------------------------------------------------------------*///延时GDM12864delay(){unsigned int i=500;while(i--) {;}}/*---------------------------------------------------------------------------------------------------*///清屏//screen: 0-全屏,1-左屏,2-右void ClearScreen(unsigned char screen){ unsigned char i,j;SelectScreen(screen);for(i=0;i<8;i++){SetLine(i);for(j=0;j<128;j++){WriteByte(0x00);}}}/*---------------------------------------------------------------------------------------------------*///初始化LCDvoid InitLCD(){ unsigned char i=250; //延时while(i--);SelectScreen(0);SetOnOff(0); //关显示//ClearScreen(0);//清屏SelectScreen(0);SetOnOff(1); //开显示SelectScreen(0);SetStartLine(0); //开始行:0}/*----------------------------------------------------------------------------------------------------*//*----------------------------------------------------------------------------------------------*/unsigned char code ASC[]={/*.--0x2E */0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x0C,0x0C,0x00,0x00,0x00,/*'/'--0x2F */0x00,0x00,0x00,0x80,0xC0,0x60,0x30,0x00, 0x0C,0x06,0x03,0x01,0x00,0x00,0x00,0x00,/*0--0x30 */0xF8,0xFC,0x04,0xC4,0x24,0xFC,0xF8,0x00, 0x07,0x0F,0x09,0x08,0x08,0x0F,0x07,0x00,/*1--0x31 */0x00,0x10,0x18,0xFC,0xFC,0x00,0x00,0x00, 0x00,0x08,0x08,0x0F,0x0F,0x08,0x08,0x00,/*2--0x32 */0x08,0x0C,0x84,0xC4,0x64,0x3C,0x18,0x00, 0x0E,0x0F,0x09,0x08,0x08,0x0C,0x0C,0x00,/*3--0x33 */0x08,0x0C,0x44,0x44,0x44,0xFC,0xB8,0x00, 0x04,0x0C,0x08,0x08,0x08,0x0F,0x07,0x00,/*4--0x34 */0xC0,0xE0,0xB0,0x98,0xFC,0xFC,0x80,0x00, 0x00,0x00,0x00,0x08,0x0F,0x0F,0x08,0x00,/*5--0x35 */0x7C,0x7C,0x44,0x44,0xC4,0xC4,0x84,0x00, 0x04,0x0C,0x08,0x08,0x08,0x0F,0x07,0x00,/*6--0x36 */0xF0,0xF8,0x4C,0x44,0x44,0xC0,0x80,0x00,0x07,0x0F,0x08,0x08,0x08,0x0F,0x07,0x00,/*7--0x37 */0x0C,0x0C,0x04,0x84,0xC4,0x7C,0x3C,0x00,0x00,0x00,0x0F,0x0F,0x00,0x00,0x00,0x00,/*8--0x38 */0xB8,0xFC,0x44,0x44,0x44,0xFC,0xB8,0x00,0x07,0x0F,0x08,0x08,0x08,0x0F,0x07,0x00,/*9--0x39 */0x38,0x7C,0x44,0x44,0x44,0xFC,0xF8,0x00,0x00,0x08,0x08,0x08,0x0C,0x07,0x03,0x00};/*----------------------------------------------------------------------------------------------*/#define CB6AB0x0000 /*东 */#define CC4CF CB6AB+32 /*南 *///从左到右从上到下,纵向8点下高位分粗细体unsigned char code Hztable[]={//" "0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//" "0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //"唐"0x00,0x00,0x00,0xFE,0xFC,0x84,0xA4,0xA4, 0xA5,0xFF,0xFE,0xA4,0xE4,0xF6,0xA4,0x80, 0x00,0x80,0x40,0x3F,0x1F,0xFC,0xFA,0x4A, 0x4A,0x4F,0x4F,0x4A,0xFB,0xFF,0x10,0x00, //0x00,0x00,0xFC,0x44,0x54,0x54,0x54,0x55, //0xFE,0x54,0x54,0x54,0xF6,0x44,0x40,0x00, //0x40,0x30,0x0F,0x00,0xFD,0x45,0x45,0x45, //0x47,0x45,0x45,0x45,0xFD,0x00,0x00,0x00,//"山",0x00,0x00,0xC0,0x80,0x00,0x00,0x00,0x00, 0xFE,0xFC,0x00,0x00,0x00,0x00,0xC0,0x80, 0x00,0x00,0xFF,0x7F,0x20,0x20,0x20,0x20, 0x3F,0x3F,0x20,0x20,0x20,0x20,0xFF,0x7F,//"华",0x00,0x40,0x20,0x30,0xFC,0xF7,0x02,0x80, 0x60,0xFF,0xFE,0x18,0x0E,0xC4,0x00,0x00, 0x00,0x08,0x08,0x08,0x0B,0x09,0x08,0xFE, 0xFE,0x09,0x0B,0x0B,0x0B,0x0B,0x0D,0x08,//"光",0x00,0x00,0x80,0x82,0xBC,0x98,0x80,0xFF, 0xFE,0x80,0xE0,0xB8,0x9E,0xC4,0x80,0x00,0x00,0x80,0x80,0x40,0x60,0x38,0x1F,0x07, 0x00,0x7F,0xFF,0xC0,0xC0,0xC0,0xF0,0x40, //" "0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //" "0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//"自",0x00,0x00,0x00,0xFC,0xF8,0x88,0x8C,0x8F, 0x8A,0x88,0x88,0x88,0xF8,0xFC,0x08,0x00, 0x00,0x00,0x00,0xFF,0x7F,0x44,0x44,0x44, 0x44,0x44,0x44,0x44,0xFF,0x7F,0x00,0x00,//"力",0x00,0x00,0x10,0x10,0x10,0x10,0xFF,0xFE, 0x10,0x10,0x10,0x10,0xF0,0xF8,0x10,0x00, 0x00,0x80,0x40,0x60,0x38,0x1F,0x07,0x00, 0x00,0x40,0x40,0xE0,0x7F,0x1F,0x00,0x00,//"更",0x00,0x02,0x02,0xFE,0xFA,0xAA,0xAA,0xAA, 0xFE,0xFE,0xAA,0xAA,0xFA,0xFE,0x0B,0x02, 0x00,0x80,0x80,0x41,0x41,0x22,0x34,0x1C, 0x0F,0x1B,0x30,0x60,0x61,0xC1,0xC0,0x40,//"生",0x00,0x80,0x60,0x38,0x1E,0x14,0x10,0x10, 0xFF,0xFE,0x10,0x10,0x90,0x18,0x10,0x00, 0x00,0x40,0x40,0x40,0x41,0x41,0x41,0x41, 0x7F,0x7F,0x41,0x41,0x41,0x41,0x60,0x40,//"艰",0x00,0x04,0x34,0xC4,0xE4,0x7E,0x1C,0xFF, 0xFE,0x92,0x92,0x92,0xFE,0xFF,0x02,0x00, 0x00,0x20,0x18,0x0E,0x03,0x1E,0x4C,0xFF, 0x7F,0x61,0x36,0x1C,0x39,0x6E,0xE4,0x40,//"苦",0x00,0x84,0x84,0x84,0x84,0x9F,0x9F,0xE4, 0xE4,0x9F,0x9F,0x84,0x84,0xC6,0x84,0x00, 0x00,0x00,0x00,0xFE,0x7C,0x44,0x44,0x47, 0x47,0x44,0x44,0xFC,0x7E,0x04,0x00,0x00,//"奋",0x00,0x00,0x88,0x88,0xC8,0x68,0x38,0x1F, 0x0E,0x18,0x38,0x68,0x4C,0xC8,0x80,0x80, 0x00,0x01,0x00,0xFF,0xFF,0x49,0x49,0x7F, 0x7F,0x49,0x49,0xFF,0xFF,0x00,0x01,0x00,//"斗",0x00,0x00,0x00,0x20,0xE0,0xC6,0x9C,0x08, 0x00,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x04,0x04,0x04,0x05,0x04,0x04,0x04,0xFF,0x7F,0x02,0x02,0x02,0x03,0x02, //"科",0x00,0x24,0xA4,0xFE,0xFE,0xA3,0x22,0xC0, 0x8C,0x38,0x10,0xFF,0xFE,0x00,0x00,0x00, 0x00,0x0C,0x03,0xFF,0x7F,0x01,0x0B,0x08, 0x0B,0x05,0x04,0xFF,0x7F,0x02,0x03,0x02,//"技",0x00,0x10,0x10,0xFF,0xFE,0x10,0x98,0x48, 0xC8,0x48,0x7F,0x7E,0xC8,0xE8,0x4C,0x08, 0x00,0x0C,0x46,0xFF,0x7F,0x01,0x80,0x40, 0x61,0x37,0x1C,0x1E,0x37,0x61,0xE0,0x40,//"创",0x00,0x80,0x40,0xE0,0xB8,0x9E,0x8F,0x9A, 0xF0,0xA0,0x00,0xF0,0xF0,0x00,0xFF,0xFE, 0x00,0x00,0x00,0x7F,0xFF,0xC0,0xC4,0xCF, 0xE7,0x40,0x00,0x03,0x23,0x40,0xFF,0x7F,//"新",0x00,0x44,0x4C,0x7C,0xD7,0xE6,0x7C,0x5C, 0x44,0xFE,0xFC,0x46,0xC2,0xC3,0x62,0x40, 0x00,0x22,0x1A,0x4E,0xFF,0x7F,0x0E,0x9A, 0x60,0x3F,0x1F,0x00,0xFF,0xFF,0x00,0x00,//"精",0x00,0x26,0xA8,0xFF,0xFE,0xA8,0x66,0x44, 0xD4,0x54,0x7F,0x7E,0x54,0xD6,0x64,0x40, 0x00,0x0C,0x03,0xFF,0x7F,0x01,0x06,0x00, 0xFF,0x7F,0x15,0x55,0xFF,0x7F,0x01,0x00,//"益",0x00,0x08,0x08,0x88,0xC9,0x6E,0x3C,0x18, 0x08,0x1C,0x3E,0x6B,0xCA,0x88,0x8C,0x08, 0x00,0x82,0x81,0xFF,0xFE,0x82,0xFE,0xFE, 0x82,0xFE,0xFE,0x82,0xFE,0xFF,0x83,0x81,//"求",0x00,0x00,0x08,0x68,0xC8,0x88,0x08,0xFF, 0xFE,0x88,0xCB,0x7E,0x2C,0x08,0x00,0x00, 0x00,0x10,0x70,0x38,0x0D,0x26,0x41,0xFF, 0x7F,0x03,0x06,0x1C,0x38,0x70,0x20,0x00,//"精",0x00,0x26,0xA8,0xFF,0xFE,0xA8,0x66,0x44, 0xD4,0x54,0x7F,0x7E,0x54,0xD6,0x64,0x40, 0x00,0x0C,0x03,0xFF,0x7F,0x01,0x06,0x00, 0xFF,0x7F,0x15,0x55,0xFF,0x7F,0x01,0x00, //" "0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //" "0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//"华",0x10,0xFF,0x08,0x04,0x06,0xC0,0x00,0x00, 0x04,0x04,0x04,0x04,0x05,0x04,0x04,0xFF, 0x04,0x04,0x05,0x05,0x05,0x05,0x04,0x00,//"光",0x40,0x40,0x42,0x44,0x58,0xC0,0x40,0x7F, 0x40,0xC0,0x50,0x48,0x46,0x64,0x40,0x00, 0x00,0x80,0x40,0x20,0x18,0x07,0x00,0x00,0x00,0x3F,0x40,0x40,0x40,0x40,0x70,0x00,//"研",0x82,0x42,0xF2,0x4E,0x43,0xC2,0x80,0x82, 0xFE,0x82,0x82,0x82,0xFF,0x82,0x80,0x00, 0x00,0x00,0x3F,0x10,0x10,0x5F,0x20,0x18, 0x07,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,//"发",0x00,0x10,0x18,0x16,0x10,0x90,0xF0,0x9F, 0x90,0x90,0x92,0x94,0x10,0x18,0x10,0x00, 0x40,0x20,0x90,0x88,0x46,0x41,0x23,0x14, 0x08,0x14,0x22,0x21,0x40,0xC0,0x40,0x00,//"所",0x00,0x00,0xFC,0x24,0x24,0x22,0xE3,0x02, 0xFC,0x44,0x44,0x42,0xC3,0x62,0x40,0x00, 0x40,0x20,0x1F,0x02,0x02,0x42,0x27,0x10, 0x0F,0x00,0x00,0x00,0xFF,0x00,0x00,0x00, //" "0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/*--------------------------------------------------------------------------------------------------*///显示8*8点阵//旋转90度:字模被竖着切分//lin:行(0-7), column: 列(0-15)//address : 字模区首地址void Show88(unsigned char lin,unsigned char column,unsigned int address){ unsigned char i;if(column>16) {return;}if(column<8) SelectScreen(1); //如果列数<8(0,1,2,3,4,5,6,7)则写在第一屏上else {SelectScreen(2); //否则 (8,9,10,11,12,13,14,15)写在第二屏上column=column & 0x07; //防止越界}SetLine(lin);SetColumn(column<<3);for(i=0;i<8;i++) WriteByte(ASC[address+i]);}void Show88hz(unsigned char lin,unsigned char column,unsigned int address){ unsigned char i;if(column>16) {return;}if(column<8) SelectScreen(1); //如果列数<8(0,1,2,3,4,5,6,7)则写在第一屏上else {SelectScreen(2); //否则 (8,9,10,11,12,13,14,15)写在第二屏上column=column & 0x07; //防止越界}SetLine(lin);SetColumn(column<<3);for(i=0;i<8;i++) WriteByte(Hztable[address+i]);}/*------------------------------------------------------------------------------------------------*///显示8*16字符//旋转90度:字模被竖着切分//lin:行(0-3), column: 列(0-15)//character:字符代码(标准ASCII码)void ShowChar(unsigned char lin,unsigned char column,unsigned char character){ lin=lin<<1;//一个字符占两页Show88(lin ,column, character*16 );Show88(lin+1,column,character*16+8 );}/*----------------------------------------------------------------------------------------------*///显示一个汉字//旋转90度:字模被竖着切分//lin:行(0-3), column: 列(0-7)//hzcode: 汉字代码(自定义的)//uchar code HZtablevoid ShowHZ(unsigned char lin,unsigned char column,unsigned int hzcode){lin=lin<<1; //lin*2,一个汉字占两页Show88hz(lin,column,hzcode*32);Show88hz(lin,column+1,hzcode*32+8);Show88hz(lin+1,column,hzcode*32+16);Show88hz(lin+1,column+1,hzcode*32+24);}/*----------------------------------------------------------------------------------------------*///演示主程序void main(){int a;a=1;k0=0;k1=1;k2=2;k3=3;GDM12864delay();//等待设备准备调用延时InitLCD();//初始化LCDSetLine(0);SetColumn(0);SetStartLine(0);ClearScreen(0);//清屏while(a){for(t0=0;t0<8;t0++){ShowHZ(k0,t0<<1,t0); //显示}for(t1=8;t1<16;t1++){ShowHZ(k1,(t1-8)<<1,t1);//显示}for(t2=16;t2<24;t2++){ShowHZ(k2,(t2-16)<<1,t2);//显示}for(t3=24;t3<32;t3++){ShowHZ(k3,(t3-24)<<1,t3);//显示}if (UP==0){TEST=0;k=k0;k0=k1;k1=k2;k2=k3;k3=k;TEST=1;}if (DOWN==0) {TEST=0;k=k3;k3=k2;k2=k1;k1=k0;k0=k;TEST=1;}}}。

矩阵键盘控制12864显示最经典程序

矩阵键盘控制12864显示最经典程序

矩阵键盘控制12864显示最经典程序#include //这个程序的功能:用4*4的矩阵键盘(接P3口)按键盘k1——k16中的任何一个键ki#include //12864液晶上显示数字i-1 (液晶数据口接P0)#define uint unsigned int//键盘扫描的思想是将行设置为低,列设置为高,来读取P3口的值,就能知道是哪个按键按下了#define uchar unsigned char#define LCDdata P0sbit E = P2^7;sbit RW = P2^6;sbit RS = P2^5;void init();void delayms(uint x);void displaykey();void write_com(uchar com);//写命令void write_data(uchar date);//写数据uchar temp;//--------------主函数-----------------void main(){init();// P3=0xfe;//P3=0xfd;//P3=0xfb;//P3=0xf7;while(1){displaykey();}}//-------------液晶初始化----------------void init(){write_com(0x01);write_com(0x02);write_com(0x06);write_com(0x0e);}//------------毫秒延时--------------- void delayms(uint x){uchar i;while(x--){for(i=0;i<120;i++);}}//------------写命令----------------- void write_com(uchar com){RS = 0;RW = 0;E = 0;LCDdata = com;E = 1;delayms(5);E = 0;}//-------------写数据------------------ void write_data(uchar date){RS = 1;RW = 0;E = 0;LCDdata = date;E = 1;delayms(5);E = 0;}//----void displaykey(){ //****************************判断第一行的键盘P3=0xfe; temp=P3; temp=temp&0xf0;while(temp!=0xf0)//判断是否有键盘按下为真有键盘按下{ delayms(50); temp=P3; temp=temp&0xf0;while(temp!=0xf0)//再次判断是否有键盘按下为真有键盘按下{ temp=P3;switch(temp){case0xee:write_com(0x80);write_data('0');write_com(0x81);write_data (' ');break;case0xde:write_com(0x80);write_data('1');write_com(0x81);write_data (' ');break;case0xbe:write_com(0x80);write_data('2');write_com(0x81);write_data (' ');break;case0x7e:write_com(0x80);write_data('3');write_com(0x81);write_data (' ');break;}break;//这个break很重要不能丢下,若丢下会这这个中退步出来}}//******************************判断第二行的键盘P3=0xfd; temp=P3; temp=temp&0xf0;while(temp!=0xf0){ delayms(50); temp=P3; temp=temp&0xf0;while(temp!=0xf0){ temp=P3;switch(temp){case0xed:write_com(0x80);write_data('4');write_com(0x81);write_data (' ');break;case0xdd:write_com(0x80);write_data('5');write_com(0x81);write_data (' ');break;case0xbd:write_com(0x80);write_data('6');write_com(0x81);write_data (' ');break;case0x7d:write_com(0x80);write_data('7');write_com(0x81);write_data (' ');break;} break;}}//******************************判断第三行的键盘P3=0xfb; temp=P3; temp=temp&0xf0;while(temp!=0xf0){ delayms(50); temp=P3; temp=temp&0xf0;while(temp!=0xf0){ temp=P3;switch(temp){case0xeb:write_com(0x80);write_data('8');write_com(0x81);write_data (' ');break;case0xdb:write_com(0x80);write_data('9');write_com(0x81);write_data (' ');break;case0xbb:write_com(0x80);write_data('1');write_com(0x81);write_ data('0');break;case0x7b:write_com(0x80);write_data('1');write_com(0x81);write_ data('1');break;}break;}}//******************************判断第四行的键盘P3=0xf7; temp=P3; temp=temp&0xf0;while(temp!=0xf0){ delayms(50); temp=P3; temp=temp&0xf0;while(temp!=0xf0){ temp=P3;switch(temp){case0xe7:write_com(0x80);write_data('1');write_com(0x81);write_ data('2');break;case0xd7:write_com(0x80);write_data('1');write_com(0x81);write_ data('3');break;case0xb7:write_com(0x80);write_data('1');write_com(0x81);write_ data('4');break;case0x77:write_com(0x80);write_data('1');write_com(0x81);write_ data('5');break;}break;}}}。

液晶显示12864程序(调试通过)

液晶显示12864程序(调试通过)
0x00,0x00,0x07,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x1F,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x38,0x0E,0x01,0xFF,0x1F,0xF8,0x00,0x07,0xFE,0x03,0xF8,0x00,0xFF,0xFF,0x00,
0x00,0x3C,0x06,0x01,0xFC,0x1F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0xFF,0xFF,0xC0,0x00,0x00,0x0F,0xFF,0xFF,0xF0,0x00,0x00,0x1F,
0xFF,0xFF,0xFE,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0x00,0x00,0x7F,0xFF,0xF8,0x07,0x80,
0x00,0x00,0x3F,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x7F,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7F,0xF8,0x07,0x80,0x3F,0x01,0xFF,0xF0,0x07,0xE0,0x00,0x07,0xFF,0xF0,0x03,0xF0,
0x00,0x1F,0xFF,0xE0,0x01,0xFF,0x03,0xFF,0xFF,0xC0,0x01,0xFF,0xFF,0xFF,0xFF,0xC0,

带字库12864液晶详解

带字库12864液晶详解

12864液晶一、概述带中文字库的128X64是一种具有4位/8位并行、2线或3线串行多种接口方式,内部含有国标一级、二级简体中文字库的点阵图形液晶显示模块;其显示分辨率为128×64,内置8192个16*16点汉字,和128个16*8点ASCII字符集.利用该模块灵活的接口方式和简单、方便的操作指令,可构成全中文人机交互图形界面。

可以显示8×4行16×16点阵的汉字.也可完成图形显示.低电压低功耗是其又一显著特点。

由该模块构成的液晶显示方案与同类型的图形点阵液晶显示模块相比,不论硬件电路结构或显示程序都要简洁得多,且该模块的价格也略低于相同点阵的图形液晶模块。

基本特性:l 低电源电压(VDD:+3.0--+5.5V)l 显示分辨率:128×64点l 内置汉字字库,提供8192个16×16点阵汉字(简繁体可选)l 内置128个16×8点阵字符l 2MHZ时钟频率l 显示方式:STN、半透、正显l 驱动方式:1/32DUTY,1/5BIASl 视角方向:6点l 背光方式:侧部高亮白色LED,功耗仅为普通LED的1/5—1/10l 通讯方式:串行、并口可选l 内置DC-DC转换电路,无需外加负压l 无需片选信号,简化软件设计l 工作温度: 0℃ - +55℃ ,存储温度: -20℃ - +60℃模块接口说明*注释1:如在实际应用中仅使用串口通讯模式,可将PSB接固定低电平,也可以将模块上的J8和“GND”用焊锡短接。

*注释2:模块内部接有上电复位电路,因此在不需要经常复位的场合可将该端悬空。

*注释3:如背光和模块共用一个电源,可以将模块上的JA、JK用焊锡短接。

2.2并行接口管脚号管脚名称电平管脚功能描述1VSS0V电源地2VCC 3.0+5V电源正3V0-对比度(亮度)调整4RS(CS)H/LRS=“H”,表示DB7——DB0为显示数据RS=“L”,表示DB7——DB0为显示指令数据5R/W(SID)H/L R/W=“H”,E=“H”,数据被读到DB7——DB0R/W=“L”,E=“H→L”, DB7——DB0的数据被写到IR或DR6E(SCLK)H/L使能信号7DB0H/L三态数据线8DB1H/L三态数据线9DB2H/L三态数据线10DB3H/L三态数据线11DB4H/L三态数据线12DB5H/L三态数据线13DB6H/L三态数据线14DB7H/L三态数据线15PSB H/L H:8位或4位并口方式,L:串口方式(见注释1)16NC-空脚17/RESET H/L复位端,低电平有效(见注释2)18VOUT-LCD驱动电压输出端19A VDD背光源正端(+5V)(见注释3)20K VSS背光源负端(见注释3)*注释1:如在实际应用中仅使用并口通讯模式,可将PSB接固定高电平,也可以将模块上的J8和“VCC”用焊锡短接。

12864液晶屏显示时间,加按键,加界面切换

12864液晶屏显示时间,加按键,加界面切换

/////////////////////////////////////////////////////程序编写人:小艾//程序编写时间:2012-5-16//程序实现的功能:12864的显示,汇编//////////////////////////////////////////////////////// AIXING EQU 41HAIXING1 EQU 42HSECOND EQU 43HMINUTE EQU 44HHOUR EQU 45HMINUTE1 EQU 46HHOUR1 EQU 47HMINUTE2 EQU 48HHOUR2 EQU 49HMINUTE3 EQU 4AHHOUR3 EQU 4BHMINUTE4 EQU 4CHHOUR4 EQU 4DHCSA EQU P3.2CSB EQU P3.3RS EQU P3.6RW EQU P3.5E EQU P3.4OUTPUT EQU P2COM EQU 2CHDAT EQU 2DHCODES EQU 2Ehcolumn EQU 24Hpagef EQU 25hcpage EQU 26Hccolumn E QU 27Hcolumn2 EQU 28Hpagef2 EQU 29hcpage2 EQU 2aHccolumn2 EQU 2bHCOUNT EQU 60HCOUNT1 EQU 61H//COUNT2 EQU 62H//COUNT3 EQU 63HCOUNT4 EQU 64HCOUNT5 EQU 65Hcolumn1 EQU 30H pagef1 EQU 31h cpage1 EQU 32H ccolumn1 EQU 33H column3 EQU 34H pagef3 EQU 35h cpage3 EQU 36H ccolumn3 EQU 37HSHUJI1 EQU 50H SHUJI2 EQU 51H SHUJI3 EQU 52H SHUJI4 EQU 53H SHUJI5 EQU 54H SHUJI6 EQU 55H SHUJI7 EQU 56H SHUJI8 EQU 57H SHUJI9 EQU 58H SHUJI10 EQU 59H SHUJI11 EQU 5AH SHUJI12 EQU 5BH SHUJI13 EQU 5CH SHUJI14 EQU 5DH SHUJI15 EQU 5EH SHUJI16 EQU 38H SHUJI17 EQU 39H SHUJI18 EQU 3AH SHUJI19 EQU 3BH SHUJI20 EQU 3CH SHUJI21 EQU 3DH SHUJI22 EQU 3EHKEY1 BIT P1.1 KEY2 BIT P1.2 KEY3 BIT P1.3 KEY4 BIT P1.4 KEY5 BIT P1.5 KEY6 BIT P1.6 BT0 BIT 20H.0 BT1 BIT 20H.1 BT2 BIT 20H.2 BT3 BIT 20H.3 BT4 BIT 20H.4 BT5 BIT 20H.5BT6 BIT 20H.6BT7 BIT 20H.7BT8 BIT 21H.0BT9 BIT 21H.1BT10 BIT 21H.2BT11 BIT 21H.3BT12 BIT 21H.4BT13 BIT 21H.5/////////////////////////////////////////////////ORG 0000HLJMP STARTORG 000BHLJMP INTP0ORG 0030H;*********************************************主程序开始START: MOV TMOD,#01HMOV TH0,#(65536-50000) / 256MOV TL0,#(65536-50000) MOD 256SETB EASETB ET0SETB TR0LCALL CLEARLCALL INT ;调用初始化子程序/////////////////////////////////////////////////////MAIN: LCALL KEYSCAN1JB BT7,MAIN1MAIN4: LCALL CLEAR ;调用清屏子程序LCALL DISPLAY1LCALL KKKLCALL DISPLAYLCALL DISPLAY5LCALL DISPLAY6MAIN2: LCALL KKKLCALL DISPLAYLCALL KEYSCAN1JB BT7,MAIN1LJMP MAIN2MAIN1: LCALL CLEAR ;调用清屏子程序MAIN3: LCALL DISPLAY2LCALL DISPLAY3LCALL KEYSCAN1JB BT7,MAIN3LJMP MAIN4////////////////////////////////////////////////////////DISPLAY3:LCALL CHULI1MOV A,COUNT4CJNE A,#0,DISPLAY4RET//////////////////////////////////////////////////// DISPLAY4:CLR COUNT1CLR ALCALL CHULI1MOV A,COUNT4CJNE A,#1,PLAY1LCALL CLEARQQ1: LCALL KKKLCALL KEYSCANLCALL KEYCHULI1LCALL KEYCHULI11LCALL KEYCHULI2LCALL KEYCHULI21LCALL DISPLAYMOV COM,#00HLCALL PRR0LCALL PRM0LCALL CHULI1MOV A,COUNT4CJNE A,#1,PLAY1AJMP QQ1PLAY1: CLR AMOV COUNT1,#0MOV A,COUNT4CJNE A,#2,PLAY2LCALL CLEARQQ2: CLR ALCALL CHULI2MOV A,COUNT5CJNE A,#0,CHULCALL KEYSCANLCALL KEYCHU1LCALL KEYCHU11LCALL KEYCHU5LCALL KEYCHU51LCALL DISPLAY5MOV COM,#00HLCALL PRR0LCALL PRM0LCALL CHULI1CLR AMOV A,COUNT4CJNE A,#2,PLAY2LJMP QQ2 CHU: CLR AMOV A,COUNT5CJNE A,#1,PLAY3LCALL KEYSCANLCALL KEYCHU2LCALL KEYCHU21LCALL KEYCHU6LCALL KEYCHU61LCALL DISPLAY5MOV COM,#00HLCALL PRR0LCALL PRM0LCALL CHULI1CLR AMOV A,COUNT4CJNE A,#2,PLAY2LJMP QQ2///////////////////////////////////////////////// PLAY2: MOV COUNT5,#0CLR AMOV A,COUNT4CJNE A,#3,PLAY3LCALL CLEARQQ3: CLR ALCALL CHULI2MOV A,COUNT5CJNE A,#0,CHU1LCALL KEYSCANLCALL KEYCHU3LCALL KEYCHU31LCALL KEYCHU7LCALL KEYCHU71LCALL DISPLAY6CLR ALCALL CHULI1MOV A,COUNT4CJNE A,#3,PLAY2LJMP QQ3CHU1: CLR AMOV A,COUNT5CJNE A,#1,PLAY3LCALL KEYSCANLCALL KEYCHU4LCALL KEYCHU41LCALL KEYCHU8LCALL KEYCHU81LCALL DISPLAY6LCALL CHULI1CLR AMOV A,COUNT4CJNE A,#3,PLAY3LJMP QQ3PLAY3: LCALL CLEARMOV COUNT4,#0MOV COUNT5,#0RET////////////////显示“菜”/////////////////////////////////// DISPLAY2:MOV CODES,#0MOV column1,#16MOV pagef1,#0MOV CODES,#14CALL writeleft1///////////////////显示“单”////////////////////////////// MOV CODES,#0MOV column3,#00MOV pagef3,#0MOV CODES,#15CALL writeright1/////////////////显示“时”//////////////////////////////MOV CODES,#0MOV column1,#16MOV pagef1,#2MOV CODES,#16CALL writeleft1/////////////////显示“钟”/////////////////////////////// MOV CODES,#0MOV column1,#32MOV pagef1,#2MOV CODES,#17CALL writeleft1/////////////////显示“设”//////////////////////////////MOV column1,#48MOV pagef1,#2MOV CODES,#22CALL writeleft1/////////////////显示“定”/////////////////////////////// MOV CODES,#0MOV column3,#00MOV pagef3,#2MOV CODES,#23CALL writeright1/////////////////显示“开”////////////////////////////// MOV CODES,#0MOV column1,#16MOV pagef1,#4MOV CODES,#18CALL writeleft1/////////////////显示“关”/////////////////////////////// MOV CODES,#0MOV column1,#32MOV pagef1,#4MOV CODES,#19CALL writeleft1/////////////////显示“设”////////////////////////////// MOV CODES,#0MOV column1,#48MOV pagef1,#4MOV CODES,#22CALL writeleft1/////////////////显示“定”/////////////////////////////// MOV CODES,#0MOV column3,#00MOV pagef3,#4MOV CODES,#23CALL writeright1/////////////////显示“调”////////////////////////////// MOV CODES,#0MOV column1,#16MOV pagef1,#6MOV CODES,#20CALL writeleft1/////////////////显示“光”/////////////////////////////// MOV CODES,#0MOV pagef1,#6MOV CODES,#21CALL writeleft1/////////////////显示“设”//////////////////////////////MOV CODES,#0MOV column1,#48MOV pagef1,#6MOV CODES,#22CALL writeleft1/////////////////显示“定”///////////////////////////////MOV CODES,#0MOV column3,#00MOV pagef3,#6MOV CODES,#23CALL writeright1LJMP BB///////////////////显示“星”///////////////////////////// DISPLAY1:MOV CODES,#0MOV column1,#00MOV pagef1,#0MOV CODES,#0lcall writeleft1//////////////////显示“梦”////////////////////////////////// MOV CODES,#0MOV column1,#16MOV pagef1,#0MOV CODES,#1CALL writeleft1//////////////////显示“奕”/////////////////////////////MOV CODES,#0MOV column1,#32MOV pagef1,#0MOV CODES,#2CALL writeleft1////////////////显示“缘”/////////////////////////////MOV CODES,#0MOV column1,#48MOV pagef1,#0MOV CODES,#3CALL writeleft1LJMP BB/////////////////显示“time”////////////////////////////KKK: MOV CODES,#0MOV column,#00MOV pagef,#2MOV CODES,#13CALL writeleftMOV CODES,#0MOV column,#8MOV pagef,#2MOV CODES,#14CALL writeleftMOV CODES,#0MOV column,#16MOV pagef,#2MOV CODES,#15CALL writeleftMOV CODES,#0MOV column,#24MOV pagef,#2MOV CODES,#16CALL writeleftMOV CODES,#0MOV column,#32MOV pagef,#2 ;显示:MOV CODES,#11CALL writeleftRET///////////////“L1开”///////////////////////////////////// DISPLAY5: MOV C ODES,#0MOV column1,#00MOV pagef1,#4MOV CODES,#11CALL writeleft1MOV CODES,#0MOV column,#8MOV pagef,#4MOV CODES,#1CALL writeleftMOV CODES,#0MOV column,#16MOV pagef,#4 ;显示:MOV CODES,#11CALL writeleftMOV CODES,#0MOV SHUJI7,#0CLR AMOV A,MINUTE1MOV B,#10DIV ABMOV A,BMOV SHUJI7,AMOV column,#56MOV pagef,#4MOV CODES,SHUJI7 ;分低位CALL writeleftMOV CODES,#0MOV SHUJI8,#0MOV CODES,#0CLR AMOV A,MINUTE1MOV B,#10DIV ABMOV SHUJI8,AMOV column,#48MOV pagef,#4MOV CODES,SHUJI8 ;分高位CALL writeleftMOV CODES,#0MOV column,#40MOV pagef,#4 ;显示:MOV CODES,#11CALL writeleftMOV CODES,#0MOV SHUJI9,#0CLR AMOV A,HOUR1MOV B,#10DIV ABMOV A,BMOV SHUJI9,Amov column,#32mov pagef,#4MOV CODES,SHUJI9 ;时低位lcall writeleftMOV CODES,#0MOV SHUJI10,#0MOV CODES,#0CLR AMOV A,HOUR1MOV B,#10DIV ABMOV SHUJI10,AMOV column,#24MOV pagef,#4MOV CODES,SHUJI10 ;时高位CALL writeleft///////////////L1关/////////////////////////MOV CODES,#0MOV column3,#48MOV pagef3,#4MOV CODES,#10CALL writeright1MOV CODES,#0MOV SHUJI11,#0CLR AMOV A,MINUTE2MOV B,#10DIV ABMOV A,BMOV SHUJI11,AMOV column2,#40MOV pagef2,#4MOV CODES,SHUJI11 ;分低位CALL writerightMOV CODES,#0MOV SHUJI12,#0MOV CODES,#0CLR AMOV A,MINUTE2MOV B,#10DIV ABMOV SHUJI12,AMOV column2,#32MOV pagef2,#4MOV CODES,SHUJI12 ;分高位CALL writerightMOV CODES,#0MOV column2,#24MOV pagef2,#4 ;显示:MOV CODES,#11CALL writerightMOV CODES,#0MOV SHUJI13,#0CLR AMOV A,HOUR2MOV B,#10DIV ABMOV A,BMOV SHUJI13,Amov column2,#16mov pagef2,#4MOV CODES,SHUJI13 ;时低位CALL writerightMOV CODES,#0MOV SHUJI14,#0MOV CODES,#0CLR AMOV A,HOUR2MOV B,#10DIV ABMOV SHUJI14,AMOV column2,#8MOV pagef2,#4MOV CODES,SHUJI14 ;时高位CALL writerightMOV CODES,#0MOV column2,#00MOV pagef2,#4MOV CODES,#12 ;时高位CALL writerightLJMP BB///////////////“L2开”/////////////////////////////////////DISPLAY6: MOV CODES,#0MOV column1,#00MOV pagef1,#6MOV CODES,#11CALL writeleft1MOV CODES,#0MOV column,#8MOV pagef,#6MOV CODES,#2CALL writeleftMOV CODES,#0MOV column,#16MOV pagef,#6 ;显示:MOV CODES,#11CALL writeleftMOV CODES,#0MOV SHUJI15,#0CLR AMOV A,MINUTE3MOV B,#10DIV ABMOV A,BMOV SHUJI15,AMOV column,#56MOV pagef,#6MOV CODES,SHUJI15 ;分低位CALL writeleftMOV SHUJI16,#0MOV CODES,#0CLR AMOV A,MINUTE3MOV B,#10DIV ABMOV SHUJI16,AMOV column,#48MOV pagef,#6MOV CODES,SHUJI16 ;分高位CALL writeleftMOV CODES,#0MOV column,#40MOV pagef,#6 ;显示:MOV CODES,#11CALL writeleftMOV CODES,#0MOV SHUJI17,#0CLR AMOV A,HOUR3MOV B,#10DIV ABMOV A,BMOV SHUJI17,Amov column,#32mov pagef,#6MOV CODES,SHUJI17 ;时低位lcall writeleftMOV SHUJI8,#0MOV CODES,#0CLR AMOV A,HOUR3MOV B,#10DIV ABMOV SHUJI18,AMOV column,#24MOV pagef,#6MOV CODES,SHUJI18 ;时高位CALL writeleft///////////////L2关/////////////////////////MOV CODES,#0MOV column3,#48MOV pagef3,#6MOV CODES,#9CALL writeright1MOV CODES,#0MOV SHUJI19,#0CLR AMOV A,MINUTE4MOV B,#10DIV ABMOV A,BMOV SHUJI19,AMOV column2,#40MOV pagef2,#6MOV CODES,SHUJI19 ;分低位CALL writerightMOV SHUJI20,#0MOV CODES,#0CLR AMOV A,MINUTE4MOV B,#10DIV ABMOV SHUJI20,AMOV column2,#32MOV pagef2,#6MOV CODES,SHUJI20 ;分高位CALL writerightMOV CODES,#0MOV column2,#24MOV pagef2,#6 ;显示:MOV CODES,#11CALL writerightMOV CODES,#0MOV SHUJI21,#0CLR AMOV A,HOUR4MOV B,#10DIV ABMOV A,BMOV SHUJI21,Amov column2,#16mov pagef2,#6MOV CODES,SHUJI21 ;时低位CALL writerightMOV SHUJI22,#0MOV CODES,#0CLR AMOV A,HOUR4MOV B,#10DIV ABMOV SHUJI22,AMOV column2,#8MOV pagef2,#6MOV CODES,SHUJI22 ;时高位CALL writerightMOV column2,#00MOV pagef2,#6MOV CODES,#12 ;时高位CALL writerightBB: RET////////////////////////////////////////////////////DISPLAY: MOV CODES,#0MOV SHUJI1,#0CLR AMOV A,SECONDMOV B,#10DIV ABMOV A,BMOV SHUJI1,AMOV column2,#40MOV pagef2,#2MOV CODES,SHUJI1 ;秒低位CALL writerightMOV SHUJI2,#0MOV CODES,#0CLR AMOV A,SECONDMOV B,#10DIV ABMOV SHUJI2,AMOV column2,#32MOV pagef2,#2MOV CODES,SHUJI2 ;秒高位CALL writerightMOV CODES,#0MOV column2,#24MOV pagef2,#2 ;显示:MOV CODES,#11CALL writerightMOV CODES,#0MOV SHUJI3,#0CLR AMOV A,MINUTEMOV B,#10MOV A,BMOV SHUJI3,AMOV column2,#16MOV pagef2,#2MOV CODES,SHUJI3 ;分低位CALL writerightMOV SHUJI4,#0MOV CODES,#0CLR AMOV A,MINUTEMOV B,#10DIV ABMOV SHUJI4,AMOV column2,#8MOV pagef2,#2MOV CODES,SHUJI4 ;分高位CALL writerightMOV CODES,#0MOV column2,#00MOV pagef2,#2 ;显示:MOV CODES,#11CALL writerightMOV CODES,#0MOV SHUJI5,#0CLR AMOV A,HOURMOV B,#10DIV ABMOV A,BMOV SHUJI5,Amov column,#56mov pagef,#2MOV CODES,SHUJI5 ;时低位lcall writeleftMOV SHUJI6,#0MOV CODES,#0CLR AMOV A,HOURMOV B,#10MOV SHUJI6,AMOV column,#48MOV pagef,#2MOV CODES,SHUJI6 ;时高位CALL writeleftRET////////////////////////////////////////////////writeleft1: ; 左半屏写入16*16数字子程序MOV DPTR,#TABLE2PUSH column1MOV cpage1,#2MOV ccolumn1,#0MOV A,pagef1ANL A,#07hORL A,#0b8hMOV COM,ACALL PRM0MOV A,column1ORL A,#40hMOV COM,ACALL PRM0MOV A,CODESMOV B,#32MUL ABADD A,DPLMOV DPL,AMOV A,BADDC A,DPHMOV DPH,AlOOp3: MOV A,#00hMOVC A,@A+DPTRMOV DAT,ACALL PRM1INC ccolumn1MOV A,ccolumn1INC DPTRCJNE A,#16,lOOp3CLR CYDEC cpage1INC pagef1MOV A,cpage1CJNE A,#0,DD1RET//////////////////////////////////////////////DD1: MOV A,pagef1ANL A,#07hORL A,#0b8hMOV COM,ACALL PRM0POP column1MOV A,column1ANL A,#3fhORL A,#40hMOV COM,ACALL PRM0MOV ccolumn1,#0AJMP lOOp3//////////////////////////////////////////////writeright1: ; 右半屏写入16*16数字子程序MOV DPTR,#TABLE2push column3MOV cpage3,#2MOV ccolumn3,#0MOV A,pagef3ANL A,#07hORL A,#0b8hMOV COM,ACALL PRR0MOV A,column3ORL A,#40hMOV COM,ACALL PRR0MOV A,CODESMOV B,#32MUL ABADD A,DPLMOV DPL,AMOV A,BADDC A,DPHMOV DPH,AlOOp4: MOV A,#00hMOVC A,@A+DPTRMOV DAT,ACALL PRR1INC DPTRINC ccolumn3MOV A,ccolumn3CJNE A,#16,lOOp4CLR CYDEC cpage3INC pagef3MOV A,cpage3CJNE A,#0,DD2RET/////////////////////////////////////////////DD2: MOV A,pagef3ANL A,#07hORL A,#0b8hMOV COM,ACALL PRR0POP column3MOV A,column3ANL A,#3fhORL A,#40hMOV COM,ACALL PRR0MOV ccolumn3,#0AJMP lOOp4///////////////////////////////////////////// writeleft: ; 左半屏写入8*16数字子程序MOV DPTR,#TABLE1PUSH columnMOV cpage,#2MOV ccolumn,#0MOV A,pagefANL A,#07hORL A,#0b8hMOV COM,ACALL PRM0MOV A,columnORL A,#40hMOV COM,ACALL PRM0MOV A,CODESMOV B,#16MUL ABADD A,DPLMOV DPL,AMOV A,BADDC A,DPHMOV DPH,A////////////////////////////////////////////////////LOOP1: MOV A,#00hMOVC A,@A+DPTRMOV DAT,ACALL PRM1INC DPTRINC ccolumnMOV A,ccolumnCJNE A,#8,LOOP1CLR CYDEC cpageINC pagefMOV A,cpageCJNE A,#0,DD3RET/////////////////////////////////////DD3: MOV A,pagefANL A,#07hORL A,#0b8hMOV COM,ACALL PRM0POP columnMOV A,columnANL A,#3fhORL A,#40hMOV COM,ACALL PRM0MOV ccolumn,#0AJMP LOOP1//////////////////////////////////////////////// writeright: ; 右半屏写入8*16数字子程序MOV DPTR,#TABLE1PUSH column2MOV cpage2,#2MOV ccolumn2,#0MOV A,pagef2ANL A,#07hORL A,#0b8hMOV COM,ACALL PRR0MOV A,column2ORL A,#40hMOV COM,ACALL PRR0MOV A,CODESMOV B,#16MUL ABADD A,DPLMOV DPL,AMOV A,BADDC A,DPHMOV DPH,A////////////////////////////////////////////////////LOOP: MOV A,#00hMOVC A,@A+DPTRMOV DAT,ACALL PRR1INC DPTRINC ccolumn2MOV A,ccolumn2CJNE A,#8,LOOPCLR CYDEC cpage2INC pagef2MOV A,cpage2CJNE A,#0,DD4RET/////////////////////////////////////DD4: MOV A,pagef2ANL A,#07hORL A,#0b8hMOV COM,ACALL PRR0POP column2MOV A,column2ANL A,#3fhORL A,#40hMOV COM,ACALL PRR0MOV ccolumn2,#0AJMP LOOP//////////////////////////////////////////////PRM0: CALL DECLR CSA ;写指令代码子程序(左)SETB CSBCLR RSCLR RWMOV OUTPUT,COMSETB ECLR ERET///////////////////////////////////////////////PRM1: CALL DECLR CSA ;写显示数据子程序(左)SETB CSBSETB RSCLR RWMOV OUTPUT,DATSETB ECLR ERET////////////////////////////////////////////////PRR0: CALL DECLR CSB ;写指令代码子程序(右)SETB CSACLR RSCLR RWMOV OUTPUT,COMSETB ECLR ERETPRR1: CALL DECLR CSB ;写显示数据子程序(右)SETB CSASETB RSCLR RWMOV OUTPUT,DATSETB ECLR ERET////////////////////////////////////////////DE: MOV R7,#10DEE2: MOV R6,#25DJNZ R6,$DJNZ R7,DEE2RET////////////////////////////////////////////CLEAR: MOV R4,#00H ;清屏子程序CLEAR1: MOV A,R4ORL A,#0B8HMOV COM,ALCALL PRM0LCALL PRR0MOV COM,#40HLCALL PRM0LCALL PRR0MOV R3,#40HCLEAR2: MOV DA T,#00HLCALL PRM1LCALL PRR1DJNZ R3,CLEAR2INC R4CJNE R4,#08H,CLEAR1RET///////////////////////////////////////////////////INT: MOV COM,#0C0H ;初始化子程序,设置显示起始行为第一行LCALL PRM0LCALL PRR0MOV COM,#3FH ;开显示设置LCALL PRM0LCALL PRR0RET////////////////定时器中断子程序////////////////////////////////INTP0: MOV TH0,#(65536-50000) / 256MOV TL0,#(65536-50000) MOD 256INC COUNTMOV A,COUNTCJNE A,#20,LOPMOV COUNT,#0CALL CHULILOP: RETI/////////////////////////////////////////////////CHULI: INC SECONDMOV A,SECONDCJNE A,#60,LOPMOV SECOND,#0INC MINUTEMOV A,MINUTECJNE A,#60,LOPMOV MINUTE,#0INC HOURMOV A,HOURCJNE A,#24,LOPMOV HOUR,#1RETI//////////////////按键处理模式//////////////////////////////// KEYSCAN: JB BT0,K11JB KEY1,K12SETB BT0LJMP K13K12: CLR BT0CLR BT1LJMP K13K11: JB KEY1,K12JB BT1,K13SETB BT1INC COUNT1MOV A,COUNT1CJNE A,#3,K13MOV COUNT1,#0K13: RET////////////////分加/////////////////////////KEYCHULI1:MOV A,COUNT1CJNE A,#1,K23CLR AIXINGMOV AIXING,MINUTECALL KK1MOV MINUTE,AIXINGRETKEYCHU1: MOV A,COUNT1CJNE A,#1,K23CLR AIXINGMOV AIXING,MINUTE1CALL KK1MOV MINUTE1,AIXINGRETKEYCHU2: MOV A,COUNT1CJNE A,#1,K23CLR AIXINGMOV AIXING,MINUTE2CALL KK1MOV MINUTE2,AIXINGRETKEYCHU3: MOV A,COUNT1CJNE A,#1,K23CLR AIXINGMOV AIXING,MINUTE3CALL KK1MOV MINUTE3,AIXINGRETKEYCHU4: MOV A,COUNT1CJNE A,#1,K23CLR AIXINGMOV AIXING,MINUTE4CALL KK1MOV MINUTE4,AIXINGRETKK1: JB BT2,K21JB KEY2,K22SETB BT2LJMP K23K22: CLR BT2CLR BT3LJMP K23K21: JB KEY2,K22JB BT3,K23SETB BT3INC AIXINGMOV A,AIXINGCJNE A,#60,K23MOV AIXING,#0K23: RET//////////////////时加///////////////////////////////// KEYCHULI11:MOV A,COUNT1CJNE A,#1,K33CLR AIXING1MOV AIXING1,HOURCALL KK2MOV HOUR,AIXING1RETKEYCHU11: MOV A,COUNT1CJNE A,#1,K33CLR AIXING1MOV AIXING1,HOUR1CALL KK2MOV HOUR1,AIXING1RETKEYCHU21: MOV A,COUNT1CJNE A,#1,K33CLR AIXING1MOV AIXING1,HOUR2CALL KK2MOV HOUR2,AIXING1RETKEYCHU31: MOV A,COUNT1CJNE A,#1,K33MOV AIXING1,HOUR3CALL KK2MOV HOUR3,AIXING1RETKEYCHU41: MOV A,COUNT1CJNE A,#1,K33CLR AIXING1MOV AIXING1,HOUR4CALL KK2MOV HOUR4,AIXING1RETKK2: JB BT4,K31JB KEY3,K32SETB BT4LJMP K33K32: CLR BT4CLR BT5LJMP K33K31: JB KEY3,K32JB BT5,K33SETB BT5INC AIXING1MOV A,AIXING1CJNE A,#24,K33MOV AIXING1,#0K33: RET/////////////////分减/////////////////////////////// KEYCHULI2:MOV A,COUNT1CJNE A,#2,K43CLR AIXINGMOV AIXING,MINUTECALL KK3MOV MINUTE,AIXINGRETKEYCHU5: MOV A,COUNT1CJNE A,#2,K43CLR AIXINGMOV AIXING,MINUTE1CALL KK3MOV MINUTE1,AIXINGRETKEYCHU6: MOV A,COUNT1CJNE A,#2,K43CLR AIXINGMOV AIXING,MINUTE2CALL KK3MOV MINUTE2,AIXINGRETKEYCHU7: MOV A,COUNT1CJNE A,#2,K43CLR AIXINGMOV AIXING,MINUTE3CALL KK3MOV MINUTE3,AIXINGRETKEYCHU8: MOV A,COUNT1CJNE A,#2,K43CLR AIXINGMOV AIXING,MINUTE4CALL KK3MOV MINUTE4,AIXINGRETKK3: JB BT2,K41JB KEY2,K42SETB BT2LJMP K43K42: CLR BT2CLR BT3LJMP K43K41: JB KEY2,K42JB BT3,K43SETB BT3DEC AIXINGMOV A,AIXINGCJNE A,#0FFH,K43MOV AIXING,#59K43: RET///////////////时减////////////////////////////////// KEYCHULI21:MOV A,COUNT1CJNE A,#2,K53CLR AIXING1MOV AIXING1,HOURMOV HOUR,AIXING1RETKEYCHU51:MOV A,COUNT1CJNE A,#2,K53CLR AIXING1MOV AIXING1,HOUR1CALL KK4MOV HOUR1,AIXING1RETKEYCHU61:MOV A,COUNT1CJNE A,#2,K53CLR AIXING1MOV AIXING1,HOUR2CALL KK4MOV HOUR2,AIXING1RETKEYCHU71:MOV A,COUNT1CJNE A,#2,K53CLR AIXING1MOV AIXING1,HOUR3CALL KK4MOV HOUR3,AIXING1RETKEYCHU81:MOV A,COUNT1CJNE A,#2,K53CLR AIXING1MOV AIXING1,HOUR4CALL KK4MOV HOUR4,AIXING1RETKK4: JB BT4,K51JB KEY3,K52SETB BT4LJMP K53K52: CLR BT4CLR BT5LJMP K53K51: JB KEY3,K52JB BT5,K53DEC AIXING1MOV A,AIXING1CJNE A,#0FFH,K53MOV AIXING1,#23K53: RET////////////////切换模式////////////////////////////////////// KEYSCAN1: JB BT8,K61JB KEY4,K62SETB BT8LJMP K63K62: CLR BT8CLR BT9LJMP K63K61: JB KEY4,K62JB BT9,K63SETB BT9CPL BT7K63: RET///////////////选择模式////////////////////////////////// CHULI1: JB BT10,K71JB KEY5,K72SETB BT10LJMP K73K72: CLR BT10CLR BT11LJMP K73K71: JB KEY5,K72JB BT11,K73SETB BT11INC COUNT4MOV A,COUNT4CJNE A,#5,K73MOV COUNT4,#0K73: RET///////////////选择模式调制////////////////////////////////// CHULI2: JB BT12,K81JB KEY6,K82SETB BT12LJMP K83K82: CLR BT12CLR BT13LJMP K83K81: JB KEY6,K82JB BT13,K83SETB BT13INC COUNT5MOV A,COUNT5CJNE A,#2,K83MOV COUNT5,#0K83: RET;*************************************字模表table1: ;数字字模表DB 0F0h,0F8h, 0Ch,04h,04h,0Ch,0F8h,0F0h,0Fh,1Fh,30h,20h,20h,30h,1Fh,0Fh ;0 /* (8 X 16 , 宋体)*/DB 00h,00h,08h,0F8h,0FCh,00h,00h,00h,00h,00h,20h,3Fh,3Fh,20h,00h,00h ;1 /* (8 X 16 , 宋体)*/DB 30h,38h,0Ch,04h,04h,0Ch,0F8h,0F0h,20h,30h,38h,2Ch,26h,23h,21h,38h ;2 /* (8 X 16 , 宋体)*/DB 10h,18h,0Ch,84h,84h,0CCh,78h,30h,08h,18h,30h,20h,20h,31h,1Fh,0Eh ;3/* (8 X 16 , 宋体)*/DB 00h,0C0h,70h,18h,0FCh,0FEh,00h,00h,07h,05h,04h,24h,3Fh,3Fh,24h,04h ;4 /* (8 X 16 , 宋体)*/DB 0FCh,0FCh,0C4h,44h,44h,0C4h,84h,04h,08h,18h,30h,20h,20h,30h,1Fh,0Fh ;5 /* (8 X 16 , 宋体)*/DB 0F0h,0F8h,8Ch, 44h,44h,0CCh,98h,10h,0Fh,1Fh,30h,20h,20h,30h,1Fh,0Fh ;6 /* (8 X 16 , 宋体)*/DB 1Ch,0Ch,0Ch,0Ch,0CCh,0ECh,3Ch,1Ch,00h,00h,3Ch,3Fh,03h,00h,00h,00h ;7 /* (8 X 16 , 宋体)*/DB 30h,78h,0CCh,84h,84h,0CCh,78h,30h,0Eh,1Fh,31h,20h,20h,31h,1Fh,0Eh ;8 /* (8 X 16 , 宋体)*/DB 0F0h,0F8h,0Ch,04h,04h,0Ch,0F8h,0F0h,08h,19h,33h,22h,22h,33h,1Fh,0Fh ;9 /* (8 X 16 , 宋体)*/DB 0F0h,0F8h,0Ch,04h,04h,0Ch,0F8h,0F0h,0Fh,1Fh,30h,20h,20h,30h,1Fh,0Fh ;10 /* (8 X 16 , 宋体)*/DB 00H ,00H ,00H ,0C0H ,0C0H ,00H, 00H ,00H ,00H ,00H, 00H ,30H ,30H ,00H ,00H ,00H;":",11/* (8 X 16 , 宋体)*/DB 00H, 00H ,00H, 00H, 00H ,00H ,00H ,00H, 00H ,01H, 01H ,01H, 01H ,01H, 01H ,01H;"-",12 /* (8 X 16 , 宋体)*/DB 00H ,80H, 80H ,0E0H ,80H ,80H, 00H, 00H ,00H, 00H ,00H ,1FH, 20H, 20H, 00H ,00H;"t",13/* (8 X 16 , 宋体)*/DB 00H ,80H, 80H ,98H ,00H ,00H ,00H, 00H, 00H ,20H ,20H ,3FH, 20H, 20H ,00H ,00H;"i",14 /* (8 X 16 , 宋体)*/DB 80H, 80H ,80H ,80H ,80H ,00H ,00H ,00H ,20H, 3FH ,00H ,3FH ,00H ,3FH ,20H, 00H;"m",15/* (8 X 16 , 宋体)*/DB 00H ,00H ,80H ,80H, 80H ,00H ,00H ,00H ,00H ,1FH ,22H ,22H ,22H ,13H, 00H ,00H;"e",16 /* (8 X 16 , 宋体)*/table2: ;汉字DB 00H,00H,00H,0BEH,2AH,2AH,2AH,0EAH,2AH,2AH,2AH,2AH,3EH,00H,00H,00H;DB 00H,48H,46H,41H,49H,49H,49H,7FH,49H,49H,49H,49H,49H,41H,40H,00H;"星",0/* (16 X 16 , System )*/DB 40H,44H,24H,14H,0FFH,94H,64H,40H,24H,14H,0FFH,0CH,34H,64H,24H,00H;DB 00H,80H,88H,88H,46H,45H,29H,31H,11H,09H,05H,03H,01H,00H,00H,00H;"梦",1/* (16 X 16 , System )*/DB 40H,44H,24H,94H,44H,3CH,05H,46H,84H,7CH,04H,14H,64H,24H,04H,00H;DB 00H,84H,85H,44H,24H,14H,0CH,07H,0CH,14H,24H,64H,0C4H,44H,04H,00H;"奕",2/* (16 X 16 , System )*/DB 20H,38H,0A7H,62H,10H,20H,0A0H,6CH,6BH,0AAH,2AH,3AH,26H,0A0H,20H,00H;DB 12H,13H,12H,0AH,29H,25H,12H,12H,49H,85H,7FH,02H,0DH,18H,08H,00H;"缘",3/* (16 X 16 , System )*/DB 00H,00H,00H,00H,0FFH,00H,00H,00H,80H,7FH,80H,00H,00H,00H,00H,00H;DB 40H,20H,18H,07H,80H,41H,36H,18H,07H,00H,01H,06H,18H,70H,20H,00H;"从",4/* (16 X 16 , System )*/DB 08H,08H,0C8H,0FFH,48H,88H,08H,00H,0FEH,02H,02H,02H,0FEH,00H,00H,00H;DB 04H,03H,00H,0FFH,00H,41H,30H,0CH,03H,00H,00H,00H,3FH,40H,78H,00H;"机",5/* (16 X 16 , System )*/DB 00H,80H,80H,80H,80H,80H,80H,80H,80H,80H,80H,80H,80H,0C0H,80H,00H;DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H;"一",6/* (16 X 16 , System )*/DB 00H,00H,04H,04H,04H,04H,04H,04H,04H,04H,04H,06H,04H,00H,00H,00H;DB 00H,10H,10H,10H,10H,10H,10H,10H,10H,10H,10H,10H,10H,18H,10H,00H;"二",7/* (16 X 16 , System )*/DB 00h,00h,00h,00h,00h,00h,00h,30h,30h,00h,00h,00h,00h,00h,00h,00h ; ":",8DB 00h,00h,00h,00h,00h,00h,00h,0Ch,0Ch,00h,00h,00h,00h,00h,00h,00h;/* (16 X 16 , 宋体)*/DB00H,82H,82H,82H,0BAH,0AAH,0AAH,0ABH,0AAH,0AAH,0BAH,82H,82H,0C2H,80H,00H; DB 02H,41H,40H,20H,10H,0EH,02H,02H,02H,3EH,40H,40H,42H,41H,70H,00H;"亮",9/* (16 X 16 , 宋体)*/DB 00H,02H,02H,0E2H,02H,02H,82H,7EH,0C2H,02H,82H,42H,33H,02H,00H,00H;DB 00H,40H,21H,10H,08H,06H,01H,00H,00H,03H,0CH,18H,30H,60H,20H,00H;"灭",10/* (16 X 16 , 宋体)*/DB 08H ,0F8H, 08H ,00H, 00H ,00H ,00H ,00H, 00H, 00H ,00H, 00H, 00H ,00H, 00H, 00H;DB 20H ,3FH ,20H ,20H ,20H ,20H, 30H, 00H ,00H ,00H ,00H ,00H ,00H, 00H ,00H, 00H;"L",11/* (16 X 16 , 宋体)*/DB 00H,00H,00H,00H,00H,00H,00H,00H,0FH,00H,10H,80h,16H,80H,16H,80H;DB 10H,80H,0FH,00H,00H,00H,00H,00H,00H,00H,00H,00h,00H,00H,00H,00H;"亮",12"E",12 /* (16 X 16 , 宋体)*/DB 08H ,0F8H ,08H ,08H ,08H ,10H ,0E0H ,00H ,00H ,00H ,00H ,00H ,00H ,00H, 00H,00H; DB20H ,3FH ,20H ,20H ,20H ,10H ,0FH ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H;"D",13/* (16 X 16 , 宋体)*/////////"14-23"////////////////模式选择///////////////////////////////////////DB 02H,02H, 32H ,52H ,92H ,1FH ,32H ,52H ,12H ,1FH ,92H ,52H ,32H ,02H ,02H ,00H;DB 00H,42H, 42H, 22H ,12H ,0AH ,06H ,0FFH ,06H ,0AH ,12H ,32H ,62H ,22H ,02H ,00H;"菜",14/* (16 X 16 , 宋体)*/DB 00H ,00H ,0F8H ,28H ,29H ,2EH ,2AH ,0F8H ,28H ,2CH ,2BH ,2AH ,0F8H ,00H ,00H ,00H; DB 08H ,08H ,0BH ,09H ,09H ,09H ,09H ,0FFH ,09H ,09H ,09H ,09H ,0BH ,08H ,08H ,00H;"单",15/* (16 X 16 , 宋体)*/DB 00H ,0FCH ,44H ,44H ,44H ,0FCH ,10H ,90H ,10H ,10H ,10H ,0FFH ,10H ,10H ,10H ,00H; DB 00H ,07H ,04H ,04H ,04H ,07H ,00H ,00H ,03H ,40H ,80H ,7FH ,00H ,00H ,00H, 00H;"时",16/* (16 X 16 , 宋体)*/DB 40H ,30H, 2CH ,0EBH ,28H ,28H ,00H ,0F8H ,08H ,08H ,0FFH ,08H ,08H ,0F8H ,00H ,00H;DB 01H ,01H ,01H ,0FFH ,41H ,21H ,00H, 01H ,01H ,01H ,0FFH ,01H ,01H ,01H ,00H, 00H;"钟",17/* (16 X 16 , 宋体)*/DB 40H ,42H, 42H ,42H ,42H ,0FEH ,42H ,42H ,42H ,42H ,0FEH ,42H ,42H ,42H, 42H ,00H; DB 00H ,40H ,20H ,10H ,0CH ,03H ,00H ,00H ,00H ,00H ,7FH ,00H ,00H ,00H ,00H ,00H;"开",18/* (16 X 16 , 宋体)*/DB 00H,10H ,10H ,10H ,11H ,1EH ,14H ,0F0H ,10H ,18H ,17H ,12H ,18H, 10H ,00H, 00H;DB 01H,81H ,41H ,21H ,11H ,09H ,05H ,03H ,05H ,09H ,31H ,61H ,0C1H, 41H ,01H ,00H;"关",19/* (16 X 16 , 宋体)*/DB 20H ,21H ,0EEH ,04H ,00H ,00H ,0FFH ,29H ,0A9H, 0BFH ,0A9H ,0A9H ,01H ,0FFH ,00H ,00H;DB 00H ,00H ,1FH ,88H ,44H ,30H ,0FH ,00H ,0FH ,04H ,04H ,4FH ,80H ,7FH ,00H ,00H;"调",20/* (16 X 16 , 宋体)*/DB 00H ,40H ,42H, 44H ,5CH ,0C8H ,40H ,7FH ,40H ,0C0H ,50H ,4EH ,44H ,60H ,40H ,00H; DB 00H, 80H ,40H ,20H ,18H ,07H ,00H ,00H ,00H ,3FH ,40H ,40H ,40H ,40H ,78H ,00H;"光",21/* (16 X 16 , 宋体)*/DB 40H ,41H ,0CEH, 04H ,00H ,80H ,40H ,0BEH ,82H ,82H ,82H ,0BEH ,0C0H,40H ,40H ,00H;DB 00H ,00H ,7FH ,20H ,90H ,80H ,40H ,43H ,2CH ,10H ,10H ,2CH ,43H ,0C0H ,40H, 00H;"设",22/* (16 X 16 , 宋体)*/DB 00H ,10H ,0CH ,0A4H ,24H ,24H ,25H ,0E6H ,24H ,24H, 24H ,24H ,14H, 0CH,04H,00H; DB 40H ,20H ,18H ,07H ,08H ,10H ,20H ,7FH ,42H ,42H, 42H ,42H ,40H,40H ,00H,00H;"定",23/* (16 X 16 , 宋体)*/。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关文档
最新文档