当前位置:网站首页>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 .
边栏推荐
- Basic operations of SQL database
- What data capabilities do data product managers need to master?
- Survey of intrusion detection systems:techniques, datasets and challenges
- Wechat official account subscription message Wx open subscribe implementation and pit closure guide
- 榨汁机UL982测试项目有哪些
- 【一天学awk】条件与循环
- 《QT+PCL第六章》点云配准icp系列3
- 《QT+PCL第六章》点云配准icp系列4
- opencv学习笔记六--图像拼接
- 做空蔚来的灰熊,以“碰瓷”中概股为生?
猜你喜欢

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

MySQL审计插件介绍

入侵检测模型(An Intrusion-Detection Model)

cmake 基本使用过程
SQL常用的四个排序函数梳理

The solution to turn the newly created XML file into a common file in idea

The data in the database table recursively forms a closed-loop data. How can we get these data

MySQL审计插件介绍

微信网页订阅消息实现

【LeetCode】16、最接近的三数之和
随机推荐
【天线】【3】CST一些快捷键
Returning to the top of the list, the ID is still weak
Tableapi & SQL and MySQL insert data of Flink
微信小程序02-轮播图实现与图片点击跳转
竣达技术丨室内空气环境监测终端 pm2.5、温湿度TVOC等多参数监测
使用swiper制作手机端轮播图
Wechat applet 02 - Implementation of rotation map and picture click jump
购物商城6.27待完成
Shopping mall 6.27 to be completed
Task. Run(), Task. Factory. Analysis of behavior inconsistency between startnew() and new task()
竣达技术丨多台精密空调微信云监控方案
Is JPMorgan futures safe to open an account? What is the account opening method of JPMorgan futures company?
openssl客户端编程:一个不起眼的函数导致的SSL会话失败问题
Opencv learning note 4 -- bank card number recognition
异常检测中的浅层模型与深度学习模型综述(A Unifying Review of Deep and Shallow Anomaly Detection)
采集数据工具推荐,以及采集数据列表详细图解流程
Introduction to MySQL audit plug-in
Solid smart contract development - easy to get started
Tableapi & SQL and MySQL data query of Flink
DirectX repair tool v4.1 public beta! [easy to understand]