当前位置:网站首页>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 .
边栏推荐
- Guide de conception matérielle du microcontrôleur s32k1xx
- 微信网页订阅消息实现
- Implementation of deploying redis sentry in k8s
- 智能运维实战:银行业务流程及单笔交易追踪
- leetcode:329. Longest increasing path in matrix
- Qt+pcl Chapter 6 point cloud registration ICP series 4
- Survey of intrusion detection systems:techniques, datasets and challenges
- Wechat applet 02 - Implementation of rotation map and picture click jump
- 微信小程序03-文字一左一右显示,行内块元素居中
- Tableapi & SQL and MySQL insert data of Flink
猜你喜欢

It's settled! 2022 Hainan secondary cost engineer examination time is determined! The registration channel has been opened!

张驰咨询:家电企业用六西格玛项目减少客户非合理退货案例

"Qt+pcl Chapter 6" point cloud registration ICP Series 6

OpenSSL client programming: SSL session failure caused by an insignificant function

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

Qt+pcl Chapter 9 point cloud reconstruction Series 2

竣达技术丨室内空气环境监测终端 pm2.5、温湿度TVOC等多参数监测

A unifying review of deep and shallow anomaly detection

Qt+pcl Chapter 6 point cloud registration ICP Series 2

Returning to the top of the list, the ID is still weak
随机推荐
How to realize clock signal frequency division?
Wechat applet 02 - Implementation of rotation map and picture click jump
Opencv Learning Notes 6 -- image feature [harris+sift]+ feature matching
Implementation of wechat web page subscription message
What data capabilities do data product managers need to master?
常见健身器材EN ISO 20957认证标准有哪些
Introduction to MySQL audit plug-in
It's settled! 2022 Hainan secondary cost engineer examination time is determined! The registration channel has been opened!
What is the relationship between network speed, broadband, bandwidth and traffic?
【一天学awk】条件与循环
《QT+PCL第六章》点云配准icp系列2
Hidden rules of the workplace that must be understood before 30
【STM32-USB-MSC问题求助】STM32F411CEU6 (WeAct)+w25q64+USB-MSC Flash用SPI2 读出容量只有520KB
Task. Run(), Task. Factory. Analysis of behavior inconsistency between startnew() and new task()
Survey of intrusion detection systems:techniques, datasets and challenges
Introduction to MySQL audit plug-in
【天线】【3】CST一些快捷键
【一天学awk】函数与自定义函数
Phpcms background upload picture button cannot be clicked
The last picture is seamlessly connected with the first picture in the swiper rotation picture