导航: 老古网老古论坛XMOS公共讨论区XMOS开源项目区单片机程序设计嵌入式系统广告区域
→单片机控制工作液晶显示器[fenger_lfl]

 *第40924篇: 单片机控制工作液晶显示器

  
楼 主:fenger_lfl 2009年4月20日10:41
 单片机控制工作液晶显示器
按此在新窗口浏览图片
点击浏览该文件
我们的产品是智能液晶终端,是采用全新工规液晶屏,然后加上我们自己的液晶驱动,包括汉字库,界面图片数据储存FLASH,可以集成触摸屏(有漂移补偿技术)、键盘和时钟等。您只要通过简单的RS232串口或打印机并口接上你的设备


详细功能:
1. 在指定的X轴,Y轴的位置显示16X16或32X32的中英文字符,内置有中英文字库。 (加装64M的NandFlash可支持24X24,48X48,64X64的中英文字符)。 
2. 在指定的X轴,Y轴的位置显示直线,圆或椭圆。 
3. 显示预置的位图(用PC机预先下载到控制板的图片,支持的图片有256色位图和JPG图,JPG图片在VTer_8060TFT_080的实际显示效果是64K色) 
4. 清除全屏或清除指定位置和长宽的矩形。 
5. 自动显示实时时钟(可关闭,可指定位置和显示方式)。 
6. 所有的功能均可通过单片机的并行口或RS232串行口发送简单的指令完成。 

有兴趣朋友主留下邮箱:fenger_lfl@163.com

  
2楼:fenger_lfl 2009年4月27日09:25
 工业控制液晶显示器1199896268
//写一个数据子程序:
Write_Byte(uchar dc_data)
{
    uchar xdata DC;   //定义一个外部RAM变量
    //uchar i;
    CS0 = 0;
 DC = dc_data;   //数据dc_data写到外部RAM(即LCD控制板)。
 CS0 = 1;
    //加入适当的空操作延时
 //当采用更高速的单片机时应加入更多的空操作延时
 //这里加上8个空操作延时,在AT89C51,22MHz下是完全没问题的。
    //for(i=0;i  <1;i++){}  
}
//读一个字节数据子程序:
uchar Read_Byte(void)
{
    uchar xdata DC;
    CS0 = 0;
 return DC;
}
//////////////////////////////////////////////////////////////////
//
//
//////////////////////////////////////////////////////////////////
/*
//测试从显示终端机读取时间。
test_timer()
{
  uchar  i;

  Read_date();
  while(Date[0] == 0){}   //等待显示终端机送年月日数据到单片机
  for(i=0;i  <3;i++)
  {
     DIS_value((6*16)+(i*24),32,Date[i+1],2);
  }
  Read_time();
  while(Date[4] == 0){}   //等待显示终端机送时分秒数据到单片机
  for(i=0;i  <3;i++)
  {
     DIS_value((6*16)+(i*24),48,Date[i+5],2);
  }
}
*/
//指令头,每一条指令都规定为"0x81, command1,command2,Fcolor,Bcolor"
command_head(unsigned char command1,unsigned char command2)
{
   Write_Byte(0x81);
   Write_Byte(command1);
   Write_Byte(command2);
   Write_Byte(Fcolor);
   Write_Byte(Bcolor);
}

//清屏子程序
Lcd_Clr()
{
   command_head(0x43,0x4c);
   Write_Byte(0x84);
}
//保存原桌面内容
void COPY_DC()
{
   command_head(0x43,0x44);
   Write_Byte(0x84);
}
//恢复原来桌面
void EXIT_DC()
{
   command_head(0x45,0x44);
   Write_Byte(0x84);
}
Bell()  //打开蜂鸣器。
{
   Write_Byte(0x81);
   Write_Byte(0x42);
   Write_Byte(0x42);
   Write_Byte(0x01);   //设置蜂鸣器的时间
   Write_Byte(0x84);
}
// 清矩形
void Clr_squ(unsigned short x0,unsigned short y0,unsigned short width,unsigned short heith)
{
   command_head(0x43,0x58);
   Write_Byte(x0/100);
   Write_Byte(x0%100);
   Write_Byte(y0/100);
   Write_Byte(y0%100);

   Write_Byte(width/100);
   Write_Byte(width%100);
   Write_Byte(heith/100);
   Write_Byte(heith%100);

   Write_Byte(0x84);

// 反色矩形
void inv_squ(unsigned short x0,unsigned short y0,unsigned short width,unsigned short heith)
{
   command_head(0x43,0x4e);
   Write_Byte(x0/100);
   Write_Byte(x0%100);
   Write_Byte(y0/100);
   Write_Byte(y0%100);

   Write_Byte(width/100);
   Write_Byte(width%100);
   Write_Byte(heith/100);
   Write_Byte(heith%100);

   Write_Byte(0x84);
}
/*
//读取年月日
Read_date()
{
     Date[0] = 0;
     command_head(0x52,0x44);
     Write_Byte(0x84);
}
//读取时分秒
Read_time()
{
     Date[4] = 0; 
     command_head(0x52,0x54);
     Write_Byte(0x84);
}
*/
//画圆子程序。
DIS_Ellipse(unsigned short x0,unsigned short y0,unsigned short xr,unsigned short yr)
{
   command_head(0x44,0x45);
   Write_Byte(x0/100);
   Write_Byte(x0%100);
   Write_Byte(y0/100);
   Write_Byte(y0%100);
   Write_Byte(xr/100);
   Write_Byte(xr%100);
   Write_Byte(yr/100);
   Write_Byte(yr%100);
   Write_Byte(x0/100);
   Write_Byte(0x84);
}

/*
//画直线子程序。
DIS_Line(unsigned short x0,unsigned short y0,unsigned short x1,unsigned short y1,unsigned short with)
{

   command_head(0x44,0x4c);
   Write_Byte(x0/100);
   Write_Byte(x0%100);
   Write_Byte(y0/100);
   Write_Byte(y0%100);
   Write_Byte(x1/100);
   Write_Byte(x1%100);
   Write_Byte(y1/100);
   Write_Byte(y1%100);
   Write_Byte(with/100);
   Write_Byte(with%100);
   Write_Byte(0x84);
}
*/
//在指定的开始位置(x0,y0)显示字符串子程序。
//当x0大于800且已打开光标功能时在以光标为开始位置显示字符串子程序。
/*DIS_String(unsigned short x0,unsigned short y0,char *fmt)
{

   command_head(0x44,0x57);

   //Write_Byte(0xE0);//字体以红色显示
   //Write_Byte(0x1C);//背景为透明

   Write_Byte(x0/100);
   Write_Byte(x0%100);
   Write_Byte(y0/100);
   Write_Byte(y0%100);

   while(*fmt)
   {
     Write_Byte(*fmt);
  fmt++;
   }
   Write_Byte(0x84);
}
*/

//在指定的开始位置(x0,y0)显示字符串子程序。
//当x0大于800且已打开光标功能时在以光标为开始位置显示字符串子程序。
DIS_StringN(unsigned short x0,unsigned short y0,char *fmtn,uchar n)
{
   uchar  i;
   command_head(0x44,0x57);
   Write_Byte(x0/100);
   Write_Byte(x0%100);
   Write_Byte(y0/100);
   Write_Byte(y0%100);

   for(i=0;i   {
      Write_Byte(*fmtn);
    fmtn++;
    }
   Write_Byte(0x84);
}


//在指定的开始位置(x0,y0)显示字符串子程序。
//当x0大于800且已打开光标功能时在以光标为开始位置显示字符串子程序。
DIS_String64(unsigned short x0,unsigned short y0,char *fmt)
{

   command_head(0x54,0x04);

   Write_Byte(x0/100);
   Write_Byte(x0%100);
   Write_Byte(y0/100);
   Write_Byte(y0%100);

   while(*fmt)
   {
     Write_Byte(*fmt);
  fmt++;
   }
   Write_Byte(0x84);
}

/*
//显示时间子程序
void Dis_time(unsigned short x0,unsigned short y0,unsigned char i)
{
   command_head(0x44,0x54);
   Write_Byte(x0/100);
   Write_Byte(x0%100);
   Write_Byte(y0/100);
   Write_Byte(y0%100);
   Write_Byte(i);
   Write_Byte(0x84);
}
*/
/*
//设置时间子程序;
//年,月,日,时 ,分,秒,星期。
void Set_time(uchar year,uchar month,uchar day,uchar hour,uchar minute,uchar second,uchar date)
{
   command_head(0x53,0x54);
   Write_Byte(year);
   Write_Byte(month);
   Write_Byte(day);
   Write_Byte(hour);
   Write_Byte(minute);
   Write_Byte(second);
   Write_Byte(date);
   Write_Byte(0x84);
}
*/
/*
//显示变量子程序
DIS_value(unsigned short x0,unsigned short y0,unsigned short Va,unsigned char i)
{
   command_head(0x44,0x56);
   Write_Byte(x0/100);
   Write_Byte(x0%100);
   Write_Byte(y0/100);
   Write_Byte(y0%100);

   Write_Byte(Va/100);
   Write_Byte(Va%100);
   Write_Byte(i);
   Write_Byte(0x84);
}
*/
//显示位图子程序
DIS_BMP(unsigned short x0,unsigned short y0,uchar N1)
{
   command_head(0x44,0x53);
   Write_Byte(x0/100);
   Write_Byte(x0%100);
   Write_Byte(y0/100);
   Write_Byte(y0%100);
   Write_Byte(N1);
   Write_Byte(0x84);
}
/*
//自动显示位图子程序
AUTO_BMP(unsigned short x0,unsigned short y0,uchar N1,uchar N2,uchar T)
{
   command_head(0x5a,0x44);
   Write_Byte(x0/100);
   Write_Byte(x0%100);
   Write_Byte(y0/100);
   Write_Byte(y0%100);
   Write_Byte(N1);
   Write_Byte(N2);
   Write_Byte(T);
   Write_Byte(0x84);
}
*/
////////////////////////////////////////////////////////////////////////
//显示一个字符
DIS_Byte(unsigned short x0,unsigned short y0,char fmt)
{
   command_head(0x44,0x57);
   Write_Byte(x0/100);
   Write_Byte(x0%100);
   Write_Byte(y0/100);
   Write_Byte(y0%100);
   Write_Byte(fmt);
   Write_Byte(0x84);
}  


>>>>>>对该主题发表你的看法

本主题贴数2,分页: [第1页]


[上一篇主题]:智能显示器

[下一篇主题]:急求教IAR编译器的问题