#include <reg51.h>
#define uc unsigned char
#define ui unsigned int
sbit E=P3^4;//使能引脚
sbit RW=P3^3;//读写选择
sbit RS=P3^2;//数据 指令选择
sbit R=P3^1;//左屏选择 这是因为此显示器不带字库
sbit L=P3^0;//右屏选择 且是两个控制器分别控制64*64 组合起来控制128*64
sbit Busy=P2^7;//检测LCD忙信号
uc i,j;
uc code picture1[16][64];
uc code picture2[][64];
void Delay(uc);
void InitLCD(void);
void CheckBusy(void);
void Wcode(uc);
void Wdata(uc);
void Display_pic(uc temp[][64]);
void Clean(void);
void Delay(uc delay)
{
while(delay--)
{
for(i=0;i<120;i++);
}
}
void CheckBusy(void)
{
E=1;//使能LCD
RS=0;//选择指令寄存器
RW=1;//读
P2=0xff;//先进行一次空读,接下来才能读到真正数据
while(!Busy);//等待直到不忙
}
void Wcode(uc cd)
{
CheckBusy();//写命令前检查
E=1;//使能
RW=0;//写
RS=0;//指令寄存器
P2=cd;//要写的指令码
E=1;//下面两句产生下降沿 使得写操作有效
E=0;
}
void Wdata(uc dat)
{
CheckBusy();//读命令前检查
E=1;
RW=0;
RS=1;
P2=dat;
E=1;
E=0;
}
void InitLCD(void)
{
Wcode(0x3f);//开显示
Wcode(0xc0);//设置起始行为第一行
Wcode(0xb8);//页面地址设置第一页
Wcode(0x40);//列地址设置为0
}
void Display_pic(uc temp[][64] )
{
for(i=0;i<8;i++)
{
L=0;R=1;//选择左屏
Wcode(0xb8|i);
Wcode(0x40);//第一列
for(j=0;j<64;j++)
Wdata(temp[2*i][j]);
L=1;R=0;
Wcode(0xb8|i);
Wcode(0x40);
for(j=0;j<64;j++)
Wdata(temp[2*i+1][j]);
}
}
void Clean(void)
{
L=0;R=0;//选择两个屏幕控制器
for(i=0;i<8;i++)//控制页数
{
Wcode(0xb8|i);
Wcode(0x40);//列起始地址设为第一列
for(j=0;j<64;j++)
{
Wdata(0x00);
}
}
}
void main(void)
{
P2=0x00;
InitLCD();
while(1)
{
Clean();
Display_pic(picture1);
Delay(1000);
Clean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0x00,0x00,
0x00,0x00,0x00,0xF0,0xF0,0xF0,0x00,0x00,
0x00,0x00,0xF0,0xF0,0xF0,0x70,0x70,0x70,
0x70,0x70,0x00,0x00,0x00,0x00,0xC0,0xE0,
0xF0,0x70,0x70,0x70,0x70,0x70,0x63,0x03,
0x03,0x03,0x73,0x71,0x71,0x71,0xF1,0xF1,
0xF0,0x70,0x70,0x70,0x70,0x00,0x00,0x00,
0x80,0xC0,0xE0,0xE0,0x70,0x70,0x70,0x70,
0x70,0x70,0x60,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xE0,0xF0,0xF8,0xFC,0xFE,0x7F,
0x3F,0x1F,0x0F,0x07,0x03,0x01,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0F,
0x1F,0x3F,0x7F,0xFE,0xFC,0xF8,0xF0,0xE0,
0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,
0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xFF,0xFF,0xC0,0x00,0x00,0x00,
0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,
0x00,0x00,0xFF,0xFF,0xFF,0x1C,0x1C,0x1C,
0x1C,0x1C,0x00,0x00,0x00,0x01,0x07,0x0F,
0x1C,0x1C,0x18,0x38,0x70,0xF0,0xE0,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,
0xFF,0x00,0x00,0x80,0xC0,0xC0,0x80,0x7C,
0xFF,0xFF,0x81,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,
0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xF0,0xFF,0xFF,0xFF,0xFF,0x1F,0x01,
0x00,0x00,0x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x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07,
0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
0x0F,0x0F,0x07,0x01,0x00,0x00,0x80,0x80,
0xC0,0xF0,0xFF,0xFF,0xFF,0x7F,0x1F,0x00,
0x00,0x01,0x03,0x07,0x07,0x0F,0x1F,0x1F,
0x1F,0x3F,0x3E,0x3E,0x3E,0x7F,0x7F,0x7F,
0x7F,0x7F,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,
0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,
0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,
0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,
0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,
0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,
0x7C,0x7C,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,
0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,
0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,
0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,
0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,
0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,
0x7E,0x3E,0x3E,0x3E,0x
没有合适的资源?快使用搜索试试~ 我知道了~
LCD1602和12864的驱动程序,proteus仿真通过
共42个文件
bak:4个
c:4个
lst:4个
4星 · 超过85%的资源 需积分: 10 21 下载量 159 浏览量
2015-01-03
22:04:19
上传
评论 1
收藏 118KB RAR 举报
温馨提示
LCD1602和12864的驱动程序,proteus仿真通过,需要的可以看看
资源推荐
资源详情
资源评论
收起资源包目录
LCD1602_12864.rar (42个子文件)
LCD1602
Proteus
LCD1602.DSN 69KB
Last Loaded LCD1602.DBK 68KB
LCD1602.PWI 768B
Keil
LCD1602.hex 851B
LCD1602.lnp 47B
LCD1602.LST 5KB
LCD1602 5KB
LCD1602.M51 8KB
LCD1602_uvproj.bak 13KB
STARTUP.LST 14KB
LCD1602.c 2KB
ExtDll.iex 19B
LCD1602.uvopt 65KB
STARTUP.A51 6KB
LCD1602.OBJ 5KB
LCD1602.uvproj 13KB
LCD1602.plg 203B
STARTUP.OBJ 749B
LCD1602_uvopt.bak 66KB
LCD12864
keil
LCD.uvopt 74KB
LCD_显示图片.c 14KB
LCD.OBJ 11KB
LCD-PICTURE.h 6KB
LCD.plg 1KB
STARTUP.LST 14KB
LCD.M51 15KB
LCD_上下滚动显示汉字.c 4KB
ExtDll.iex 19B
LCD_uvproj.bak 13KB
LCD.c 9KB
STARTUP.A51 6KB
LCD.LST 15KB
LCD.hex 8KB
LCD 12KB
LCD-PICTURE2.h 6KB
LCD.uvproj 13KB
LCD_uvopt.bak 74KB
STARTUP.OBJ 749B
LCD.lnp 39B
proteus
Last Loaded LCD.DBK 25KB
LCD.DSN 73KB
LCD.PWI 1KB
共 42 条
- 1
资源评论
- oblivioner2015-05-11程序还行,可是很遗憾还是找不到日常在用的12864的仿真,好像那块液晶没有仿真元件。
河源皮
- 粉丝: 4
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 80632180.jpg
- 李旭国体注入追踪[5.0](1).zip
- semantic.c
- C语言基础-C语言编程基础之Leetcode编程题解之第39题组合总和.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第38题外观数列.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第37题解数独.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第36题有效的数独.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第35题搜索插入位置.zip
- index.wxml
- C语言基础-C语言编程基础之Leetcode编程题解之第33题搜索旋转排序数组.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功