This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to access SRAM(Read/write)

hi i am new to this group,i am working on LPC2468 in my project, i need to know that how do i access external SRAM(i am using cy7c1061BV33 of cypress of capacity 2 MB )
(i.e. read & write)
can anybody help me in this regards with some part of pseudo code.

i have initialised my emc as follows

void Init_EMC(void)
{

   //Step1: Configure EMC pin functions & mode

                /*pin connect block*/
        PINSEL6  =  0x55555555; //D[15:0]/P3[15:0] //if memory can be used as external boot memory setting for p[15:14]= 10 by cs1.
                                                        //in this case it is reserved, do not use.

        /*Pin has neither pull up nor pull down*/
        PINMODE6 =  0xAAAAAAAA; //mode 10

        PINSEL8  = 0x55555555 ;//A[15:0]/P4[15:0]
        PINMODE8 = 0xAAAAAAAA ;// mode 10

        PINSEL9  = 0x40550055 ;//A[19:16]/P4[19:16 & 31:30 & 27:24]
        PINMODE9 = 0xAAAAAAAA ;//mode 10

        //Step2: Enable EMC and set EMC parameter

        /*Enable EMC power */
        PCONP |= 0x800 ;

        /* Enable EMC*/
        EMC_CTRL = 1 ;

        /*PLL is bypassed*/
        CCLKCFG = 0x1;


        /*AHB slave memory interface & data buffers*/

        EMC_CONFIG = ENDIAN_MODE_BIT ;//little endian

        EMC_STA_CFG0 = MEM_WDTH |PAGE_MODE |BYTE_LANE_STATE ; //32 bits initially data buffers are dissabled

        EMC_STA_WAITWEN0 = 0x2;

        EMC_STA_WAITOEN0 = 0x2;

        EMC_STA_WAITRD0 = 0x1F;

        EMC_STA_WAITPAGE0 = 0x1F;

        EMC_STA_WAITWR0 = 0x1F;

        EMC_STA_WAITTURN0 = 0x0F;

        EMC_STA_EXT_WAIT = 0x00; // Extended wait time, 16CCLK

}

regards

Ashutosh Tripathi

0