当前位置:网站首页>Stm32f4-tft-spi timing logic analyzer commissioning record
Stm32f4-tft-spi timing logic analyzer commissioning record
2022-07-01 15:24:00 【Please call me Chang Sicong】
debugging TFT I don't know whether the data is written TFT
Connect the logic analyzer to see ,
Because I'm not sure about software SPI Whether it can be used , So first use hardware SPI test
Then switch to Software SPI
It is right to test the timing , Normal display 
The code is as follows 
Then turn on the logic analyzer I use it logic2, Set as follows , Pay attention to the settings in the red box ,( Change it to CPHA=1 The displayed data is not right )
You can see that all the data written is 0xF800, Macro definition RGB565 Red is 0xF800


Look at what else is written in this write fill function ,
void LCD_direction(u8 direction)
{
lcddev.setxcmd=0x2A;
lcddev.setycmd=0x2B;
lcddev.wramcmd=0x2C;
switch(direction){
case 0:
lcddev.width=LCD_W;
lcddev.height=LCD_H;
lcddev.xoffset=52;
lcddev.yoffset=40;
LCD_WriteReg(0x36,0);//BGR==1,MY==0,MX==0,MV==0
break;
case 1: //select direction=1
lcddev.width=LCD_H;
lcddev.height=LCD_W;
lcddev.xoffset=40;
lcddev.yoffset=53;
LCD_WriteReg(0x36,(1<<6)|(1<<5));//BGR==1,MY==1,MX==0,MV==1
break;
case 2:
lcddev.width=LCD_W;
lcddev.height=LCD_H;
lcddev.xoffset=53;
lcddev.yoffset=40;
LCD_WriteReg(0x36,(1<<6)|(1<<7));//BGR==1,MY==0,MX==0,MV==0
break;
case 3:
lcddev.width=LCD_H;
lcddev.height=LCD_W;
lcddev.xoffset=40;
lcddev.yoffset=52;
LCD_WriteReg(0x36,(1<<7)|(1<<5));//BGR==1,MY==1,MX==0,MV==1
break;
default:break;
}
}
void LCD_WriteRAM_Prepare(void)
{
LCD_WR_REG(lcddev.wramcmd); //lcddev.wramcmd=0x2C
}
lcddev.setxcmd Parameter in void LCD_direction(u8 direction) There are updates inside ,lcddev.setxcmd=0x2A
#define LCD_W 135 //TFT 1.14
#define LCD_H 240
void LCD_Fill(u16 sx,u16 sy,u16 ex,u16 ey,u16 color)
{
u16 i,j;
u16 width=ex-sx+1; // Get the width of the fill
u16 height=ey-sy+1; // Height
LCD_SetWindows(sx,sy,ex,ey);// Set the display window
for(i=0;i<height;i++)
{
for(j=0;j<width;j++)
Lcd_WriteData_16Bit(color); // Write data
}
LCD_SetWindows(0,0,lcddev.width-1,lcddev.height-1);// The recovery window is set to full screen
}
void LCD_SetWindows(u16 xStar, u16 yStar,u16 xEnd,u16 yEnd)
{
LCD_WR_REG(lcddev.setxcmd); //0x2A
LCD_WR_DATA((xStar+lcddev.xoffset)>>8); //(0+40)>>8=0x00
LCD_WR_DATA(xStar+lcddev.xoffset); //0x28
LCD_WR_DATA((xEnd+lcddev.xoffset)>>8); //(240+40)>>8=0x01
LCD_WR_DATA(xEnd+lcddev.xoffset); //0x18
LCD_WR_REG(lcddev.setycmd); //0x2B
LCD_WR_DATA((yStar+lcddev.yoffset)>>8); //0+53 >>8=0x00
LCD_WR_DATA(yStar+lcddev.yoffset); //0x35
LCD_WR_DATA((yEnd+lcddev.yoffset)>>8); //135+53 >>8=0x00
LCD_WR_DATA(yEnd+lcddev.yoffset); //0xBC
LCD_WriteRAM_Prepare(); // Start writing GRAM //lcddev.wramcmd=0x2C
}
Therefore, the beginning of the data should be :
0x2A–0x00–0x28–0x01–0x18------0x2B–0x00–0x35–0x00–0x35–0x00–0xBC-----0x2C-----0xF8-0x00–0xF8-0x00…
Data captured by logic analyzer :
The captured data is consistent with the calculation .
边栏推荐
- Flink 系例 之 TableAPI & SQL 与 Kafka 消息获取
- Raytheon technology rushes to the Beijing stock exchange and plans to raise 540million yuan
- Flink 系例 之 TableAPI & SQL 与 MYSQL 插入数据
- Can I choose to open an account on Great Wall Securities? Is it safe?
- Storage form of in-depth analysis data in memory
- MySQL 服务正在启动 MySQL 服务无法启动解决途径
- An intrusion detection model
- Go zero actual combat demo (I)
- [Cloudera][ImpalaJDBCDriver](500164)Error initialized or created transport for authentication
- Wechat applet 02 - Implementation of rotation map and picture click jump
猜你喜欢

STM32F411 SPI2输出错误,PB15无脉冲调试记录【最后发现PB15与PB14短路】

微信公众号订阅消息 wx-open-subscribe 的实现及闭坑指南

Qt+pcl Chapter 9 point cloud reconstruction Series 2

智能运维实战:银行业务流程及单笔交易追踪

异常检测中的浅层模型与深度学习模型综述(A Unifying Review of Deep and Shallow Anomaly Detection)

IDEA全局搜索快捷键(ctrl+shift+F)失效修复

Hardware design guide for s32k1xx microcontroller

【ROS进阶篇】第五讲 ROS中的TF坐标变换

张驰咨询:锂电池导入六西格玛咨询降低电池容量衰减

opencv学习笔记四--银行卡号识别
随机推荐
STM32F411 SPI2输出错误,PB15无脉冲调试记录【最后发现PB15与PB14短路】
Phpcms background upload picture button cannot be clicked
《QT+PCL第六章》点云配准icp系列4
Flink 系例 之 TableAPI & SQL 与 MYSQL 数据查询
Sort out the four commonly used sorting functions in SQL
厦门灌口镇田头村特色农产品 甜头村特色农产品蚂蚁新村7.1答案
《QT+PCL第六章》点云配准icp系列6
Junda technology indoor air environment monitoring terminal PM2.5, temperature and humidity TVOC and other multi parameter monitoring
Junda technology - wechat cloud monitoring scheme for multiple precision air conditioners
TypeScript:const
These three online PS tools should be tried
张驰咨询:锂电池导入六西格玛咨询降低电池容量衰减
SAP s/4hana: one code line, many choices
Task.Run(), Task.Factory.StartNew() 和 New Task() 的行为不一致分析
【一天学awk】函数与自定义函数
雷神科技冲刺北交所,拟募集资金5.4亿元
Demand prioritization method based on value quantification
What are the test items of juicer ul982
Storage form of in-depth analysis data in memory
What are the EN ISO 20957 certification standards for common fitness equipment