本文包含原理图、PCB、源代码、封装库、中英文PDF等资源
您需要 登录 才可以下载或查看,没有账号?注册会员
×
请各位帮我看看 为什么我的12864不能显示图片 非常感谢了
#include<reg52.h>
#include"delay.h"
sbit RS=P2^6;
sbit RW=P2^5;
sbit E=P2^7;
sbit PSB=P3^4;
uchar i,j,k;
uchar code image[] ={
0x00,0x00,0x00,0x04,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,0x01,0x3F,0xC0,
0x80,0x42,0x04,0x20,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x8A,0x1F,
0xFC,0x42,0x04,0xF8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,
0x01,0xFF,0xDE,0x88,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x01,0x2A,0x87,
0xF0,0xA2,0x0A,0xF8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0x84,
0x10,0xA2,0x0A,0x88,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x1F,
0xFC,0xA2,0x0A,0xF8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x9F,0x90,
0x05,0x2F,0xCA,0xA4,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x03,
0xE1,0xA8,0x4A,0xA8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0xC2,
0x24,0x48,0x44,0x90,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x92,0x84,
0x24,0xA8,0x4A,0xA8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xA6,0x58,
0x3D,0x0F,0xD0,0xC4,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1C,0xFF,0xC0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x23,0x08,0x37,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x40,0x10,0x08,0x40,0x00,0xFF,0x90,
0x10,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x81,0x86,0x10,0x40,0x00,0x08,0x08,
0x10,0xFF,0x86,0x00,0x00,0x00,0x00,0x00,
0x01,0x02,0x49,0x40,0x40,0x00,0x7F,0x0B,
0xFC,0x08,0x0F,0x00,0x00,0x00,0x00,0x00,
0x01,0x08,0x00,0x40,0x20,0x00,0x10,0x00,
0x10,0x49,0x0F,0x00,0x00,0x00,0x00,0x00,
0x02,0x08,0x00,0x20,0x20,0x01,0xFF,0xDD,
0x10,0x2A,0x0F,0x00,0x00,0x00,0x00,0x00,
0x04,0x31,0x83,0x20,0x20,0x00,0x20,0x04,
0x91,0xFF,0xC6,0x00,0x00,0x00,0x00,0x00,
0x04,0x52,0x44,0x90,0x20,0x00,0x7F,0x04,
0x90,0x1C,0x06,0x00,0x00,0x00,0x00,0x00,
0x09,0xA4,0x28,0x4C,0x10,0x00,0xA1,0x04,
0x10,0x2A,0x00,0x00,0x00,0x00,0x00,0x00,
0x0E,0x44,0xE9,0xC3,0x90,0x01,0x3F,0x04,
0x70,0x49,0x06,0x00,0x00,0x00,0x00,0x00,
0x00,0x82,0xC5,0x81,0x70,0x00,0x21,0x0A,
0x01,0x88,0xC6,0x00,0x00,0x00,0x00,0x00,
0x01,0x01,0x83,0x00,0x80,0x00,0x3F,0x11,
0xFC,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x0C,0x70,0x00,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0x13,0x87,0x10,0x40,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0x20,0x78,0xA0,0x40,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0x20,0x00,0x60,0x40,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0x21,0x80,0x60,0x40,0x00,0x00,0x71,
0xEE,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x11,0x98,0x90,0x80,0x00,0x00,0x8E,
0x31,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x08,0x18,0x80,0x80,0x00,0x01,0x24,
0x24,0x83,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x96,0x01,0x01,0x00,0x00,0x01,0x40,
0x28,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x49,0x86,0x03,0x00,0x00,0x01,0x40,
0x28,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x34,0x78,0x8C,0x00,0x00,0x01,0x00,
0x20,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x0E,0x01,0x30,0x00,0x00,0x00,0x80,
0x30,0x06,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x71,0x87,0xCE,0x00,0x00,0x00,0x40,
0x68,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xE0,0x78,0x07,0x00,0x00,0x00,0x20,
0xC4,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0xAF,0xFF,0xC5,0x80,0x00,0x00,0x11,
0x82,0x30,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0xA9,0xB6,0x45,0xC0,0x00,0x00,0x0B,
0x01,0x60,0x00,0x00,0x00,0x00,0x00,0x00,
0x07,0x2F,0x03,0xC4,0xE0,0x00,0x00,0x06,
0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
0x0E,0x16,0x01,0x88,0x70,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0F,0x08,0x00,0x10,0xF0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0F,0x84,0x00,0x21,0xF0,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,
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,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,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,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
};
uchar code table[]={"潍坊学院自动化"};
bit lcd_busy()
{
bit flag;
P0=0xff;
RS=0;
RW=1;
E=1;
delay_500us(1);
flag=(bit)(P0&0xf0);
E=0;
return(flag);
}
void lcd_wcmd(uchar cmd)
{
while(lcd_busy());
P0=cmd;
RS=0;
RW=0;
E=1;
delay_500us(1);
E=0;
}
void lcd_wdat(uchar dat)
{
while(lcd_busy());
P0=dat;
RS=1;
RW=0;
E=1;
delay_500us(1);
E=0;
}
void display1(uchar *p)
{
uchar lcd_x,lcd_y;
lcd_x=0x80;
lcd_y=0x80;
lcd_wcmd(0x34);
for(i=0;i<2;i++)
{
for(j=0;j<32;j++)
{
lcd_wcmd(lcd_y+j);
lcd_wcmd(lcd_x);
for(k=0;k<16;k++)
{
lcd_wdat(*p++);
}
}
lcd_x=0x88;
}
lcd_wcmd(0x36);
lcd_wcmd(0x30);
}
void display2(uchar *p)
{
lcd_wcmd(0x80);
while(*p!=0x00)
{
lcd_wdat(*p);
p++;
}
}
void lcd_init()
{
delay_10ms(5);
lcd_wcmd(0x30);
delay_100us(1);
lcd_wcmd(0x30);
delay_100us(1);
lcd_wcmd(0x0c);
delay_100us(1);
lcd_wcmd(0x01);
delay_10ms(2);
lcd_wcmd(0x06);
delay_100us(1);
}
void main()
{
uchar lcd_x,lcd_y;
lcd_init();
display1(image);
//display2(table);
while(1);
} |