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.

TMS320F28027: Looking for Example codes for interfacing SD card with SPI

Part Number: TMS320F28027
Other Parts Discussed in Thread: C2000WARE, TMS320F2808, TMS320F28069

Hi

  We are looking for example codes for reading and writing data in SD card that is interfaced with the SPI peripheral of TMS320f28027.

Thanks

Lenin.

  • Hi Lenin,
    Did you get a chance to look at the Examples provided as part of the device support package.
    Hope you have downloaded C2000WARE/Control suite package and looked at examples provided with it.

    We only provide some primitive loopback example as part of the package, which can be extended to your needs.

    Regards,
    Sudharsanan
  • Lenin,

    We do have an example for a fatfs file system on the F2837x devices. The SPI code should be mostly portable for all c2000 devices.
    it is located here: C:\ti\c2000\C2000Ware_1_00_03_00\device_support\f2837xd\examples\cpu1\sd_card

    I will request that we get this example officially ported to our other devices including F2802x, but cannot say when this may occur.

    Thanks,
    Mark
  • Hi Mark

      Thanks for the response. It seems the said example is for reading the data from the SD card..

    It doesn't covers about writing data into SD card..  Is there any other example codes for that..

    Thanks

    Lenin.

  • Lenin,

    You are correct, The example does not specifically cover writing data to an SD card. We have requested that some example is made to add this.

    You will notice that even in the "read" functions of the SD card example, some writes are done to access/ setup the SD Card and then read the data on the SD card. so the functions to physically write to the SD card are implemented and usable.

    Here are some other E2E threads on this topic:
    e2e.ti.com/.../391330
    e2e.ti.com/.../137077

    The proper sequence of commands and responses will be documented in the SD card spec. You will want to read through that and understand how the command structure works. Here is a link on the FATFS file system as well: elm-chan.org/.../00index_e.html

    I hope that this helps you get started!

    Thanks,
    Mark
  • Hi Mark

       Thanks for the response. I got an example project for interfacing TMS320f2808 with an SD card..

    http://www-s.ti.com/sc/techlit/spraao7.zip

    Will that be possible to use that project file as it is , with TMS320f28069... or shd i need to do some modifications...

    Thanks

    Lenin.

  • Lenin,

    The project will not work on the F28069 without modifications. 

    Your best course of action will be to find a basic F28069 example and add in the SPI SD card functions and includes. The SPI code itself will work, but you will need to verify clocks and dividers to make sure they agree. 

    You will probably need to rebuild the 28xxx_SD_SPI.lib file as well to make sure that the clock setup is correct for the F2806x.

    Please let me know if you have any additional issues. I am going to recommend to the team that we update this example and pull it forward into the latest tool chain and a newer device. In the meantime, I would be happy to assist with any specific issues that you encounter.

    Thanks,
    Mark