杰出人士
- 积分
- 13138
- 威望
- 5341
- 贡献
- 1645
- 兑换币
- 2222
- 注册时间
- 2012-3-9
- 在线时间
- 3076 小时
- 毕业学校
- 嘉兴学院
|
void ssd1289_init(void)
{
CS=1;
LCD_RD=1;
delayms(5);
RES=0;
delayms(15);
RES=1;
delayms(5);
delayms(100);//可以适当调整延时,保障稳定显示
Write_Cmd_Data(0x0000,0x0001); delayms(1); //打开晶振
Write_Cmd_Data(0x0003,0xA8A4); delayms(1); //0xA8A4
Write_Cmd_Data(0x000C,0x0000); delayms(1);
Write_Cmd_Data(0x000D,0x080C); delayms(1);
Write_Cmd_Data(0x000E,0x2B00); delayms(1);
Write_Cmd_Data(0x001E,0x00B0); delayms(1);
Write_Cmd_Data(0x0001,0x2B3F); delayms(1); //驱动输出控制320*240 0x6B3F 0x2b3f
Write_Cmd_Data(0x0002,0x0600); delayms(1);
Write_Cmd_Data(0x0010,0x0000); delayms(1);
Write_Cmd_Data(0x0011,0x6070); delayms(1); //0x4030 //定义数据格式 16位色
Write_Cmd_Data(0x0005,0x0000); delayms(1);
Write_Cmd_Data(0x0006,0x0000); delayms(1);
Write_Cmd_Data(0x0016,0xEF1C); delayms(1);
Write_Cmd_Data(0x0017,0x0003); delayms(1);
Write_Cmd_Data(0x0007,0x0233); delayms(1); //0x0233
Write_Cmd_Data(0x000B,0x0000); delayms(1);
Write_Cmd_Data(0x000F,0x0000); delayms(1); //扫描开始地址
Write_Cmd_Data(0x0041,0x0000); delayms(1);
Write_Cmd_Data(0x0042,0x0000); delayms(1);
Write_Cmd_Data(0x0048,0x0000); delayms(1);
Write_Cmd_Data(0x0049,0x013F); delayms(1);
Write_Cmd_Data(0x004A,0x0000); delayms(1);
Write_Cmd_Data(0x004B,0x0000); delayms(1);
Write_Cmd_Data(0x0044,0xEF00); delayms(1);
Write_Cmd_Data(0x0045,0x0000); delayms(1);
Write_Cmd_Data(0x0046,0x013F); delayms(1);
Write_Cmd_Data(0x0030,0x0707); delayms(1);
Write_Cmd_Data(0x0031,0x0204); delayms(1);
Write_Cmd_Data(0x0032,0x0204); delayms(1);
Write_Cmd_Data(0x0033,0x0502); delayms(1);
Write_Cmd_Data(0x0034,0x0507); delayms(1);
Write_Cmd_Data(0x0035,0x0204); delayms(1);
Write_Cmd_Data(0x0036,0x0204); delayms(1);
Write_Cmd_Data(0x0037,0x0502); delayms(1);
Write_Cmd_Data(0x003A,0x0302); delayms(1);
Write_Cmd_Data(0x003B,0x0302); delayms(1);
Write_Cmd_Data(0x0023,0x0000); delayms(1);
Write_Cmd_Data(0x0024,0x0000); delayms(1);
Write_Cmd_Data(0x0025,0x8000); delayms(1);
Write_Cmd_Data(0x004f,0); //行首址0
Write_Cmd_Data(0x004e,0); //列首址0
Write_Cmd(0x00,0X22);
}
|
|