




已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
你是否还在为proteus里没有Nokia_5110而烦恼吗?那就要用Nokia_7110代替吧!Nokia 5110与7110用过Nokia 5110和3110的都知道这两款液晶很好用,相比LCD1602和LCD12864,Nokia 5110和3110的速度要快的多,不需要任何延时程序,Nokia 5110和3110是标准的SPI接口,所以驱动起来也很方便。可惜Proteus元件库中没有5110和3110,只有7110液晶,5110和3110的驱动程序基本上是一模一样的,两款液晶用的都是同样的液晶驱动器,都是飞利浦公司(philips)的PCD8544,驱动48*84。而7110液晶采用的是爱普生公司(EPSON)的SED1565驱动芯片。所以7110相比前面两款液晶操作指令会略有不同!但是都是标准的SPI接口,对于有标准SPI接口电路的MCU来说驱动起来更加的方便!7110液晶显示的接口:(和5110的差不多)在程序设置方面7110和5110的异同:1 初始化不同2 坐标设置不同3 写命令和数据是一样的Proteus仿真图89C52单片机程序#include reg52.hvoid delay_1us(unsigned int n);void LCD_init(void);void LCD_clear(void);void LCD_set_XY(unsigned char X, unsigned char Y);void LCD_write_char(unsigned char c);void LCD_write_english_string(unsigned char X,unsigned char Y,char *s);/英语void LCD_write_chinese_string(unsigned char X, unsigned char Y,unsigned char ch_with,unsigned char num,unsigned char line,unsigned char row);/汉子void LCD_write_byte(unsigned char dat, unsigned char command);sbit SCLK = P15;sbit SDIN = P14;sbit LCD_DC = P13;sbit LCD_CE = P11;sbit LCD_RST = P12;sbit LED = P16; code unsigned char write_chinese332=/我0x20,0x24,0x24,0x24,0xFE,0x23,0x22,0x20,0x20,0xFF,0x20,0x22,0x2C,0xA0,0x20,0x00,0x00,0x08,0x48,0x84,0x7F,0x02,0x41,0x40,0x20,0x13,0x0C,0x14,0x22,0x41,0xF8,0x00,/爱0x80,0x64,0x2C,0x34,0x24,0x24,0xEC,0x32,0x22,0x22,0x32,0x2E,0x23,0xA2,0x60,0x00,0x00,0x41,0x21,0x91,0x89,0x87,0x4D,0x55,0x25,0x25,0x55,0x4D,0x81,0x80,0x80,0x00,/你0x00,0x80,0x60,0xF8,0x07,0x40,0x20,0x18,0x0F,0x08,0xC8,0x08,0x08,0x28,0x18,0x00,0x01,0x00,0x00,0xFF,0x00,0x10,0x0C,0x03,0x40,0x80,0x7F,0x00,0x01,0x06,0x18,0x00,;code unsigned char font6x8926 = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00 , 0x00, 0x00, 0x07, 0x00, 0x07, 0x00 , 0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14 , 0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12 , 0x00, 0x62, 0x64, 0x08, 0x13, 0x23 , 0x00, 0x36, 0x49, 0x55, 0x22, 0x50 , 0x00, 0x00, 0x05, 0x03, 0x00, 0x00 , 0x00, 0x00, 0x1c, 0x22, 0x41, 0x00 , 0x00, 0x00, 0x41, 0x22, 0x1c, 0x00 , 0x00, 0x14, 0x08, 0x3E, 0x08, 0x14 , 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08 , 0x00, 0x00, 0x00, 0xA0, 0x60, 0x00 , 0x00, 0x08, 0x08, 0x08, 0x08, 0x08 , 0x00, 0x00, 0x60, 0x60, 0x00, 0x00 , 0x00, 0x20, 0x10, 0x08, 0x04, 0x02 , 0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E , 0x00, 0x00, 0x42, 0x7F, 0x40, 0x00 , 0x00, 0x42, 0x61, 0x51, 0x49, 0x46 , 0x00, 0x21, 0x41, 0x45, 0x4B, 0x31 , 0x00, 0x18, 0x14, 0x12, 0x7F, 0x10 , 0x00, 0x27, 0x45, 0x45, 0x45, 0x39 , 0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30 , 0x00, 0x01, 0x71, 0x09, 0x05, 0x03 , 0x00, 0x36, 0x49, 0x49, 0x49, 0x36 , 0x00, 0x06, 0x49, 0x49, 0x29, 0x1E , 0x00, 0x00, 0x36, 0x36, 0x00, 0x00 , 0x00, 0x00, 0x56, 0x36, 0x00, 0x00 , 0x00, 0x08, 0x14, 0x22, 0x41, 0x00 , 0x00, 0x14, 0x14, 0x14, 0x14, 0x14 , 0x00, 0x00, 0x41, 0x22, 0x14, 0x08 , 0x00, 0x02, 0x01, 0x51, 0x09, 0x06 , 0x00, 0x32, 0x49, 0x59, 0x51, 0x3E , 0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C , 0x00, 0x7F, 0x49, 0x49, 0x49, 0x36 , 0x00, 0x3E, 0x41, 0x41, 0x41, 0x22 , 0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C , 0x00, 0x7F, 0x49, 0x49, 0x49, 0x41 , 0x00, 0x7F, 0x09, 0x09, 0x09, 0x01 , 0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A , 0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F , 0x00, 0x00, 0x41, 0x7F, 0x41, 0x00 , 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01 , 0x00, 0x7F, 0x08, 0x14, 0x22, 0x41 , 0x00, 0x7F, 0x40, 0x40, 0x40, 0x40 , 0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F , 0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F , 0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E , 0x00, 0x7F, 0x09, 0x09, 0x09, 0x06 , 0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E , 0x00, 0x7F, 0x09, 0x19, 0x29, 0x46 , 0x00, 0x46, 0x49, 0x49, 0x49, 0x31 , 0x00, 0x01, 0x01, 0x7F, 0x01, 0x01 , 0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F , 0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F , 0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F , 0x00, 0x63, 0x14, 0x08, 0x14, 0x63 , 0x00, 0x07, 0x08, 0x70, 0x08, 0x07 , 0x00, 0x61, 0x51, 0x49, 0x45, 0x43 , 0x00, 0x00, 0x7F, 0x41, 0x41, 0x00 , 0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55 , 0x00, 0x00, 0x41, 0x41, 0x7F, 0x00 , 0x00, 0x04, 0x02, 0x01, 0x02, 0x04 , 0x00, 0x40, 0x40, 0x40, 0x40, 0x40 , 0x00, 0x00, 0x01, 0x02, 0x04, 0x00 , 0x00, 0x20, 0x54, 0x54, 0x54, 0x78 , 0x00, 0x7F, 0x48, 0x44, 0x44, 0x38 , 0x00, 0x38, 0x44, 0x44, 0x44, 0x20 , 0x00, 0x38, 0x44, 0x44, 0x48, 0x7F , 0x00, 0x38, 0x54, 0x54, 0x54, 0x18 , 0x00, 0x08, 0x7E, 0x09, 0x01, 0x02 , 0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C , 0x00, 0x7F, 0x08, 0x04, 0x04, 0x78 , 0x00, 0x00, 0x44, 0x7D, 0x40, 0x00 , 0x00, 0x40, 0x80, 0x84, 0x7D, 0x00 , 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00 , 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00 , 0x00, 0x7C, 0x04, 0x18, 0x04, 0x78 , 0x00, 0x7C, 0x08, 0x04, 0x04, 0x78 , 0x00, 0x38, 0x44, 0x44, 0x44, 0x38 , 0x00, 0xFC, 0x24, 0x24, 0x24, 0x18 , 0x00, 0x18, 0x24, 0x24, 0x18, 0xFC , 0x00, 0x7C, 0x08, 0x04, 0x04, 0x08 , 0x00, 0x48, 0x54, 0x54, 0x54, 0x20 , 0x00, 0x04, 0x3F, 0x44, 0x40, 0x20 , 0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C , 0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C , 0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C , 0x00, 0x44, 0x28, 0x10, 0x28, 0x44 , 0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C , 0x00, 0x44, 0x64, 0x54, 0x4C, 0x44 , 0x14, 0x14, 0x14, 0x14, 0x14, 0x14 ,; /*主程序*/void main(void) LCD_init();LCD_write_english_string(9,6,QQ:); LCD_write_english_string(29,6,123456789);LCD_write_chinese_string(10,1,16,3,0,12);/起始坐标,字宽,字数,数组里的第几个字,字间隔while(1) /*延时程序*/ void delay_1us(unsigned int n) unsigned int i,j;for(j=0;jn;j+) for(i=0;i1000;i+); /*LCD初始化*/void LCD_init(void) LCD_CE = 1; delay_1us(1);LCD_RST = 0; delay_1us(1);LCD_RST = 1;delay_1us(1); LCD_write_byte(0xA6, 0); LCD_write_byte(0xA3, 0); LCD_write_byte(0xA1, 0); LCD_write_byte(0xC0, 0); LCD_write_byte(0x22, 0); LCD_write_byte(0x81, 0); LCD_write_byte(0x2E, 0); LCD_write_byte(0x2F, 0); LCD_write_byte(0xE3, 0); LCD_write_byte(0x40, 0); LCD_write_byte(0xAF, 0); LCD_write_byte(0xA5, 0); delay_1us(5); LCD_write_byte(0xAE, 0); LCD_clear(); LCD_write_byte(0xAF, 0);LCD_write_byte(0xA4, 0); /*LCD清屏*/void LCD_clear(void) unsigned int i,x; for (i=0; i0; x-)LCD_write_byte(0, 0); /*LCD坐标设置*/void LCD_set_XY(unsigned char X, unsigned char Y) LCD_write_byte(0xB0+Y, 0); X=0x12+X; LCD_write_byte(0x10+(X4), 0);LCD_write_byte(0x0F&X, 0); /*写一个字母*/void LCD_write_char(unsigned char c) unsigned char line; c -= 32; for (line=0; line6; line+) LCD_write_byte(font6x8cline,1); /*写英语*/void LCD_write_english_string(unsigned char X,unsigned char Y,char *s) LCD_set_XY(X,Y); while (*s) LCD_write_char(*s); s+; /*写
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
评论
0/150
提交评论