资源简介
单片机驱动,包含文字,液晶19264程序,亲测可用!十分好用
代码片段和文件信息
#include
#include
#include“int/ascii0508x.c“
#include“int/ascii0816x.c“
#include“int/hanzi.c“
#include“int/photo.c“
#define uchar unsigned char
#define uint unsigned int
sbit rs=P2^0;
sbit rw=P2^1;
sbit e=P2^2;
sbit cs1=P2^3;
sbit cs2=P2^4;
sbit cs3=P2^5;
sbit rst=P2^6;
bit flag=0;//控制閃爍的標志位
uchar shifenmiao;
uchar code shuzi[] = // ASCII
{
0xF80xFC0x040xC40x240xFC0xF80x00 // -0-
0x070x0F0x090x080x080x0F0x070x00
0x000x100x180xFC0xFC0x000x000x00 // -1-
0x000x080x080x0F0x0F0x080x080x00
0x080x0C0x840xC40x640x3C0x180x00 // -2-
0x0E0x0F0x090x080x080x0C0x0C0x00
0x080x0C0x440x440x440xFC0xB80x00 // -3-
0x040x0C0x080x080x080x0F0x070x00
0xC00xE00xB00x980xFC0xFC0x800x00 // -4-
0x000x000x000x080x0F0x0F0x080x00
0x7C0x7C0x440x440xC40xC40x840x00 // -5-
0x040x0C0x080x080x080x0F0x070x00
0xF00xF80x4C0x440x440xC00x800x00 // -6-
0x070x0F0x080x080x080x0F0x070x00
0x0C0x0C0x040x840xC40x7C0x3C0x00 // -7-
0x000x000x0F0x0F0x000x000x000x00
0xB80xFC0x440x440x440xFC0xB80x00 // -8-
0x070x0F0x080x080x080x0F0x070x00
0x380x7C0x440x440x440xFC0xF80x00 // -9-
0x000x080x080x080x0C0x070x030x00
};
uchar code dian[] = // ASCII
{
0x000x000x000x300x300x000x000x00 // -:-
0x000x000x000x060x060x000x000x00
};
// Delay microsecond less than 255us
void delayUs(uchar Tus)
{
// If Tus >= 18 the delay is precise otherwise not!
if (Tus > 17)
{
Tus = Tus/2 - 9;
if (Tus != 0)
while(--Tus != 0);
}
}
// Delay Tms ms
void delayMs(uint Tms)
{
uint i;
while(Tms-- != 0)
{
i = 4;
while(i-- != 0)
delayUs(250);
}
}
void delay(uchar com)
{
while(com--);
}
//----------LCD写时序------------------
void write_cd(uchar cduchar com)
{
e=0;
rw=0;
rs=cd;
P0=com;
delay(2);
e=1;
// delay(2);
e=0;
// delayUs(2);
}
void chip1(uchar puchar com) //设置芯片面1送数据/命令
{
cs1=0;
cs2=1;
cs3=1;
write_cd(pcom);
}
void chip2(uchar puchar com) //设置芯片面2送数据/命令
{
cs1=1;
cs2=0;
cs3=1;
write_cd(pcom);
}
void chip3(uchar puchar com) //设置芯片面2送数据/命令
{
cs1=1;
cs2=1;
cs3=0;
write_cd(pcom);
}
//--------------------设置页地址------------------------------
void setPA(uchar pageadd)
{
chip1(00xb8+pageadd);
chip2(00xb8+pageadd);
chip3(00xb8+pageadd);
}
//--------------------设置列地址------------------------------
void setCA(uchar clumadd)
{
uchar tempCA;
tempCA=clumadd;
if(clumadd>127)
{
clumadd-=128;
}
if(clumadd>63)
{
clumadd-=64;
}
chip1(00x40+clumadd);
chip2(00x40+clumadd);
chip3(00x40+clumadd);
if(tempCA>127)
{
cs1=1;
cs2=1;
cs3=0;
}
else if(tempCA>64)
{
cs1=1;
cs2=2;
cs3
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 28447 2013-07-02 10:49 CH19264A\clip.h
文件 830 2013-07-02 07:02 CH19264A\int\128x32点的图片.bmp
文件 3904 2013-06-23 19:23 CH19264A\int\ascii0508x.c
文件 9564 2013-06-23 23:25 CH19264A\int\ascii0816x.c
文件 2994 2013-07-02 06:48 CH19264A\int\hanzi.c
文件 3974 2013-07-02 07:03 CH19264A\int\photo.c
文件 25960 2013-07-02 10:49 CH19264A\s6b0108
文件 10514 2013-07-02 10:44 CH19264A\s6b0108.c
文件 16558 2013-07-02 10:49 CH19264A\s6b0108.hex
文件 46 2013-07-02 10:49 CH19264A\s6b0108.lnp
文件 22535 2013-07-02 10:49 CH19264A\s6b0108.LST
文件 30938 2013-07-02 10:49 CH19264A\s6b0108.M51
文件 31568 2013-07-02 10:49 CH19264A\s6b0108.OBJ
文件 2342 2013-07-02 10:49 CH19264A\s6b0108.Opt
文件 380 2013-07-02 10:49 CH19264A\s6b0108.plg
文件 2003 2013-07-02 10:48 CH19264A\s6b0108.Uv2
....... 2348 2013-07-02 10:49 CH19264A\s6b0108_Opt.Bak
文件 2003 2013-07-02 10:45 CH19264A\s6b0108_Uv2.Bak
文件 5115 2002-04-16 15:32 CH19264A\STARTUP.A51
文件 11799 2009-11-11 17:12 CH19264A\STARTUP.lst
文件 924 2009-11-11 17:12 CH19264A\STARTUP.obj
目录 0 2013-07-02 10:46 CH19264A\int
目录 0 2013-07-02 10:49 CH19264A
----------- --------- ---------- ----- ----
214746 23
评论
共有 条评论