天嵌 ARM开发社区

 找回密码
 注册
查看: 3574|回复: 10

(已解决)(求助)关于4.3寸屏幕 TQ2440_Test 屏幕中间白条的问题

[复制链接]
as12312a 发表于 2012-3-6 00:59:29 | 显示全部楼层 |阅读模式
本帖最后由 as12312a 于 2012-3-6 20:56 编辑

4.3寸屏幕 TQ2440_Test.bin 烧写到板子里运行的时候,天嵌的logo(Lcd_TFT_Test最后一屏)中间显示很大的白色矩形,屏幕底下的图错位了。。。是什么原因造成的呢?改了好久都没改出来,我把开机第一屏的条形图也改成天嵌logo ,出现了一样的问题,看着又显不像是函数的问题。。。 上面那个图是显示的图片,官方编译好的bin文件烧进去也是这样的问题。。
附上画图的函数
void Paint_Bmp(int x0,int y0,int h,int l,unsigned char bmp[])
{
        int x,y;
        U32 c;
        int p = 0;
        
    for( y = y0 ; y < l ; y++ )
    {
            for( x = x0 ; x < h ; x++ )
            {
                    c = bmp[p+1] | (bmp[p]<<8) ;
                                                                             
                        if ( ( (x0+x) < SCR_XSIZE_TFT) && ( (y0+y) < SCR_YSIZE_TFT) )
                                LCD_BUFFER[y0+y][x0+x] = c ;
                        
                    p = p + 2 ;
            }
    }
}

函数都是官方出厂时的函数,没改过,官方编译好的bin文件烧进去也是这样的问题。。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
embedsky_lhh 发表于 2012-3-6 09:08:09 | 显示全部楼层
你是烧到nand中测试还是是直接烧SDRAM里边?烧nand的话如果你的镜像编译出来比较大就修改下nand.c中的RdNF2SDRAM函数,把size改大点试试
 楼主| as12312a 发表于 2012-3-6 09:56:48 | 显示全部楼层
bin文件编译出来是538k
raominping 发表于 2012-3-6 13:06:27 | 显示全部楼层
画图函数本身没有问题哦。这个问题你可以这样试试。下载到NAND中,然后从NAND启动。一般就没问题了。还有你的主函数显示语句要给我们看看啊。。。。
 楼主| as12312a 发表于 2012-3-6 19:19:28 | 显示全部楼层
void Lcd_TFT_Init(void)
{
        Lcd_Init();
        Lcd_PowerEnable(0, 1);
        Lcd_EnvidOnOff(1);                //turn on vedio

        Lcd_ClearScr( (0x00<<11) | (0x00<<5) | (0x00) );  
        #define LCD_BLANK                12
        #define C_UP                ( LCD_XSIZE_TFT - LCD_BLANK*2 )
        #define C_RIGHT                ( LCD_XSIZE_TFT - LCD_BLANK*2 )
        #define V_BLACK                ( ( LCD_YSIZE_TFT - LCD_BLANK*4 ) / 6 )
        Glib_FilledRectangle( LCD_BLANK, LCD_BLANK, ( LCD_XSIZE_TFT - LCD_BLANK ), ( LCD_YSIZE_TFT - LCD_BLANK ),0x0000);                //fill a Rectangle with some color

        Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*0), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*1),0x001f);                //fill a Rectangle with some color
        Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*1), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*2),0x07e0);                //fill a Rectangle with some color
        Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*2), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*3),0xf800);                //fill a Rectangle with some color
        Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*3), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*4),0xffe0);                //fill a Rectangle with some color
        Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*4), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*5),0xf81f);                //fill a Rectangle with some color
        Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*5), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*6),0x07ff);                //fill a Rectangle with some color

        Glib_Line( LCD_BLANK,LCD_BLANK, (LCD_XSIZE_TFT-LCD_BLANK), (LCD_YSIZE_TFT-LCD_BLANK), 0x0000 ) ;
        Glib_Line( LCD_BLANK,(LCD_YSIZE_TFT-LCD_BLANK), (LCD_XSIZE_TFT-LCD_BLANK), LCD_BLANK, 0x0000 ) ;
        Glib_Line( (LCD_XSIZE_TFT/2),(LCD_BLANK*2 + V_BLACK*0), (LCD_XSIZE_TFT/2), (LCD_BLANK*2 + V_BLACK*6), 0x0000 ) ;
       
}

void Lcd_TFT_Test( void )
{
           Uart_Printf("\nTest TFT LCD!\n");

        Lcd_ClearScr( (0x00<<11) | (0x00<<5) | (0x00)  )  ;                //clear screen
        Uart_Printf( "\nDisplay Black! Press any key to continue!\n" );
        Uart_Getch() ;                //wait uart input

        Lcd_ClearScr( (0x1f<<11) | (0x3f<<5) | (0x1f)  )  ;                //clear screen
        Uart_Printf( "Display White! Press any key to continue!\n" );
        Uart_Getch() ;                //wait uart input

        Lcd_ClearScr( (0x00<<11) | (0x00<<5) | (0x1f)  )  ;                //clear screen
        Uart_Printf( "Display Blue! Press any key to continue!\n" );
        Uart_Getch() ;                //wait uart input

        Lcd_ClearScr( (0x00<<11) | (0x3f<<5) | (0x00)  )  ;                //clear screen
        Uart_Printf( "Display Green! Press any key to continue!\n" );
        Uart_Getch() ;                //wait uart input

        Lcd_ClearScr( (0x1f<<11) | (0x00<<5) | (0x00)  )  ;                //clear screen
        Uart_Printf( "Display Red! Press any key to continue!\n" );
        Uart_Getch() ;                //wait uart input

/*        Lcd_ClearScr( (0x00<<11) | (0x3f<<5) | (0x1f)  )  ;                //clear screen
        Uart_Printf( "LCD clear screen is finished! press any key to continue!\n" );
        Uart_Getch() ;                //wait uart input

        Lcd_ClearScr( (0x1f<<11) | (0x00<<5) | (0x1f)  )  ;                //clear screen
        Uart_Printf( "LCD clear screen is finished! press any key to continue!\n" );
        Uart_Getch() ;                //wait uart input

        Lcd_ClearScr( (0x1f<<11) | (0x3f<<5) | (0x00)  )  ;                //clear screen
        Uart_Printf( "LCD clear screen is finished! press any key to continue!\n" );
        Uart_Getch() ;                //wait uart input
*/
        Lcd_ClearScr(0xffff);                //fill all screen with some color
        #define LCD_BLANK                12
        #define C_UP                ( LCD_XSIZE_TFT - LCD_BLANK*2 )
        #define C_RIGHT                ( LCD_XSIZE_TFT - LCD_BLANK*2 )
        #define V_BLACK                ( ( LCD_YSIZE_TFT - LCD_BLANK*4 ) / 6 )
        Glib_FilledRectangle( LCD_BLANK, LCD_BLANK, ( LCD_XSIZE_TFT - LCD_BLANK ), ( LCD_YSIZE_TFT - LCD_BLANK ),0x0000);                //fill a Rectangle with some color

        Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*0), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*1),0x001f);                //fill a Rectangle with some color
        Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*1), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*2),0x07e0);                //fill a Rectangle with some color
        Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*2), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*3),0xf800);                //fill a Rectangle with some color
        Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*3), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*4),0xffe0);                //fill a Rectangle with some color
        Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*4), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*5),0xf81f);                //fill a Rectangle with some color
        Glib_FilledRectangle( (LCD_BLANK*2), (LCD_BLANK*2 + V_BLACK*5), (C_RIGHT), (LCD_BLANK*2 + V_BLACK*6),0x07ff);                //fill a Rectangle with some color

        Glib_Line( LCD_BLANK,LCD_BLANK, (LCD_XSIZE_TFT-LCD_BLANK), (LCD_YSIZE_TFT-LCD_BLANK), 0x0000 ) ;
        Glib_Line( LCD_BLANK,(LCD_YSIZE_TFT-LCD_BLANK), (LCD_XSIZE_TFT-LCD_BLANK), LCD_BLANK, 0x0000 ) ;
        Glib_Line( (LCD_XSIZE_TFT/2),(LCD_BLANK*2 + V_BLACK*0), (LCD_XSIZE_TFT/2), (LCD_BLANK*2 + V_BLACK*6), 0x0000 ) ;

        #if(LCD_Type == LCDT35)
                Uart_Printf( "Press any key to continue!\n" );
                Uart_Getch() ;                //Any Key To Next
                Paint_Bmp(0, 0, 240, 320, TQ_LOGO_240320);
        #elif((LCD_Type == LCDW35) || (LCD_Type == LCDS35))
                Uart_Printf( "Press any key to continue!\n" );
                Uart_Getch() ;                //Any Key To Next
                Paint_Bmp(0, 0, 320, 240, TQ_LOGO_320240);
        #elif(LCD_Type == LCDW43)
                Uart_Printf( "Press any key to continue!\n" );
                Uart_Getch() ;                //Any Key To Next
                Paint_Bmp(0, 0, 480, 272, TQ_LOGO_480272);
        #elif(LCD_Type == VGA)
                Uart_Printf( "Press any key to continue!\n" );
                Uart_Getch() ;                //Any Key To Next
                Paint_Bmp(0, 0, 640, 480, TQ_LOGO_640480);
        #elif(LCD_Type == LCDA70)
                Uart_Printf( "Press any key to continue!\n" );
                Uart_Getch() ;                //Any Key To Next
                Paint_Bmp(0, 0, 800, 480, TQ_LOGO_800480);
        #endif
        Uart_Printf("LCD Test Complete!\n");
        Uart_Printf("Press any key to quit!\n");
        Uart_Getch();       
        
}
 楼主| as12312a 发表于 2012-3-6 19:23:32 | 显示全部楼层
本帖最后由 as12312a 于 2012-3-6 19:32 编辑

函数是官方工程文件里的,没有改过。。
我烧写的时候是在串口命令下按 a 用 usb 烧入的,这个有影响么?dnw 设置是波特率115200  下载地址是0x30000000

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| as12312a 发表于 2012-3-6 20:18:25 | 显示全部楼层
我烧写到sdram里面运行,发现图片可以显示了、、这是怎么回事呢?
 楼主| as12312a 发表于 2012-3-6 20:55:19 | 显示全部楼层
我知道怎么回事了,我烧写bin文件到nand flash时未格式化nand flash,格式化后再烧写,图片完美显示!!
 楼主| as12312a 发表于 2012-3-6 20:55:59 | 显示全部楼层
感谢版主热心帮忙解决问题
tigerdawn 发表于 2012-3-28 20:33:31 | 显示全部楼层
兄弟知音哪,我今天也是这个问题,纠结了好半天,一直以为取模软件出了问题呢,直到看见了这贴!
波粒二象性 发表于 2013-12-25 15:23:19 | 显示全部楼层
as12312a 发表于 2012-3-6 20:55
我知道怎么回事了,我烧写bin文件到nand flash时未格式化nand flash,格式化后再烧写,图片完美显示!!

哗,你太聪明了啊.这个问题纠结了我两天了,直到看到你的贴子,前人栽树后人乘凉,谢谢你的贴子啊!格一格完美显示,但是这是为什么呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号 )

GMT+8, 2024-5-19 16:23 , Processed in 1.046875 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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