RA8875设置新坐标后需要延时的问题及解决。
测试RA8875,在画线时,设置XY坐标后,即可写入数据发现设置并没有生效。
读取LCD状态寄存器发现忙标致显示为0(空闲),但加入延时后没有问题。
但延时并不是解决问题的办法,后想到可能先设置坐标高位可能要好些。
修改后现象暂时消失。
原程序:
//REG[46h]~REG[49h]
static void XY_Coordinate(uint32_t X,uint32_t Y)
{
LCD_CmdWrite(0x46);
LCD_DataWrite(X);
LCD_CmdWrite(0x47);
LCD_DataWrite(X>>8);
LCD_CmdWrite(0x48);
LCD_DataWrite(Y);
LCD_CmdWrite(0x49);
LCD_DataWrite(Y>>8);
}
static void XY_Coordinate(uint32_t X,uint32_t Y)
{
LCD_CmdWrite(0x46);
LCD_DataWrite(X);
LCD_CmdWrite(0x47);
LCD_DataWrite(X>>8);
LCD_CmdWrite(0x48);
LCD_DataWrite(Y);
LCD_CmdWrite(0x49);
LCD_DataWrite(Y>>8);
}
修改后的程序:
//REG[46h]~REG[49h]
static void XY_Coordinate(uint32_t X,uint32_t Y)
{
LCD_CmdWrite(0x47);
LCD_DataWrite(X>>8);
LCD_CmdWrite(0x46);
LCD_DataWrite(X);
LCD_CmdWrite(0x49);
LCD_DataWrite(Y>>8);
LCD_CmdWrite(0x48);
LCD_DataWrite(Y);
}
static void XY_Coordinate(uint32_t X,uint32_t Y)
{
LCD_CmdWrite(0x47);
LCD_DataWrite(X>>8);
LCD_CmdWrite(0x46);
LCD_DataWrite(X);
LCD_CmdWrite(0x49);
LCD_DataWrite(Y>>8);
LCD_CmdWrite(0x48);
LCD_DataWrite(Y);
}