Hi,
I am trying to read and write data to 8 bit SRAM (AS6C4008A - 512K X 8 BIT LOW POWER CMOS SRAM) using F28377D processor. I have made the hardware connections as below
| F2837xD | EMIF1Pins | SRAM |
| GPIO93 | EM1BA0 | A0 |
| GPIO92 | EM1BA1 | A1 |
| GPIO38 | EM1A0 | A2 |
| GPIO39 | EM1A1 | A3 |
| GPIO40 | EM1A2 | A4 |
| GPIO41 | EM1A3 | A5 |
| GPIO44 | EM1A4 | A6 |
| GPIO45 | EM1A5 | A7 |
| GPIO46 | EM1A6 | A8 |
| GPIO47 | EM1A7 | A9 |
| GPIO48 | EM1A8 | A10 |
| GPIO49 | EM1A9 | A11 |
| GPIO50 | EM1A10 | A12 |
| GPIO51 | EM1A11 | A13 |
| GPIO52 | EM1A12 | A14 |
| GPIO86 | EM1A13 | A15 |
| GPIO85 | EM1D0 | DQ0 |
| GPIO83 | EM1D1 | DQ1 |
| GPIO82 | EM1D2 | DQ2 |
| GPIO81 | EM1D3 | DQ3 |
| GPIO80 | EM1D4 | DQ4 |
| GPIO79 | EM1D5 | DQ5 |
| GPIO78 | EM1D6 | DQ6 |
| GPIO77 | EM1D7 | DQ7 |
| GPIO31 | /EM1WE | WE# |
| GPIO34 | /EM1CS2 | CE# |
| GPIO37 | /EM1OE | OE# |
In the software I am configuring the EMIF1 CS2 as below
/* EMIF1 Configuration function*/
void initEMIF1()
{
Emif1Initialize();
EALLOW;
Emif1ConfigRegs.EMIF1ACCPROT0.all = 0x0;
Emif1ConfigRegs.EMIF1COMMIT.all = 0x1;
Emif1ConfigRegs.EMIF1LOCK.all = 0x1;
/* EMIF clock configuration - SYSCLKOUT/2 */
ClkCfgRegs.PERCLKDIVSEL.bit.EMIF1CLKDIV = 1U;
EDIS;
/* Set extended timeout interrupt mask */
Emif1Regs.INT_MSK_SET.bit.AT_MASK_SET = 1;
/* Set up GPIO pins for EMIF1 Asynchronous memory */
setup_emif1_pinmux_async_16bit(0);
/* EMIF1 CS2 Data bus - 8 bits, Turn around - 3 cycles,
Read hold - 3 cycles, Read strobe - 5 cycles, Read setup - 1 cycles,
Write hold - 2 cycles, Write strobe - 5 cycles, Write setup - 1 cycles,
Extended wait enable - 0U, Strobe mode */
ASync_cs2_config(0, 0, 3, 3, 5, 1, 2, 5, 1, 0U, 1);
}
I am facing an issue when I write and read 16 bit data on odd memory location. For example, if I write 0x1234 to the memory location 0x100001, and read back the data I read 0xZZ34 where ZZ (most significant byte) is junk value. But if I write 0x1234 to the memory location 0x100002 and read back I read 0x1234 properly.
But If I write 32 bit data to the memory location it write in both even and odd memory location. If I read back the 32 bit data at once from the same memory location I will have the proper data. But if I read 16 bit data twice instead of 32 bit data, the data from the odd memory location will have the same problem as mentioned above (Most significant byte is junk value).
I checked the pins EM1BA0 , EM1BA1 along with WE, OE and CS2 and the pin values seems to get generated correctly. I am not sure about the reason of failure of write and read of MSB data at odd memory locations.
Thanks,
Aditya

