我买的开发板一开始调试TFTLCD并没有点亮,重新接线调试程序的过程,在偶然的机会驱动ILI9341成功了,由于反复的改动不知道哪里改动的有效的。但总算是能显示图像了,感觉挺好。
然后在运行EMWIN例程时,通过仿真器查看程序的运行,发现会进入硬件错误中断,屏幕也会显示的不完整,所以呢我接着我又改动了驱动部分,一不小心给弄的驱动不了ILI9341了(接线部分接好就一直没动)。
然后再调试也就没点亮过。请求哪位前辈给指点一二也好,看看我哪里出现错误了?
在这里奉上开发板相关的原理图和源程序(驱动部分我添加了注释,来回设置只是参数说明不准的)
源程序:
http://pan.baidu.com/s/1i52o30h
这是我的设置如下:
p.FSMC_AddressSetupTime = 0x02;
p.FSMC_AddressHoldTime = 0x00;
p.FSMC_DataSetupTime = 0x05;
p.FSMC_BusTurnAroundDuration = 0x00;
p.FSMC_CLKDivision = 0x00;
.
.
.
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &p;
FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p;
原理图
触摸屏和开发板
readWriteTiming.FSMC_AddressSetupTime = 0x01; //地址建立时间(ADDSET)为2个HCLK 1/36M=27ns
readWriteTiming.FSMC_AddressHoldTime = 0x00; //地址保持时间(ADDHLD)模式A未用到
readWriteTiming.FSMC_DataSetupTime = 0x07; // 数据保存时间为16个HCLK,因为液晶驱动IC的读数据的时候,速度不能太快,尤其对1289这个IC。
readWriteTiming.FSMC_BusTurnAroundDuration = 0x00;
readWriteTiming.FSMC_CLKDivision = 0x00;
readWriteTiming.FSMC_DataLatency = 0x00;
readWriteTiming.FSMC_AccessMode = FSMC_AccessMode_A; //模式A
writeTiming.FSMC_AddressSetupTime = 0x00; //地址建立时间(ADDSET)为1个HCLK
writeTiming.FSMC_AddressHoldTime = 0x00; //地址保持时间(A
writeTiming.FSMC_DataSetupTime = 0x04; ////数据保存时间为4个HCLK
writeTiming.FSMC_BusTurnAroundDuration = 0x00;
writeTiming.FSMC_CLKDivision = 0x00;
writeTiming.FSMC_DataLatency = 0x00;
writeTiming.FSMC_AccessMode = FSMC_AccessMode_A; //模式A
.
.
.
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &readWriteTiming; //读写时序
FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &writeTiming; //写时序
这样也可以
一周热门 更多>