野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 16035|回复: 3

求助:429开发板双层显示闪烁的问题

[复制链接]
发表于 2018-3-20 09:07:45 | 显示全部楼层 |阅读模式
本帖最后由 lg75 于 2018-3-20 11:25 编辑

实测《21-LTDC—液晶显示汉字(显示任意大小)》的例程,发现双层显示使用的都是ARGB1555格式,如果都换成RGB565,或者一层是ARGB15555另外一层使用RGB565,则屏幕都会闪烁。

求解,谢谢!

void LCD_LayerInit(void)
{
LTDC_Layer_InitTypeDef LTDC_Layer_InitStruct;

  /* 层窗口配置 */
  /* 配置本层的窗口边界,注意这些参数是包含HBP HSW VBP VSW的 */   
        //一行的第一个起始像素,该成员值应用为 (LTDC_InitStruct.LTDC_AccumulatedHBP+1)的值
        LTDC_Layer_InitStruct.LTDC_HorizontalStart = HBP + HSW;
        //一行的最后一个像素,该成员值应用为 (LTDC_InitStruct.LTDC_AccumulatedActiveW)的值
        LTDC_Layer_InitStruct.LTDC_HorizontalStop = HSW+HBP+LCD_PIXEL_WIDTH-1;
        //一列的第一个起始像素,该成员值应用为 (LTDC_InitStruct.LTDC_AccumulatedVBP+1)的值
        LTDC_Layer_InitStruct.LTDC_VerticalStart =  VBP + VSW;
        //一列的最后一个像素,该成员值应用为 (LTDC_InitStruct.LTDC_AccumulatedActiveH)的值
        LTDC_Layer_InitStruct.LTDC_VerticalStop = VSW+VBP+LCD_PIXEL_HEIGHT-1;

/* Pixel Format configuration*/
LTDC_Layer_InitStruct.LTDC_PixelFormat = LTDC_Pixelformat_RGB565;
/* Alpha constant (255 totally opaque) */
LTDC_Layer_InitStruct.LTDC_ConstantAlpha = 255;
/* Default Color configuration (configure A,R,G,B component values) */
LTDC_Layer_InitStruct.LTDC_DefaultColorBlue = 0;
LTDC_Layer_InitStruct.LTDC_DefaultColorGreen = 0;
LTDC_Layer_InitStruct.LTDC_DefaultColorRed = 0;
LTDC_Layer_InitStruct.LTDC_DefaultColorAlpha = 0;
/* Configure blending factors */
LTDC_Layer_InitStruct.LTDC_BlendingFactor_1 = LTDC_BlendingFactor1_CA;
LTDC_Layer_InitStruct.LTDC_BlendingFactor_2 = LTDC_BlendingFactor2_CA;

/* the length of one line of pixels in bytes + 3 then :
Line Lenth = Active high width x number of bytes per pixel + 3
Active high width         = LCD_PIXEL_WIDTH
number of bytes per pixel = 2    (pixel_format : RGB565)
*/
LTDC_Layer_InitStruct.LTDC_CFBLineLength = ((LCD_PIXEL_WIDTH * 2) + 3);
/* the pitch is the increment from the start of one line of pixels to the
start of the next line in bytes, then :
Pitch = Active high width x number of bytes per pixel */
LTDC_Layer_InitStruct.LTDC_CFBPitch = (LCD_PIXEL_WIDTH * 2);

/* Configure the number of lines */
LTDC_Layer_InitStruct.LTDC_CFBLineNumber = LCD_PIXEL_HEIGHT;

/* Start Address configuration : the LCD Frame buffer is defined on SDRAM */
LTDC_Layer_InitStruct.LTDC_CFBStartAdress = LCD_FRAME_BUFFER;

/* Initialize LTDC layer 1 */
LTDC_LayerInit(LTDC_Layer1, <DC_Layer_InitStruct);

  /* Configure Layer2 */
/* Pixel Format configuration*/
LTDC_Layer_InitStruct.LTDC_PixelFormat = LTDC_Pixelformat_ARGB1555;

  /* Start Address configuration : the LCD Frame buffer is defined on SDRAM w/ Offset */
LTDC_Layer_InitStruct.LTDC_CFBStartAdress = LCD_FRAME_BUFFER + BUFFER_OFFSET;

  /* Configure blending factors */
LTDC_Layer_InitStruct.LTDC_BlendingFactor_1 = LTDC_BlendingFactor1_PAxCA;
LTDC_Layer_InitStruct.LTDC_BlendingFactor_2 = LTDC_BlendingFactor2_PAxCA;

  /* Initialize LTDC layer 2 */
LTDC_LayerInit(LTDC_Layer2, <DC_Layer_InitStruct);

  /* LTDC configuration reload */
LTDC_ReloadConfig(LTDC_IMReload);

  /* Enable foreground & background Layers */
LTDC_LayerCmd(LTDC_Layer1, ENABLE);
LTDC_LayerCmd(LTDC_Layer2, ENABLE);

  /* LTDC configuration reload */
LTDC_ReloadConfig(LTDC_IMReload);

  /* Set default font */
LCD_SetFont(&LCD_DEFAULT_FONT);

  /* dithering activation */
LTDC_DitherCmd(ENABLE);
}


回复

使用道具 举报

发表于 2018-3-20 10:48:17 | 显示全部楼层
感觉429性能不够,特殊点的都会闪烁
回复 支持 反对

使用道具 举报

发表于 2018-3-20 13:17:42 | 显示全部楼层
RGB1555的格式应该是合适的。可以随行控制背景层的透明或不透明。
系统一般不会闪烁。偶然会稍有闪烁。估计改变液晶的工作频率会改善。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-3-21 07:32:22 | 显示全部楼层
老福大 发表于 2018-3-20 13:17
RGB1555的格式应该是合适的。可以随行控制背景层的透明或不透明。
系统一般不会闪烁。偶然会稍有闪烁。估 ...

我需要背景层是565,前景层是1555,但是设置后闪烁比较明显。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2025-12-6 06:18 , Processed in 0.037452 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表