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.

File system for a SD card for TMS320F28335 through SPI.

Other Parts Discussed in Thread: TMS320F28335

Hi,

Someone has some information about a SD card file system for TMS320F28335 or there is any example?

 

Regards,

Paul. 

  • Hi Paul,

    I too am looking for information on implementing a FAT32 file system for an SD card on a TMS320F28335. I can sucessfully read and write to the SD card having implemented SPRA007 application note. This does not however, cover any file system which means the data cannot be read by a PC which asks to format the SD card. I have followed the thtread which discusses mmc-c28x.c but this thread was not concluded with any real sucess.

    I can help you with the hardware but wondered if you have had any further sucess with the file system?

     

    Regards

     

    Geoff

  • Hi Geoff,

    I am working on 320f2808 dsp and utilizing spi protocol to save and read from SD card.

    How the pin layout should be? Do I need to use SPISTE?

  • Hi Sung,

    I am using the TMS320F28335 part and have successfuly implemented code to read/write csv files to the SD through the SPI in FAT32 format. I would be happy to help with code and schematics, as I had a difficult time at first. This was due to a very sneaky code error in the xmit_datablock code, that always returned an error. Please find attached schematics and code that may help. The pinouts are on the schematics as well.

    /CS connects to /SPISTEA  (Pin 1 on the SD card socket)

    SCK connects to SPICLKA (Pin 5 on the SD card socket)

    SDO1 connects to SPISIMOA (Pin 2 on the SD card socket)

    SDI1 connects to SPISOMIA (Pin 7 on the SD card socket)

    Supply must be at 3.3V

    /**********************************************************/

    /* SD here */

       fresult = f_mount(0, &Fatfs);

       fresult = f_open(&File,"/Log.CSV", FA_WRITE | FA_OPEN_EXISTING); /* Write the time the unit was switched on. */

        die(fresult);

        read_I2C_time_date(&I2C_time);

        WriteCount = f_printf(&File,"A, v%D,b%D\r\n",version,build);

    die(fresult);

    WriteCount = f_lseek(&File, f_size(&File));

    /* Move to end of the file to append data */

        WriteCount = f_printf(&File,"Date,%D-%D-%D\r\n",I2C_time.tm_day,I2C_time.tm_mon,I2C_time.tm_year);

        die(fresult);

        WriteCount = f_printf(&File,"Time,%D:%D:%D\r\n",I2C_time.tm_hour,I2C_time.tm_min,I2C_time.tm_sec);

        die(fresult);

        uart_printf("%d bytes written.\r\n", bw);

        uart_printf("\nClose the file.\n");

        fresult = f_sync(&File);

        fresult = f_close(&File);

       

    /* Unregister work area prior to discarding it */

        f_mount(0,NULL);

     

    It works for me writing at 4MHz. Any queries just ask.

    I also have code for printf statements which I found hard to find.

    As you are probably aware, this is a great site. http://elm-chan.org/fsw/ff/00index_e.html

    Regards

     

    Geoff

    TMS320F28335 to SD.zip
  • Thanks Geoff, I also used the same code some times back and it worked fine. I tried it on a slower speed. Now I will try it on 4 Mhz.

  • Hi Geoff
    I have downloaded posted files but it is incomlited model, some files are missing. I am quite new in microcontrollers and i have got problem in card initialization. Card doesn't respond. Mayby anyone have complete working model on which i could based on.
  • Hi Piotr,

    I have a working project that allows you to read and write to an SD card for a TMS320F28335 TI device but the code for the SD should be generic. For speed I can zip up the entire project. It was compiled under CCS 4.2.4.

    You will probably only need ff_9a.c, mmc-28x-ff9a.c and the SD_SPI files, plus the code in main to write something to your SD card.

    I am happy to help, as many have helped me.

    Regards

     

    Geoff

  • Thank You Very Much. Could you send me a zip file, please. Files you mentioned i gues that i can download from elm-chan Fatfs web page?
  • Hi Piotr,

    The entire project can be zipped to you as is, if you can allow me access to your email. This is a commercial project so not freely distributable.

     

    Regards

    Geoff

  • Hi Geoff,

    This is my mail biernatp at gmail.com

    Thank you for your help.
    Regards
    Piotr
  • Hello Geoff,
    I would be really grateful if you could zip the project for me too please. Or just the part where you read and write to an SD card :D. My email is olteanu.ramona_andreea@yahoo.ro.
  • Hi Geoff,

    I am recently working on the same project, can you please also send me a copy of your entire project?
    My email is zwang026@gmail.com
    Thank you so much!

    Regards,
    Zheng