This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28377S: Microcontroller TMS320F28377S and communication with SDRAM

Part Number: TMS320F28377S
Other Parts Discussed in Thread: C2000WARE

Hello,

I have a TMS320F28377S microcontroller and a 64Mbit SDRAM (IS42S16400J-7TLI).
I connected the SDRAM to the microcontroller through the EMIF interface.
At this point I am trying to write a sequence of 1000 numbers (0-999).
It turns out that when I read from SDRAM the data does not appear correctly.

Attached:
- the electrical configuration of the SDRAM and the microcontroller (setup.pdf)
- the data sequence sent and collected from the SDRAM (data.txt)

Do you have any solutions to my problem?

Greetings,
Carlos Martins

setup.pdfdata.txt

  • Carlos,

    You may have a bad EMIF setting.  There's a spreadsheet tool in C2000Ware that you can use to double-check your configuration:  \C2000Ware_XXXX\boards\TIDesigns\F28379D_EMIF_DC\C2000-EMIF_ConfigurationTool.xlsx

    It should be self-explanatory, but there is some clarification in this EMIF Application Report.

    -Tommy

  • Hello tommy

    Thanks for your suggestion.

    I have already configured the EMIF interface for SDRAM "IS42S16400J-7TLI" using the C2000-EMIF_ConfigurationTool.xlsx file.

    However, the problem persists. This time I did two tests.


    Test 1:
    I wrote 1000 sequential values for SDRAM and then read the SDRAM positions (file data0.txt and TestSDRAM.txt)

    Test 2:
    Escrevi always value "55" 1000 times for SDRAM and then I read back (file data1.txt)

    Looking at the files data0.txt and data1.txt, when I write different values for SDRAM I do not read correctly from SDRAM. On the other hand, when I write the same value for SDRAM, I read SDRAM correctly.

    Can this problem be related a the writing / reading routine or to the initial address selection?

    Greetings,

    Carlos Martins

    data0.txtdata1.txt

    // SDRAM Configuration
    void Config_EMIF1_SDRAM(void)
    {
        // Perform a Module soft reset on EMIF
        EALLOW;
        DevCfgRegs.SOFTPRES1.all = 0x01;
        __asm ("NOP");
        DevCfgRegs.SOFTPRES1.all = 0x00;
        EDIS;
    
        // Configure to run EMIF1 on half Rate (EMIF1CLK = CPU1SYSCLK/2)
        //EALLOW;
        ClkCfgRegs.PERCLKDIVSEL.bit.EMIF1CLKDIV = 0x01; //100MHz
        //EDIS;
    
        EALLOW;
        // Disable Access Protection (CPU_FETCH/CPU_WR/DMA_WR)
        while(Emif1ConfigRegs.EMIF1ACCPROT0.all != 0x00)
            Emif1ConfigRegs.EMIF1ACCPROT0.all = 0x00;
        // Commit the configuration related to protection. Till this bit remains
        // set content of EMIF1ACCPROT0 register can't be changed.
        while(Emif1ConfigRegs.EMIF1COMMIT.all != 0x01)
            Emif1ConfigRegs.EMIF1COMMIT.all = 0x01;
        // Lock the configuration so that EMIF1COMMIT register can't be changed
        // any more.
        while(Emif1ConfigRegs.EMIF1LOCK.all != 0x01)
            Emif1ConfigRegs.EMIF1LOCK.all = 0x01;
        EDIS;
    
        //Configure Pins EMIF1 SDRAM 16 bits
        Config_EMIFPins_16Bits();
    
        Emif1Regs.SDRAM_TR.all = 0x29114610;//0x29114610;//0x29114510;
        Emif1Regs.SDR_EXT_TMNG.all = 0x00000006;
        Emif1Regs.SDRAM_RCR.all = 0x0000030D;
        Emif1Regs.SDRAM_CR.all = 0x00004620; 
    
    }
    
    // SDRAM Test
    void SDRAM_test(void)
    {
        Uint32 adress = 0x80000000;
        Uint32 ptr = 0x00000000;
        Uint32 i = 0;
        Uint32 LEN = 1000;
        Uint16 dado = 0; //50
    
    
        LED_MCUST_BLINK1S();
        LED_1Second();
    
    
        ptr = adress;
        for(i=0;i<LEN;i++)
        {
            __addr32_write_uint16(ptr, dado);
            dado++;
            ptr++;
        }
    
        ptr = adress;
        for(i=0;i<LEN;i++)
        {
            dado = __addr32_read_uint16(ptr);
            SendIntRS232(dado);
            //ptr++;
            ptr++;
        }
    }

  • Carlos,

    I see that you are writing and reading using addr32_write_uint16() and addr32_read_uint16(). Are these custom functions?

    Have you tried to view the SDRAM memory space using the memory browser in CCS? Are you able to modify contents through the browser?

    Can you confirm that your SDRAM_CR settings are correct in the register? I noticed that you are not setting the BIT_11_9_LOCK bit when writing the register value. This is not a significant point here since you are using the default value for CL, but it would be good to verify.

    You can also try to slow down the SDRAM timings and/or reduce SYSCLK to see if the behavior changes. If so, there is likely a timing sensitivity.

    -Tommy
  • Hello tommy

    I've already figured out my problem. I'am had not enabled the EM1A12 pin.
    After enabling all pins correctly the problem has been corrected.

    Thanks for your suggestions.

    Greetings,
    Carlos Martins

  • Hi Carlos,

    Are you using the pinmux tool for signal assignment? This is useful tool for signal assignment specifically for module like EMIF which has many signals.

    Regards,

    Vivek Singh

  • Hello Vivek Singh,

    The pinmux function works fine. However, I have created a specific function for my case.

    Greetings,

    Carlos Martins