完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
`
这是时序,从上到下,分别是CS、SLK 、DC、 SDI
从上到下是CS SLK RESET 硬件也检查了,数据都输入到了屏幕里。但是屏幕一直只是亮屏,不能刷屏,感觉是没有初始化成功。但是找不到原因了,求助大神帮帮忙!! 程序是从STM32移植到dsp28335的 以下是程序 #define LCD_SDI GpioDataRegs.GPADAT.bit.GPIO16 #define LCD_SCK GpioDataRegs.GPADAT.bit.GPIO18 #define LCD_CS GpioDataRegs.GPADAT.bit.GPIO19 #define LCD_REST GpioDataRegs.GPADAT.bit.GPIO2 #define LCD_DC GpioDataRegs.GPADAT.bit.GPIO3 main() { InitSysCtrl(); DINT;//禁止CPU中断 InitPieCtrl();//初始化PIE控制寄存器 IER = 0x0000;//清除所有中断标志位 IFR = 0x0000; InitPieVectTable();//初始化中断向量表 EALLOW; GpioCtrlRegs.GPAMUX1.all = 0x00000000; // All GPIO GpioCtrlRegs.GPAMUX2.all = 0x00000000; // All GPIO GpioCtrlRegs.GPADIR.bit.GPIO2=1; GpioCtrlRegs.GPADIR.bit.GPIO3=1; GpioCtrlRegs.GPADIR.bit.GPIO16=1; GpioCtrlRegs.GPADIR.bit.GPIO18=1; GpioCtrlRegs.GPADIR.bit.GPIO19=1; EDIS; Lcd_Init(); LCD_Clear(WHITE); BACK_COLOR=BLACK;;POINT_COLOR=WHITE; while(1) { Lcd_Init(); LCD_Clear(RED); delay_ms(1000); LCD_Clear(GREEN); delay_ms(1000); LCD_Clear(BLUE); delay_ms(1000); showhanzi32(0,0,0); showhanzi32(40,0,1); showhanzi32(80,0,2); delay_ms(1000); } } void Lcd_Init(void) { LCD_CS =1; LCD_REST=1; delay_ms(300); LCD_REST=0; delay_ms(500); // delay 20 ms LCD_REST=1; delay_ms(300); // delay 20 ms LCD_CS=0; LCD_WR_REG(0xCF); LCD_WR_DATA8(0x00); LCD_WR_DATA8(0xD9); LCD_WR_DATA8(0X30); LCD_WR_REG(0xED); LCD_WR_DATA8(0x64); LCD_WR_DATA8(0x03); LCD_WR_DATA8(0X12); LCD_WR_DATA8(0X81); LCD_WR_REG(0xE8); LCD_WR_DATA8(0x85); LCD_WR_DATA8(0x10); LCD_WR_DATA8(0x78); LCD_WR_REG(0xCB); LCD_WR_DATA8(0x39); LCD_WR_DATA8(0x2C); LCD_WR_DATA8(0x00); LCD_WR_DATA8(0x34); LCD_WR_DATA8(0x02); LCD_WR_REG(0xF7); LCD_WR_DATA8(0x20); LCD_WR_REG(0xEA); LCD_WR_DATA8(0x00); LCD_WR_DATA8(0x00); LCD_WR_REG(0xC0); //Power control LCD_WR_DATA8(0x21); //VRH[5:0] LCD_WR_REG(0xC1); //Power control LCD_WR_DATA8(0x12); //SAP[2:0];BT[3:0] LCD_WR_REG(0xC5); //VCM control LCD_WR_DATA8(0x32); LCD_WR_DATA8(0x3C); LCD_WR_REG(0xC7); //VCM control2 LCD_WR_DATA8(0XC1); LCD_WR_REG(0x36); // Memory Access Control LCD_WR_DATA8(0x08); LCD_WR_REG(0x3A); LCD_WR_DATA8(0x55); LCD_WR_REG(0xB1); LCD_WR_DATA8(0x00); LCD_WR_DATA8(0x18); LCD_WR_REG(0xB6); // Display Function Control LCD_WR_DATA8(0x0A); LCD_WR_DATA8(0xA2); LCD_WR_REG(0xF2); // 3Gamma Function Disable LCD_WR_DATA8(0x00); LCD_WR_REG(0x26); //Gamma curve selected LCD_WR_DATA8(0x01); LCD_WR_REG(0xE0); //Set Gamma LCD_WR_DATA8(0x0F); LCD_WR_DATA8(0x20); LCD_WR_DATA8(0x1E); LCD_WR_DATA8(0x09); LCD_WR_DATA8(0x12); LCD_WR_DATA8(0x0B); LCD_WR_DATA8(0x50); LCD_WR_DATA8(0XBA); LCD_WR_DATA8(0x44); LCD_WR_DATA8(0x09); LCD_WR_DATA8(0x14); LCD_WR_DATA8(0x05); LCD_WR_DATA8(0x23); LCD_WR_DATA8(0x21); LCD_WR_DATA8(0x00); LCD_WR_REG(0XE1); //Set Gamma LCD_WR_DATA8(0x00); LCD_WR_DATA8(0x19); LCD_WR_DATA8(0x19); LCD_WR_DATA8(0x00); LCD_WR_DATA8(0x12); LCD_WR_DATA8(0x07); LCD_WR_DATA8(0x2D); LCD_WR_DATA8(0x28); LCD_WR_DATA8(0x3F); LCD_WR_DATA8(0x02); LCD_WR_DATA8(0x0A); LCD_WR_DATA8(0x08); LCD_WR_DATA8(0x25); LCD_WR_DATA8(0x2D); LCD_WR_DATA8(0x0F); LCD_WR_REG(0x11); //Exit Sleep delay_ms(120); LCD_WR_REG(0x29); //Display on LCD_Clear(WHITE); } void LCD_WR_DATA8(char da) { int i; LCD_DC=1; LCD_CS=0; for (i = 0; i < 8; i++) { if (da & 0x80) { LCD_SDI=1; } else LCD_SDI=0; LCD_SCK=0; LCD_SCK=1; da <<= 1; } LCD_CS=1; } void LCD_WR_DATA(int da) { LCD_WR_DATA8(da >> 8); LCD_WR_DATA8(da); } void LCD_WR_REG(char da) { int i; LCD_DC=0; LCD_CS=0; for (i = 0; i < 8; i++) { if (da & 0x80) { LCD_SDI=1; } else LCD_SDI=0; LCD_SCK=0; LCD_SCK=1; da <<= 1; } LCD_CS=1; } void LCD_WR_REG_DATA(int reg,int da) { LCD_WR_REG(reg); LCD_WR_DATA(da); } ` |
|
相关推荐
11个回答
|
|
你可以尝试读lcd的ID寄存器,如果能读出,说明连接没问题,找程序原因
|
|
|
|
好的,谢谢,我试一下,我找找读ID的程序,现在的程序没有写读取数据的函数。 |
|
|
|
请问会不会是波形的问题?我觉得波形有点丑,不知道有没有影响呢? |
|
|
|
|
|
|
|
我现在屏幕的几根信号线,我都用示波器直接按在屏幕的排线上测了,都输进去了,屏幕换了好几块了。初始化程序也是厂家给的,lcd.c也是直接移植的,逻辑没改,我也对了时序,没有问题,所以现在就很疑惑,真的想不到办法了,读lcd的ID的程序我暂时还没有找到 |
|
|
|
我现在屏幕的几根信号线,我都用示波器直接按在屏幕的排线上测了,都输进去了,屏幕换了好几块了。初始化程序也是厂家给的,lcd.c也是直接移植的,逻辑没改,我也对了时序,没有问题,所以现在就很疑惑,真的想不到办法了,读lcd的ID的程序我暂时还没有找到 |
|
|
|
我现在屏幕的几根信号线,我都用示波器直接按在屏幕的排线上测了,都输进去了,屏幕换了好几块了。初始化程序也是厂家给的,lcd.c也是直接移植的,逻辑没改,我也对了时序,没有问题,所以现在就很疑惑,真的想不到办法了,读lcd的ID的程序我暂时还没有找到 |
|
|
|
int LCD_RD_DATA(void)
{ int i,data=0; LCD_DC=1; LCD_CS=0; for (i = 7; i >= 0; i--) { data+=LCD_SDO< LCD_SCK=0; LCD_SCK=1; } LCD_CS=1; return data; } void Lcd_Init(void) { int ID; LCD_CS =1; LCD_REST=1; delay_ms(300); LCD_REST=0; delay_ms(500); // delay 20 ms LCD_REST=1; delay_ms(300); // delay 20 ms //读取41 LCD_WR_REG(0XD3); ID = LCD_RD_DATA(); //dummy read ID= LCD_RD_DATA(); //读到0X00 ID=LCD_RD_DATA(); //读取93 ID<<=8; ID|=LCD_RD_DATA(); LCD_CS=0; LCD_WR_REG(0xCF); LCD_WR_DATA8(0x00); LCD_WR_DATA8(0xD9); LCD_WR_DATA8(0X30); LCD_WR_REG(0xED); LCD_WR_DATA8(0x64); LCD_WR_DATA8(0x03); LCD_WR_DATA8(0X12); LCD_WR_DATA8(0X81); LCD_WR_REG(0xE8); LCD_WR_DATA8(0x85); LCD_WR_DATA8(0x10); LCD_WR_DATA8(0x78); LCD_WR_REG(0xCB); LCD_WR_DATA8(0x39); LCD_WR_DATA8(0x2C); LCD_WR_DATA8(0x00); LCD_WR_DATA8(0x34); LCD_WR_DATA8(0x02); LCD_WR_REG(0xF7); LCD_WR_DATA8(0x20); LCD_WR_REG(0xEA); LCD_WR_DATA8(0x00); LCD_WR_DATA8(0x00); LCD_WR_REG(0xC0); //Power control LCD_WR_DATA8(0x21); //VRH[5:0] LCD_WR_REG(0xC1); //Power control LCD_WR_DATA8(0x12); //SAP[2:0];BT[3:0] LCD_WR_REG(0xC5); //VCM control LCD_WR_DATA8(0x32); LCD_WR_DATA8(0x3C); LCD_WR_REG(0xC7); //VCM control2 LCD_WR_DATA8(0XC1); LCD_WR_REG(0x36); // Memory Access Control LCD_WR_DATA8(0x08); LCD_WR_REG(0x3A); LCD_WR_DATA8(0x55); LCD_WR_REG(0xB1); LCD_WR_DATA8(0x00); LCD_WR_DATA8(0x18); LCD_WR_REG(0xB6); // Display Function Control LCD_WR_DATA8(0x0A); LCD_WR_DATA8(0xA2); LCD_WR_REG(0xF2); // 3Gamma Function Disable LCD_WR_DATA8(0x00); LCD_WR_REG(0x26); //Gamma curve selected LCD_WR_DATA8(0x01); LCD_WR_REG(0xE0); //Set Gamma LCD_WR_DATA8(0x0F); LCD_WR_DATA8(0x20); LCD_WR_DATA8(0x1E); LCD_WR_DATA8(0x09); LCD_WR_DATA8(0x12); LCD_WR_DATA8(0x0B); LCD_WR_DATA8(0x50); LCD_WR_DATA8(0XBA); LCD_WR_DATA8(0x44); LCD_WR_DATA8(0x09); LCD_WR_DATA8(0x14); LCD_WR_DATA8(0x05); LCD_WR_DATA8(0x23); LCD_WR_DATA8(0x21); LCD_WR_DATA8(0x00); LCD_WR_REG(0XE1); //Set Gamma LCD_WR_DATA8(0x00); LCD_WR_DATA8(0x19); LCD_WR_DATA8(0x19); LCD_WR_DATA8(0x00); LCD_WR_DATA8(0x12); LCD_WR_DATA8(0x07); LCD_WR_DATA8(0x2D); LCD_WR_DATA8(0x28); LCD_WR_DATA8(0x3F); LCD_WR_DATA8(0x02); LCD_WR_DATA8(0x0A); LCD_WR_DATA8(0x08); LCD_WR_DATA8(0x25); LCD_WR_DATA8(0x2D); LCD_WR_DATA8(0x0F); LCD_WR_REG(0x11); //Exit Sleep delay_ms(120); LCD_WR_REG(0x29); //Display on LCD_Clear(WHITE); } 没有找到读ID的程序,这是我自己写的读取ID的程序,现在读到的都是0。 |
|
|
|
我这里用的ILI9488,屏幕可以显示颜色和英文,就是中文显示一直写不好,不知道什么原因
|
|
|
|
可以显示了,我用的是16位数据模式,没用SPI
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
基于 DSP5509 进行数字图像处理中 Sobel 算子边缘检测的硬件连接电路图
2263 浏览 0 评论
674 浏览 0 评论
普中科技F28335开发板中,如何使用aic23播放由代码生成的正弦波
2698 浏览 0 评论
3467 浏览 1 评论
1187 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-19 13:33 , Processed in 1.140237 second(s), Total 108, Slave 86 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号