阅读:2122回复:7
欢迎讨论S3C2410 LCD问题【源码和原理图已传】
现在在用S3C2410点一液晶屏,改屏需要用SPI来初始化,才能通过RGB接口写数据,现在的情况是这样的液晶屏初始化已经完成(因为我已经能够通过 SPI来用任意颜色清屏,所以我肯定初始化已经完成)。但是当使用RGB写数据时屏没有反应,我用示波器测试VFRAME VLINE VCLK引脚,发现VCLK是方波,但是VFRAME VLINE没有信号,不知这是怎么回事。
附上我的程序 void Lcd_Port_Init(void) { /* Initialize VD[7:0],LCDVF[2:0],VM,VFRAME,VLINE,VCLK,LEND VD0,1,2 output bit31 ***************************************** 0 10 10 10 10 10 01 01 01 01 00 00 10 10 10 10 00 a a 9 5 5 6 a 9 */ rGPCCON=0xaa9542a8; rGPCUP=0xffffffff; /* Disable Pull-up register */ /* Initialize VD[15:8],VD8,9,16,17,18 OUTPUT bit31 ***************************************** 0 10 10 10 10 10 01 01 01 10 10 10 10 10 10 01 01 a a 9 5 a a a 5 */ rGPDCON=0xaa95aaa5; rGPDUP=0xffffffff; /* Disable Pull-up register */ } void Lcd_Init(void) { rLCDCON1=(CLKVAL_TFT<<8)|(MVAL_USED<<7)|(3<<5)|(12<<1)|0; // TFT LCD panel,16bpp TFT,ENVID=off vclk=hclk/16=6mhz rLCDCON2 = (VBPD_320240<<24) | (LINEVAL_TFT<<14) | (VFPD_320240<<6) | (VSPW_320240); rLCDCON3 = (HBPD_320240<<19) | (HOZVAL_TFT<<8) | (HFPD_320240); rLCDCON4 = (HSPW_320240); rLCDCON5 = (1<<11) | (1<<10) | (1<<9) | (1<<8) | (0<<7) | (0<<6) | (1<<3) |(BSWP<<1) | (HWSWP); rLCDSADDR1=(((U32)LCD_BUFFER>>22)<<21)|M5D((U32)LCD_BUFFER>>1); rLCDSADDR2=M5D( ((U32)LCD_BUFFER+(SCR_XSIZE_TFT*SCR_YSIZE_TFT*2))>>1 ); rLCDSADDR3=(((SCR_YSIZE_TFT-SCR_XSIZE_TFT)/1)<<11)|(SCR_XSIZE_TFT/1); rLCDINTMSK|=(3); // MASK LCD Sub Interrupt rLPCSEL&=(~7); // Disable LPC3600 rTPAL=0; // Disable Temp Palette } void main(void) { SetClockDivider(1, 1); SetSysFclk(FCLK_200M); //to save power, use 50M /* This codede by myself!!!!!!!*/ Port_Init(); Isr_Init(); Uart_Init(0, Console_Baud); Uart_Select(Console_Uart); #if 1 //bank0 modified to RO_START MMU_Init(); //MMU should be reconfigured or turned off for the debugger, //After downloading, MMU should be turned off for the MMU based program,such as WinCE. #else MMU_EnableICache(); UsbMain(); #endif Set_Tout1_Pwm( 100 ) ; //turn on the LCD blacklight! GPB1_TO_OUT(); GPB1_TO_1(); //Lcd_PowerEnable(0,0); //special power on timing, please research it! Lcd_Port_Init(); Lcd_Init(); SPI_Interface(); Lcd_EnvidOnOff(1); //不能少 ILI9320_Init(); while(1) { Lcd_ClearScr(RED); } return 0; } 我的屏是240*320的竖屏,所以rLCDSADDR3=(((SCR_YSIZE_TFT-SCR_XSIZE_TFT)/1)<<11)|(SCR_XSIZE_TFT/1);这个与BIOS中代码是不一样的。 这个我自己做的屏,欢迎大家来讨论,一旦显示正常后我将公布代码和原理图,谢谢大家讨论。 |
|
沙发#
发布于:2008-05-29 16:53
最新测试有信号了
VFRAME 74.85HZ VLINE 24.39KHZ VM 24KHZ 但是屏就是没有显示,调试的时候发现 Lcd_ClearScr(0XF800); //红色 数组LCD_BUFFER[0][0] = 0xF800; LCD_BUFFER[0][1] = 0xF800;z这就说明了缓冲区中有数据了,但是屏没有响应,这是怎么回事呢?还有想问的是屏的DRIVE IC ILI9320 的RGB时序是不是要和2410LCD控制器的一致呢? 附件是ILI9320 RGB的时序图。ILI6320的寄存器0X0F是用来配置ILI9320 RGB信号极性的配置如下: D15 ....................................D5 D4 D3 D2 D1 D0 0 ....................................0 VSPL HSPL 0 EPL DPL VSPL 为“0” VSYNC LOW ACTIVATE ,为“1” VSYNC HIGH ACTIVATE HSPL 为“0” HSYNC LOW ACTIVATE ,为“1” HSYNC HIGH ACTIVATE EPL 为“0” THE DATA DB[17]..DB[0] is writen ENABLE = "0",disable data writen when ENABLE ="1" EPL 为“1” THE DATA DB[17]..DB[0] is writen ENABLE = "1",disable data writen when ENABLE ="0" DPL 为“0” the data is writen on the rising edage of dotclk DPL 为“1” the data is writen on the falling edage of dotclk 我把0X0F寄存器配置为0x001a 就是VSPL=1 HSPL =1 EPL =1 DPL=0 2410LCD控制器配置为 rLCDCON1=(CLKVAL_TFT<<8)|(MVAL_USED<<7)|(3<<5)|(12<<1)|0; // TFT LCD panel,16bpp TFT,ENVID=off vclk=hclk/16=6mhz rLCDCON2 = (VBPD_320240<<24) | (LINEVAL_TFT<<14) | (VFPD_320240<<6) | (VSPW_320240); rLCDCON3 = (HBPD_320240<<19) | (HOZVAL_TFT<<8) | (HFPD_320240); rLCDCON4 = (HSPW_320240); rLCDCON5 = (1<<11) | (1<<10) | (1<<9) | (1<<8) | (0<<7) | (0<<6) | (1<<3) |(BSWP<<1) | (HWSWP); rLCDSADDR1=(((U32)LCD_BUFFER>>22)<<21)|M5D((U32)LCD_BUFFER>>1); rLCDSADDR2=M5D( ((U32)LCD_BUFFER+(SCR_XSIZE_TFT*SCR_YSIZE_TFT*2))>>1 ); rLCDSADDR3=(((SCR_YSIZE_TFT-SCR_XSIZE_TFT)/1)<<11)|(SCR_XSIZE_TFT/1); rLCDINTMSK|=(3); // MASK LCD Sub Interrupt rLPCSEL&=(~7); // Disable LPC3600 rTPAL=0; // Disable Temp Palette 现在还没发现问题,欢迎大家讨论啊 |
|
|
板凳#
发布于:2008-05-29 18:26
我觉的可能是原因:Re:欢迎讨论S3C2410 LCD问题(将开源)
用户被禁言,该主题自动屏蔽! |
|
地板#
发布于:2008-05-29 19:38
tracera说硬件连线有问题,能说具体点么?
|
|
地下室#
发布于:2008-05-30 16:12
用户被禁言,该主题自动屏蔽! |
|
5楼#
发布于:2008-06-04 14:41
终于调好了,等几天把程序整理一下发上来,谢谢大家讨论
我把程序传上来,我是用ADS编译的,正在把液晶屏弄到WINCE下显示,等做好了也发上来,我的液晶屏需要用SPI初始化寄存器,我用IO模拟SPI些初始化程序的, 用2410没有用完的数据线配置为输出来模拟SPI的,如下所以: #define SCLK(a) rGPDDAT = (rGPDDAT & 0xfdff) | (a << 9) /*BUF_VD17 GPD9*/ #define SDI(a) rGPDDAT = (rGPDDAT & 0xfbff) | (a << 10) /*BUF_VD18 GPD10*/ #define SDO (rGPCDAT) & (0x1) /*LEND GPC0*/ #define CS(a) rGPDDAT = (rGPDDAT &0xfeff) | (a << 8) /*GPD8 */ 下面是液晶屏接口选择信号线 /* Interface select pins */ #define IM0_HIGH() rGPCDAT = rGPCDAT | (0x1<<8) //GPC8 #define IM0_LOW() rGPCDAT = rGPCDAT & (~(0x1<<8)) #define IM1_HIGH() rGPCDAT = rGPCDAT | (0x1<<9) //GPC9 #define IM1_LOW() rGPCDAT = rGPCDAT & (~(0x1<<9)) #define IM2_HIGH() rGPCDAT = rGPCDAT | (0x1<<10) //GPC10 #define IM2_LOW() rGPCDAT = rGPCDAT & (~(0x1<<10)) #define IM3_HIGH() rGPDDAT = rGPDDAT | (0x1) //GPD0 #define IM3_LOW() rGPDDAT = rGPDDAT & (~(0x1)) |
|
|
6楼#
发布于:2008-07-02 14:35
|
|
7楼#
发布于:2008-07-29 16:55
LZ真是大好人。。。。
无私奉献 |
|