关于PG12864F液晶使用的问题

2019-03-24 18:43发布

为什么PG12864F液晶显示器显示整平图片时总显示连个半屏的,上下各半屏,都是图片的上一半 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
8条回答
bintimes
1楼-- · 2019-03-24 23:42
 精彩回答 2  元偷偷看……
gaoyang9992006
2楼-- · 2019-03-25 01:04
你程序的问题。
gaoyang9992006
3楼-- · 2019-03-25 06:56
楼主先找个别人调试好的 程序,然后再试试看,如果没问题那就是你程序设计的问题。以及电路保证都是连接的没问题。
gaoyang9992006
4楼-- · 2019-03-25 09:56
调好之后,建立缓冲区,然后定时扫描缓冲区,更新显示内容,只更新缓冲区就OK了,目前你还是看看电路和驱动代码是否有问题吧,一般出现你说的情况应该是程序没有弄好。
jinsheng106
5楼-- · 2019-03-25 11:29
显示64*32的图片可以,但是显示128*64的图片显示上下两个一样的半屏
jinsheng106
6楼-- · 2019-03-25 13:06
这是我写的程序,高手们给看看怎么回事,谢谢了

#include "REG52.H"
#include "stdio.h"
#include"absacc.h"
#define uchar unsigned char
#define uint unsigned int
#define LCDCOM XBYTE[0xfFfD]
#define LCDDATA XBYTE[0xfFfC]
sbit bflag=ACC^7;
unsigned  char code tuxing[]={0x00,0x00,0x01,0xFF,0xF0,0x18,0x03,0xFE,0x00,0x07,0xFF,0xFC,0x07,0xFF,0xFF,0xFE,
0x00,0x00,0x03,0xFF,0xF0,0x18,0x03,0xFE,0x00,0x07,0xFF,0xFE,0x0F,0xFF,0xFF,0xFF,
0x00,0x00,0x07,0xFF,0xF0,0x38,0x03,0xFE,0x00,0x00,0x7F,0xFF,0x0F,0xFF,0xFF,0xFF,
0x00,0x00,0x0F,0xFF,0xF0,0x70,0x03,0xFF,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,
0x00,0x00,0x1F,0xFF,0xE0,0x70,0x03,0xFF,0x80,0x00,0x7F,0xFF,0x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,0xFC,0xE7,0xFF,0xF0,
0x00,0x07,0xFF,0xE0,0x7F,0x80,0x00,0x00,0x1F,0xC3,0xFF,0x8F,0xFF,0xFF,0xFF,0xF0,
0x00,0x07,0xFF,0xE0,0x7F,0xC0,0x00,0x00,0x1F,0xC3,0xFF,0xCF,0xFF,0xFF,0xFF,0xF0,
0x00,0x07,0xFF,0xF0,0x3F,0xC0,0x00,0x00,0x1F,0x83,0xFF,0xDF,0xFF,0xFF,0xFF,0xF0,
0x00,0x07,0xFF,0x70,0x3F,0xC0,0x00,0x00,0x1F,0x83,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,
0x00,0x0F,0xFE,0x78,0x1F,0xC0,0x00,0x00,0x1F,0x83,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,

};





void delay(unsigned char m)
{
   unsigned char i,j;       
         for(i=0;i<m;i++)
          for(j=0;j<50;j++)
           ;                 
}
void busy(void)
{
do{ACC=LCDCOM;
   }while(bflag==1);

}

void command_sending_with_one_data(uchar data1,uchar command)
{  busy();
   LCDDATA=data1;
   busy();
  LCDCOM=command;
}
void command_sending_with_two_data(uint data1,uint data2,uchar command)
{
  busy();
LCDDATA=data1;
busy();
LCDDATA=data2;
busy();
LCDCOM=command;  
}


void dispay_tuxing(void)
{
uchar i,j;
uint address,x=0;
address=0;//首地址,图形显示
for(i=0;i<32;i++)
{  uint k=0;
  if(address>=32)k=(address/32);
command_sending_with_two_data((uchar)(address*8),(uchar)(k),0x24);
for(j=0;j<16;j++)//每行16字节
{
command_sending_with_one_data(tuxing[x],0xc0);
x++;
}
address=address+16;//换行
}

}


void init_12864()
{
busy();
command_sending_with_two_data(0x00,0x00,0x21); //光标指针设置,本程序不设置偏移寄存器
  busy();                                //地址指针在开始写字的时候才进行设置  
  command_sending_with_two_data(0x00,0x00,0x42);
busy();
command_sending_with_two_data(128,00,0x43);   //设置图形区域大小
  busy();   
LCDCOM=0x80;      //模式设置
  busy();
LCDCOM=0x98;      //显示设置
  busy();
LCDCOM=0xa5;      //光标设置
}
void clear_play(void)
{  uchar i;
  LCDCOM=0xB0;
   busy();
  for(i=0;i<300;i++)
   LCDDATA=0x00;
busy();
  LCDCOM=0xb2;
busy();
}
void main()
{ uchar i;
  init_12864();
    dispay_tuxing();
  }

一周热门 更多>