阅读:3189回复:3
RGB接口LCD调试问题
最近一直在调一块RGB接口的LCD(用S3C2410),初始化始终没有成功,不知论坛里是否有哪位大侠曾调试过,现想问一问题。我的屏是先要通过spi初始化,然后方能使用rgb接口来点屏的,在使用spi时,那些在mpu(系统接口,也有说是mcu接口)接口下的RS RD线是否只要空着就行了?还是要另作处理?希望有人能够回答啊,
|
|
沙发#
发布于:2008-05-20 23:10
见过的几个RGB接口屏都不初始化(iic接口),只是初始化2410自己的lcd控制器就可以点了.
|
|
板凳#
发布于:2008-05-21 08:37
spi代码贴出来看看
|
|
地板#
发布于:2008-05-21 09:33
void SpiInit(void)
{ /* enable pclk for spiclk */ //为了节电可以把不用的时钟信号DISABLE rCLKCON |= (1<<18); /* set GPIO as SPI Pin */ rGPECON &= ~(0x3F << 22); //GPE11,12,13 控制位清零 rGPECON |= (0x2A << 22); //GPE11,12,13 设置位SPIMISO0,SPIMOSI0,SPICLK0 rGPEUP |= (0x7<<11); //disable pull /* Config GPD8(VD16) is CS for ILI9320 Initialize is high */ rGPDDAT |=(0x1 << 8); //CS HIGH 配置在Lcd_Port_Init()函数中完成 /* Baudrate = PCLK/2/(Prescaler value + 1) PCLK = 203000000/4 = 50750000 Hz Prescaler value = 0x18 = 24(rSPPRE0) Baudrate = 50750000/2/(24 + 1) = 1015000 = 1.015MHz */ rSPPRE0 =0x18; rSPPIN0=0x02; /* Polling mode, SCK Enable, master, active high, fomart A, normal mode */ rSPCON0 = 0x18; } void Lcd_SPI_Process(U8 type, U16 datas) { unsigned char orders; if(type == 1) { orders = 0x74; } else { orders = 0x76; } /* Set CS(GPD8)VD16 to low to activate LGDP4531 配置在Lcd_Port_Init()函数中完成 */ rGPDDAT &= (~(0x1 << 8)); /* Check the status of Transfer Ready flag(READY=1) , and then write data to SPTDAT0 */ while( (rSPSTA0 & 0x01) != 1 ); /* Write data to SPI Tx Data Register*/ rSPTDAT0 = orders; while( (rSPSTA0 & 0x01) != 1 ); /* Write data to SPI Tx Data Register*/ rSPTDAT0 = ((datas & 0xff00) >> 8); while( (rSPSTA0 & 0x01) != 1 ); /* Write data to SPI Tx Data Register*/ rSPTDAT0 = (datas & 0x00ff); while( (rSPSTA0 & 0x01) != 1 ); /* Set CS(GPD8)VD16 to high to deactivate LGDP4531*/ rGPDDAT |= (0x1 << 8); } |
|