Prev: How to check USB performance
Next: Suitable Integer Square Root Algorithm for 32-64-Bit Integers on Inexpensive Microcontroller?
From: Dravid on 4 Feb 2010 08:52 Hi all, Am using lpc2478 for 6.5 TFT LCD development in that am using 256Mb(K4S561632E-FROM SAMSUNG) SDRAM for LCD FRAME BUFFER. can anyone help me to solve the sdram initialization problem, i have attached the sdram init coding can anyone suggest me to solve the sdram initalizing problem. void sdramInit(void) { volatile unsigned short i,dummy; PINSEL5 &= 0XF0FCFCC0; PINSEL5 |= 0X05010115; PINMODE5 &= 0xF0FCFCC0; PINMODE5 |= 0x0A02022A; PINSEL6 |= 0X55555555; PINMODE6 |= 0XAAAAAAAA; PINSEL8 &= 0XC0000000; PINSEL8 |= 0X15555555; PINMODE8 &= 0XC0000000; PINMODE8 |= 0X2AAAAAAA; PCONP |=0X800; EMC_CTRL =1; EMC_DYN_RD_CFG =1; EMC_DYN_RASCAS0 |=0X00000303; EMC_DYN_RP = 2; EMC_DYN_RAS = 3; EMC_DYN_SREX= 1; EMC_DYN_APR = 2; EMC_DYN_DAL = 3; EMC_DYN_WR = 2; EMC_DYN_RC = 3; EMC_DYN_RFC = 3; EMC_DYN_XSR = 7; EMC_DYN_RRD = 1; EMC_DYN_MRD = 1; EMC_DYN_CFG0= 0X00000680; EMC_DYN_CTRL= 0X183; //Issue SDRAM NOP (no operation) command ; for(i=0; i<0x40; i++) { __asm { NOP } } mdelay(200); EMC_DYN_CTRL|=0x103; // Issue SDRAM PALL (precharge all) command. EMC_DYN_RFSH = 0X2; for(i= 128; i; --i); // > 128 clk EMC_DYN_RFSH = 0x1c; EMC_DYN_CTRL|=0x83; //Issue SDRAM MODE command. dummy = *((volatile unsigned short*)(LCD_FRAME_BUFFER | (22 << 11 ))); EMC_DYN_CTRL = 0x3; //Issue SDRAM norm command ; EMC_DYN_CFG0|=0x80000; //Buffer enabled for accesses to DCS0 chip } Regards, Dravid. --------------------------------------- Posted through http://www.EmbeddedRelated.com |