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.

TMS320C6713B: SDRAM read write.

Part Number: TMS320C6713B

Hi,

This is my third post for seeking help regarding reading and writing to external sdram interfaced with c6713 processor. As explained here http://www.ti.com/lit/an/spra433e/spra433e.pdf Appendix A/B, i have configured dsp for 16-bit configuration. but still i don't know how to read/write to sdram?? just two rough lines of code i.e. one for reading and one for writing will be highly helpful. I tried the following but didn't worked. 

//reading
uint16_t data = *(volatile uint16_t)0x12345678;   //16-bit interface.

//writing
*(volatile uint16_t)0x12345678 = data;

  • Kowalski,

    If you are designing a new project, I hope you will consider moving to a newer DSP like the C6748. If this is not a custom board, are you using the DSK6713?

    Do you have JTAG and CCS connected and working for your board?

    It looks like you had correct syntax in your SDRAM programming post. Was there a reason for changing it more than the data width?

    This is a standard C programming question, not a DSP-related question, so the 2 threads have me a bit confused. The right syntax for what you show above, for accessing memory located at the address 0x12345678 just needs to cast that constant to be a pointer so you can then use it to access memory using the leading *, as in

    //reading

    uint16_t data = *(volatile uint16_t*)0x12345678;   //16-bit interface.

    //writing

    *(volatile uint16_t*)0x12345678 = data;

    But for the DSK6713, the SDRAM is likely located on ChipSelect 0. From the memory map in the datasheet, that address starts at 0x80000000, so that is the address you should use instead of 0x12345678. The address 0x12345678 is in reserved memory space, so it should not be used.

    When you are connected via JTAG and have CCS open, are you able to pull up the memory range 0x80000000 in the Memory Browser window? You should be able to read and write the memory there after the EMIF has been properly initialized.

    The best recommendation to give you is to go to TI.com and search for the TMS320C6x1x DSP Integration Workshop. This older workshop is archived and includes a Student Guide and labs. This will teach you a lot about how the processor works, how to use the tools, and how to use some of the major peripherals, including the EMIF. The labs will include example code to do what you are trying to do.

    Regards,

    RandyP

  • Thanks RandyP.
    Actually its a custom board based on c6713. I cant change it. Its desiged that way and it is supposed to be on c6713 chip.
    Yes i am using Jtag and ccsv3.3.
    The 0x12345678 is just a rough address for illustration. In my case th sdram is mounted on CE3 address 0xb0000000.
    I used memory browser window. As soon as i execute the first write statement, whole CE3 space is filled with same data in memory window.
    When i read it back... the last written data is reflected. I dont know if we have to close connection to sdram or what b/w write and read..!!! Stuck in there.
  • One more thing. C6713 support only burst mode of 4 words. How can i write 4 words simultaneously if interface is 32 bit to sdram.
  • Kowalski,

    Do you have a DSK6713 or any known good working hardware? You cannot expect to figure out your C programming syntax when the hardware is not working. Those are two completely independent things. You can test out the C syntax without accessing the SDRAM, just set the address to internal memory; the syntax is the same.

    I recommend you mark the best post of this thread as Answered and open a new thread to get help on debugging your hardware and/or EMIF configuration. To understand how the EMIF interacts with the SDRAM, please refer to the EMIF Reference Guide for the C6713.

    Regards,
    RandyP