完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
改了很久了,显示屏一直不亮,显示屏是P43,哪位大神能帮我看看程序,哪里出错了,谢谢了
head.s .EQU MEM_CTL_BASE, 0x48000000 .EQU SDRAM_BASE, 0x30000000 .extern main .text .global _start _start: b Reset Reset: LDR SP,=4096 BL Disable_WatchDog BL Clock_Init BL Memsetup BL Copy_Steppingstone_to_SDRAM LDR PC,=ON_SDRAM ON_SDRAM: LDR SP,=0x34000000 @脡脰栈 BL main HALT_LOOP: B HALT_LOOP Copy_Steppingstone_to_SDRAM: MOV R0,#0 LDR R1,=SDRAM_BASE MOV R2,#4*1024 1: LDR R3,[R0],#4 @麓脫teppingstone露脕隆4脳陆诘脛媒垄脠源碌脴路录脫 STR R3,[R1],#4 CMP R0,R2 BNE 1b MOV PC,LR Memsetup: MOV R0,#MEM_CTL_BASE ADRL R1,MEM_CFG_VAL ADD R2,R0,#52 1: LDR R3,[R1],#4 STR R3,[R0],#4 CMP R0,R2 BNE 1b MOV PC,LR .align 4 MEM_CFG_VAL: @麓娲⒙棵樏喢访睹β得劽ㄖ? .long 0x22011110 @BWSCON .long 0x00000700 @BANKCON0 .long 0x00000700 @BANKCON1 .long 0x00000700 @BANKCON2 .long 0x00000700 @BANKCON3 .long 0x00000700 @BANKCON4 .long 0x00000700 @BANKCON5 .long 0x00018005 @BANKCON6 .long 0x00018005 @BANKCON7 .long 0x008c07a3 @REFRESH .long 0x000000b1 @BANKSIZE .long 0x00000030 @MRSRB6 .long 0x00000030 @MRSRB7 lcd.c #include "s3c2440.h" #include "Types.h" /*LCDCON1 录脛麓忙脝梅碌脛脰碌*/ #define CLKVAL (6 << 8) //VCLK=6.39MHz 6 #define PNRMODE (0x3 << 5) // TFT LCD panel #define BPPMODE (0xc << 1) //16 bpp for TFT #define ENVID (0) //Disable the video output and the LCD control signal /*LCDCON2 register value*/ #define VBPD (0x08 << 24) //2 #define LINEVAL (271 << 14) //271 #define VFPD (0x09 << 6) //2 #define VSPW (0x01) //2 /*LCDCON3 register value*/ #define HBPD (0x27 << 19) //19 #define HOZVAL (479 << 8) //479 #define HFPD (0x03) //10 /*LCDCON4 register value*/ #define HSPW (0x01) //10 /*LCDCON5 register value*/ #define FRM565 (1 << 11) #define INVVCLK (0 << 10) #define INVVLINE (1 << 9) #define INVVFRAME (1 << 8) #define INVVD (0 << 7) #define INVVDEN (0 << 6) #define INVPWREN (0 << 5) #define INVLEND (0 << 4) #define PWREN (1 << 3) //Enable PWREN signal #define ENLEND (0 << 2) //Enable LEND signal #define BSWP (0 << 1) #define HWSWP (1) #define LCD_WIDTH 480 #define LCD_HEIGHT 272 #define LCD_XSIZE LCD_WIDTH #define LCD_YSIZE LCD_HEIGHT #define SCR_XSIZE LCD_WIDTH #define SCR_YSIZE LCD_HEIGHT volatile unsigned long LCD_BUFF[SCR_YSIZE][SCR_XSIZE]; void delay() { unsigned long c=100000; while(c--); } void Lcd_PowerEnable(int invpwren,int pwren) { //GPG4 is setted as LCD_PWREN GPGUP = GPGUP|(1<<4); // Pull-up disable GPGCON = GPGCON|(3<<8); //GPG4=LCD_PWREN //Enable LCD POWER ENABLE Function LCDCON5 = LCDCON5&(~(1<<3))|(pwren<<3); // PWREN LCDCON5 = LCDCON5&(~(1<<5))|(invpwren<<5); // INVPWREN } void LcdBklSet(void) { GPBCON = GPBCON & (~(3<<2)) | (1<<2) ; //GPB1脡脰驴output GPBDAT |= (1<<1); } void TFT_LCD_ClearSCR(unsigned short c) { unsigned int x,y; for(y = 0; y < LCD_HEIGHT; y++) for(x = 0; x < LCD_WIDTH; x++) { LCD_BUFF[y][x] = c; } } /* *Function Name : LCD_Port_Init *Parameter : void *Description : configure LCD's I/O ports registers */ void LCD_Port_Init(void) { // GPCCON = 0xaaaaaaaa;//0xaaaa02a8; //GPIO I/O ports are used for VD[7:0],LCDVF[2:0], // //VM,VFRAME,VLINE,VCLK,LEND // GPCUP = 0xffff; //Disable Pull-up register // GPDCON = 0xaaaaaaaa; //GPIO ports are used for VD[8:23] // GPDUP = 0xffff; //Disable Pull-up registers //GPGCON |= (3 << 8); //GPG4 is used for LCD_PWRDN //GPGUP |= (1 << 4); //Disable GPG4 Pull-up register rGPCUP=0xffffffff; // Disable Pull-up register rGPCCON=0xaaaa02a8; //Initialize VD[7:0],VM,VFRAME,VLINE,VCLK rGPDUP=0xffffffff; // Disable Pull-up register rGPDCON=0xaaaaaaaa; //Initialize VD[15:8] } /* *Function Name : TFT_LCD_Init *Parameter : void *Description : configure LCD's registers */ void TFT_LCD_Init(void) { #define M5D(n) ((n)&0x1fffff) #define LCD_ADDR ((U32)LCD_BUFF) LCDCON1 = (CLKVAL | PNRMODE | BPPMODE | ENVID); LCDCON2 = (VBPD | LINEVAL | VFPD | VSPW); LCDCON3 = (HBPD | HOZVAL | HFPD); LCDCON4 = HSPW; LCDCON5 = (FRM565 | INVVCLK | INVVLINE | INVVFRAME | INVVD | INVVDEN | INVLEND | ENLEND | BSWP | HWSWP); LCDSADDR1 = (((LCD_ADDR >> 22) << 21) | ((LCD_ADDR >> 1)&0x1fffff)); LCDSADDR2 = (((LCD_ADDR + LCD_WIDTH*LCD_HEIGHT*2) >> 1)&0x1fffff); LCDSADDR3 = LCD_WIDTH; TPAL = 0x0; } /* *Function Name : LCD_ENVID_OnOff *Parameter : onoff *Description : Enable or disable LCD video output and the logic */ void LCD_ENVID_OnOff( int onoff) { if( onoff == 1) { LCDCON1 |= 1; //ENVID = ON; } else LCDCON1 = LCDCON1 & 0x3fffe; //ENVID = OFF; } main.c int main() { LCD_Port_Init(); TFT_LCD_Init(); LcdBklSet(); Lcd_PowerEnable(0,1); LCD_ENVID_OnOff(1); while(1) { TFT_LCD_ClearSCR(0x1f); delay(); } //while(1); return 0; } |
|
相关推荐
2个回答
|
|
亲,我也跟你一样的啊。。。现在连串口打印信息都没打印出来,不知道啥情况
|
|
|
|
大家解决了吗?现在我也是这种问题,一起交流一下
|
|
|
|
只有小组成员才能发言,加入小组>>
197个成员聚集在这个小组
加入小组为什么点亮LED的例子放在NORFlash上跑会出现奇怪的现象?
2187 浏览 6 评论
1987 浏览 5 评论
韦东山老师推出的《玩转ARM裸机实战》课程将帮你以上问题一扫而光!
4545 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 16:56 , Processed in 0.801071 second(s), Total 51, Slave 41 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号