请登录 免费注册
分享
  • 微信
  • 新浪微博
  • 人人网
  • QQ空间
  • 开心网
  • 豆瓣
会员服务
进取版 标准版 尊贵版
| 设为首页 | 收藏 | 导航 | 帮助
产品 资讯
请输入产品名称
JUKI贴片机 单极霍尔开关 pcb设备 全方位海绵 无感电容 电源供应 MDD72-16N1B-IXYS二极管
关注微信随身推
首页 电子商城 专题报道 资料中心 成功案例
词多 效果好 就选易搜宝!
杭州清达光电技术有限公司
新增产品 | 公司简介
注册时间:2009-06-24
联系人:
电话:
Email:
首页 公司简介 产品目录 公司新闻 技术文章 资料下载 成功案例 人才招聘 荣誉证书 联系我们

产品目录

特色产品
抄表160160液晶系列
适合ARDUION系统显示屏
特小字符/汉字
特大字符/汉字
电力行业专用
带温度补偿
带汉字库液晶屏
320240系列液晶
PDA液晶
超薄型
图形点阵液晶模块
单色字符液晶模组
OLED模块
OLED显示屏
TFT模块
彩屏解决方案
液晶配套产品
代理产品
日韩台代理产品
香港精电液晶
mono图形液晶显示模块
单色字符LCM模块
OLED
定制液晶
彩色液晶
香港精电液晶
日本单色产品
配件
首页 >>> 技术文章 >

技术文章

清达光电SPI液晶模块与8051单片机应用实例

清达光电SPI液晶模块与8051单片机应用实例

1,SPI液晶时序介绍:

    SPI是一种时序,液晶模块时序是指对LCD显示模块进行读写时电路的时序要求和状态。

主要分为以下几种时序:8080并口,6800并口,SPI串口,I2C串口,UART串口,RS232串口,USB等几种类型。

清达光电SPI液晶模块HC1624时序图如下:

 

 

 

 

2,SPI液晶HC1624主要参数:

HC1624为清达光电生产的16*2字符液晶模块(资料参考http://www.chinalcdmodule.com/character-lcm-hc1624.html)

 

尺寸规格

 

 

 

 

 

 

原理结构图

 

 

模块外形图

 

 

接口定义:

编号  符号 电平 功能 

1 VSS 0V 接地 

2 VDD +5.0V 逻辑电压 

3 V0 - LCD驱动电压 

4 RS H/L H: 数据  L: 指令 

5~11 NC - 空脚位 

12 /CS L 低片选有效 

13 SCLK H/L 串行时钟输入 

14 SID H/L 串行数据输入 

15 LEDA +5.0V 16 LEDK 0V LED背光源输入电压

 

 

 

3, SPI液晶模块HC1624控制器介绍

 


西文字库表

 


4,SPI液晶模块与8051单片机硬件及软件应用实例

 

硬件接口图

 

 

软件应用实例:

#include<reg51.h> 

#include<string.h>

 #include<stdio.h> 

#include <intrins.h> 

#define uchar unsigned char

 #define uint unsigned int  

sbit SID=P3^4; 

sbit SCK=P3^3; 

sbit CS=P3^1; 

sbit RS=P3^0; 

 

/*********************

延时子程序

********************/

void delayus(uchar m)

{

while(--m);

}

void delayms(uchar m)

{

uchar i,j;

for(i=0;i<102;i++)

for(j=0;j<m;j++)

delayus(1);

}

/****************

液晶屏写入程序

********************************************/

void SendByte(unsigned char Dbyte)

{

     unsigned char i ;

    // CS = 0;

     for(i=0 ;i< 8 ;i++)

     {

           SCK = 0 ;

           delayus(1);

           Dbyte=Dbyte<< 1 ;      //左移一位

           delayus(1);

           SID = CY ;            //移出的位给SID

           delayus(1);

           SCK = 1 ;

           SCK = 0 ;

     }

}

void WriteCommand( unsigned char Cbyte )

{

       CS = 0;

     delayus(1);

     SendByte(Cbyte) ;

     delayus(1);

}

 

void WriteData( unsigned char Dbyte)

{

         CS = 0;

     WriteCommand(0x3c);

     SendByte(0x80) ;

     SendByte(Dbyte) ;

}

/***********************

液晶屏初始化

************************/

void lcd_init()

{

 RES=0;

 delayus(10);

 RES=1;

 delayus(10);

 delayms(60);

 WriteCommand(0x38);//8位数,2行显示,外部功能关

  delayms(60);

 WriteCommand(0x38);//8位数,2行显示,外部功能关

  delayms(60);

 WriteCommand(0x38);//8位数,2行显示,外部功能关

  delayus(60);

 WriteCommand(0x0e); //开显示,光标,2行显示

  delayus(60);

 WriteCommand(0x01); //**

  delayus(60);

 WriteCommand(0x02); //归零

   delayus(60);

 WriteCommand(0x14); //光标右移

 WriteCommand(0x06); //模式进入

}

void goto_lcd(uchar x,uchar y)

{

  WriteCommand(0x38);

  WriteCommand(0x80+x+y*0x40);

}

void write_string(uchar x,uchar y,uchar *s)

{

  goto_lcd(x,y);

  while(*s>0)

  {WriteData(*s); s++;}

}

void ringt_lcd()

{

uchar i;

for(i=0;i<16;i++)

{WriteCommand(0x1c);delayms(4000); };

}

void left_lcd()

{

uchar i;

for(i=0;i<16;i++)

{WriteCommand(0x18);delayms(4000); };

}

int main(void)

{

uchar i;

lcd_init();

write_string(0,0,"012456789ABCDEFG");

write_string(4,1,"Tsingtek");

while(1);

}

上一篇:OLED显示屏发光原理
下一篇:清达光电25664OLED模块SSD1322测试程序,示例代码
              
若网站内容侵犯到您的权益,请通过网站上的联系方式及时联系我们修改或删除