当前位置:网站首页>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 .
边栏推荐
- Tableapi & SQL and MySQL insert data of Flink
- [cloud trend] new wind direction in June! Cloud store hot list announced
- Tableapi & SQL and Kafka message insertion in Flink
- Raytheon technology rushes to the Beijing stock exchange and plans to raise 540million yuan
- Phpcms background upload picture button cannot be clicked
- Filter & (login interception)
- How to realize clock signal frequency division?
- 微信小程序01-底部导航栏设置
- Survey of intrusion detection systems:techniques, datasets and challenges
- idea中新建的XML文件变成普通文件的解决方法.
猜你喜欢
Hardware design guide for s32k1xx microcontroller
【目标跟踪】|STARK
MySQL service is starting. MySQL service cannot be started. Solution
【STM32学习】 基于STM32 USB存储设备的w25qxx自动判断容量检测
An intrusion detection model
Guide de conception matérielle du microcontrôleur s32k1xx
Raytheon technology rushes to the Beijing stock exchange and plans to raise 540million yuan
微信小程序03-文字一左一右显示,行内块元素居中
异常检测中的浅层模型与深度学习模型综述(A Unifying Review of Deep and Shallow Anomaly Detection)
Survey of intrusion detection systems:techniques, datasets and challenges
随机推荐
《性能之巅第2版》阅读笔记(五)--file-system监测
微信公众号订阅消息 wx-open-subscribe 的实现及闭坑指南
It's settled! 2022 Hainan secondary cost engineer examination time is determined! The registration channel has been opened!
【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(三)
MySQL审计插件介绍
Task.Run(), Task.Factory.StartNew() 和 New Task() 的行为不一致分析
DirectX repair tool v4.1 public beta! [easy to understand]
MySQL 服务正在启动 MySQL 服务无法启动解决途径
厦门灌口镇田头村特色农产品 甜头村特色农产品蚂蚁新村7.1答案
Connect the ABAP on premises system to the central inspection system for custom code migration
opencv学习笔记五--文件扫描+OCR文字识别
【一天学awk】条件与循环
Wechat applet 02 - Implementation of rotation map and picture click jump
Qt+pcl Chapter 9 point cloud reconstruction Series 2
Build MySQL master-slave server under Ubuntu 14.04
雷神科技冲刺北交所,拟募集资金5.4亿元
微信小程序03-文字一左一右显示,行内块元素居中
opencv学习笔记六--图像拼接
重回榜首的大众,ID依然乏力
[lock] redis lock handles concurrency atomicity