STM32F429驱动7寸屏

2019-07-21 00:47发布

最近在stm32f429 discover板上驱动7寸屏(800X480),stm32f429内部带屏的驱动器LTDC,之前在r板上运行网上的emwin很正常,但是屏幕是2.4寸的,现在改为7寸屏,可以显示但是显示的尺寸跟分辨率不对,我的相关配置如下,这个问题让我纠结好久了,希望知道的大大给我指点一下,不胜感激,必有重谢!
另附图片 [mw_shl_code=c,true]#define LCD_PIXEL_WIDTH ((uint16_t)800) #define LCD_PIXEL_HEIGHT ((uint16_t)480) #define HSW ((uint16_t)48) /* Horizontal synchronization */ #define HBP ((uint16_t)40) /* Horizontal back porch */ #define HFP ((uint16_t)40) /* Horizontal front porch */ #define VSW ((uint16_t)3) /* Vertical synchronization */ #define VBP ((uint16_t)29) /* Vertical back porch */ #define VFP ((uint16_t)13) /* Vertical front porch */ #define HSTART (HBP) #define HSTOP (LCD_PIXEL_WIDTH+HSTART) #define VSTART (VBP) #define VSTOP (LCD_PIXEL_HEIGHT+VSTART) #define LCD_FRAME_BUFFER ((uint32_t)0xD0000000) //LCD?????????×???·?????·SDRAM #define BUFFER_OFFSET ((uint32_t)0x60000) void LCD_Init(void)函数中: RCC_PLLSAIConfig(192, 7, 4); RCC_LTDCCLKDivConfig(RCC_PLLSAIDivR_Div2);//RCC_PLLSAIDivR_Div8 /* Enable PLLSAI Clock */ RCC_PLLSAICmd(ENABLE); /* Wait for PLLSAI activation */ while(RCC_GetFlagStatus(RCC_FLAG_PLLSAIRDY) == RESET) { } //?±?ò?????????????ó????×??? /* Timing configuration */ /* Configure horizontal synchronization width */ LTDC_InitStruct.LTDC_HorizontalSync = HSW-1; /* Configure vertical synchronization height */ LTDC_InitStruct.LTDC_VerticalSync = VSW-1; /* Configure accumulated horizontal back porch */ LTDC_InitStruct.LTDC_AccumulatedHBP = HBP-1; /* Configure accumulated vertical back porch */ LTDC_InitStruct.LTDC_AccumulatedVBP = VBP-1; /* Configure accumulated active width */ LTDC_InitStruct.LTDC_AccumulatedActiveW = LCD_PIXEL_WIDTH + HBP-1; /* Configure accumulated active height */ LTDC_InitStruct.LTDC_AccumulatedActiveH = LCD_PIXEL_HEIGHT + VBP-1; /* Configure total width */ LTDC_InitStruct.LTDC_TotalWidth = LCD_PIXEL_WIDTH + HBP + HFP-1; /* Configure total height */ LTDC_InitStruct.LTDC_TotalHeigh = LCD_PIXEL_HEIGHT + VBP + VFP-1; LTDC_Init(&LTDC_InitStruct); static void _LCD_InitController(int LayerIndex) 函数中: xSize = LCD_GetXSizeEx(LayerIndex); ySize = LCD_GetYSizeEx(LayerIndex); LTDC_Layer_InitStruct.LTDC_HorizontalStart = HSTART; LTDC_Layer_InitStruct.LTDC_HorizontalStop = (xSize + HSTART-1); LTDC_Layer_InitStruct.LTDC_VerticalStart = VSTART; LTDC_Layer_InitStruct.LTDC_VerticalStop = (ySize + VSTART-1);[/mw_shl_code] [mw_shl_code=c,true] [/mw_shl_code]
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
18条回答
hukee
1楼-- · 2019-07-22 06:22
回复【13楼】麦田稻草:
---------------------------------
我试过了272x480的屏,不加SDRAM ,可以将屏刷成单颜 {MOD},但是要移植个emwin就不知道怎么弄了
abcdotaabc
2楼-- · 2019-07-22 06:28
楼主,LTDC_AccumulatedHBP表示的是HSW+HBP,但是你的设置却是:
LTDC_InitStruct.LTDC_HorizontalSync = HSW-1;
LTDC_InitStruct.LTDC_AccumulatedHBP = HBP-1;//这里应该写成HSW+HBP-1
这样就导致了LTDC_AccumulatedHBP < LTDC_HorizontalSync了,这就不对了。所以后面的参数都应该加上HSW才对。
不知道楼主说搞定了是怎样修改硬件来解决的?
heitu103
3楼-- · 2019-07-22 08:55
楼主可以分享下硬件哪里出问题了吗?我现在也在研究,根据官方的原理图画的硬件,成了RGB666,去掉R2,B2,可是显示还是有点问题
hexiaolong2008
4楼-- · 2019-07-22 11:51
 精彩回答 2  元偷偷看……
墨如风0205
5楼-- · 2019-07-22 16:11
 精彩回答 2  元偷偷看……
maodewen
6楼-- · 2019-07-22 20:26
回复【12楼】maodewen:
---------------------------------
楼主,我感觉我也遇到了同样的问题,你布线方面有什么讲究么?能分享下么,谢谢了

一周热门 更多>