这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » MCU » S3c2410 LCD控制寄存器写不进去?哪位指点一下

共5条 1/1 1 跳转至

S3c2410 LCD控制寄存器写不进去?哪位指点一下

菜鸟
2006-02-09 18:21:50     打赏

tornado 2.2'

其他寄存器如rGPCUP可以读也可以写,调试中在memory窗口可以看到写数据的结果;

可是LCD控制寄存器(0x4d000000后的一组积存器)写了数据之后,仍然是零(memory窗口)

下面是汇编和C的对照代码,单步跟踪看到积存器r2的值不为零,可是结果为零,

请指点一下:

#define rLCDCON1 (*(volatile UINT32 *)0x4d000000) /*LCD control 1*/

rLCDCON1=(CLKVAL_TFT_240320<<8)|(MVAL_USED<<7)|(3<<5)|(12<<1)|0;
0x304b2104 +0x018: MOV r3,#0x4d000000
0x304b2108 +0x01c: MOV r2,#0x178
0x304b210c +0x020: STR r2,[r3,#0]


[align=right][color=#000066][此贴子已经被作者于2006-2-9 11:34:38编辑过][/color][/align]



关键词: S3c2410     控制     寄存器     写不     进去     哪位         

菜鸟
2006-02-09 19:31:00     打赏
2楼

syslib.c已经做了如下映射:

{
(void *) 0x4d000000, /* LCD controller */
(void *) 0x4d000000,
PAGE_SIZE,
VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE,
VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT
},


菜鸟
2006-02-10 22:30:00     打赏
3楼

那位给看一下?

我在romInit.s里用汇编语言写0x4d000000也写不进去

板子应该没问题,wince下可以电亮


菜鸟
2006-02-14 00:51:00     打赏
4楼

顶顶,有朋友了解吗?


菜鸟
2006-02-15 18:50:00     打赏
5楼

#define rLCDCON1 (*(volatile unsigned *)0x4d000000) //LCD control 1
#define rLCDCON2 (*(volatile unsigned *)0x4d000004) //LCD control 2
#define rLCDCON3 (*(volatile unsigned *)0x4d000008) //LCD control 3
#define rLCDCON4 (*(volatile unsigned *)0x4d00000c) //LCD control 4
#define rLCDCON5 (*(volatile unsigned *)0x4d000010) //LCD control 5
#define rLCDSADDR1 (*(volatile unsigned *)0x4d000014) //STN/TFT Frame buffer start address 1
#define rLCDSADDR2 (*(volatile unsigned *)0x4d000018) //STN/TFT Frame buffer start address 2
#define rLCDSADDR3 (*(volatile unsigned *)0x4d00001c) //STN/TFT Virtual screen address set
#define rREDLUT (*(volatile unsigned *)0x4d000020) //STN Red lookup table
#define rGREENLUT (*(volatile unsigned *)0x4d000024) //STN Green lookup table
#define rBLUELUT (*(volatile unsigned *)0x4d000028) //STN Blue lookup table
#define rDITHMODE (*(volatile unsigned *)0x4d00004c) //STN Dithering mode
#define rTPAL (*(volatile unsigned *)0x4d000050) //TFT Temporary palette
#define rLCDINTPND (*(volatile unsigned *)0x4d000054) //LCD Interrupt pending
#define rLCDSRCPND (*(volatile unsigned *)0x4d000058) //LCD Interrupt source
#define rLCDINTMSK (*(volatile unsigned *)0x4d00005c) //LCD Interrupt mask
#define rLPCSEL (*(volatile unsigned *)0x4d000060) //LPC3600 Control
#define PALETTE 0x4d000400 //Palette start address

rLCDCON1=(CLKVAL_TFT_640480<<8)|(MVAL_USED<<7)|(3<<5)|(12<<1)|0;
// TFT LCD panel,16bpp TFT,ENVID=off
rLCDCON2=(VBPD_640480<<24)|(LINEVAL_TFT_640480<<14)|(VFPD_640480<<6)|(VSPW_640480);
rLCDCON3=(HBPD_640480<<19)|(HOZVAL_TFT_640480<<8)|(HFPD_640480);
rLCDCON4=(MVAL<<8)|(HSPW_640480);
rLCDCON5=(1<<11)|(1<<9)|(1<<8); //FRM5:6:5,HSYNC and VSYNC are inverted
rLCDSADDR1=(((U32)frameBuffer16BitTft640480>>22)<<21)|M5D((U32)frameBuffer16BitTft640480>>1);
rLCDSADDR2=M5D( ((U32)frameBuffer16BitTft640480+(SCR_XSIZE_TFT_640480*LCD_YSIZE_TFT_640480*2))>>1 );
rLCDSADDR3=(((SCR_XSIZE_TFT_640480-LCD_XSIZE_TFT_640480)/1)<<11)|(LCD_XSIZE_TFT_640480/1);
rLCDINTMSK|=(3); // MASK LCD Sub Interrupt
rLPCSEL&=(~7); // Disable LPC3600
rTPAL=0; // Disable Temp Palette


共5条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]