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.

CCS/TMS320F28377D: Need help with SD Card Interface code

Part Number: TMS320F28377D
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hi all,

I am a beginner here. I am working on a project where I am supposed to acquire the results from 4 channels of ADC simultaneously and further process it. I am working with 12 bit resolution and 1000 samples each. after some trials i figured out that it would not be possible without an external memory to store the data. There is a microSD card slot provided on the launchpad which I want to use. I looked up the example in control suite (C2000 ware) but it totally went over my head.

Can I find the decent/simple microSD card (write) code somewhere? OR a better explanation for the Code given in Control suite?

  • Hi Rohan,

    Rohan Chawhan said:
    I looked up the example in control suite (C2000 ware) but it totally went over my head.

    You need to understand the example code as building anything further becomes more complex. Any particular code section you feel to be complicated or unable to understand?

    Regards,

    Gautam

  • Hi Gautam,

    I have started to work on the DSC TMS320F28377D just recently. I have understood the basic DAC and ADC examples and have done some primary codes. Now I want to put the ADC output (that is stored in a variable) into SDcard. So I looked up the sdcard_cpu01 example. but it looked very advanced to me. I am really stuck at the beginning of this code.

    Of course when I import the example in CCS and build it, it gives out no error and runs. but I am not sure how the program works after that. I mean

    1. which key to hit or what is the process to write a piece of data on sdcard.

    2. how many more functionalities are embedded in that code? eg. flashing the sdcard,overwriting the data, etc.

    Can you please provide a quick insight of the code?

  • Did you use PuTTY or some other terminal to send commands to the device to interact with the SD card?

    The example currently doesn't demonstrate writing to the SD card (we have a bug filed to update it to add this), but it shouldn't be too hard to add it yourself. You can read up on the FatFs and the API here: elm-chan.org/.../00index_e.html

    If you have no need for a file system we do have an application note that discusses interfacing with an SD card. It's kind of old and it might require a little porting to get it to work on the F2837xD, but it might be more what you're looking for

    www.ti.com/.../litabsmultiplefilelist.tsp

    Whitney
  • I understand that i need to make the serial communication work. so i tried the spi_loopback_interrupts_cpu01 example from C2000ware. I see that the sdata and rdata are getting some values but they match only upto 3 digits (for exaple - sdata = 12000; rdata = 12137). also i am not able to see the serial communication on the terminal [View > Terminal]

    Can you help me with this?
  • Rohan Chawhan said:
    also i am not able to see the serial communication on the terminal [view]

    Did you execute this project: C:\ti\c2000\C2000Ware_1_00_01_00\device_support\f2837xd\examples\cpu1\sci_echoback ?

    This should directly get interfaced with your COM port on terminal app.

    Regards,

    Gautam

  • Hi Gautam I tried the program that u suggested but i am not not able to give any character as input in the terminal. i tried it with putty as well as Terminal window of CCS.

    i followed the steps given in the program itself to configure the terminal.

    ****************************************************************************************************************

    Also i feel there is a slight mistake may be. you can see the attached screenshot for the details.

  • This should very well work. Can you try with hyperterminal and use the settings given in the same above folder?
  • Are you using a LaunchPad or a controlCARD? I know the controlCARD can behave this way when the the A:SW1 is in the wrong position. I don't have the LaunchPad on hand at the moment, but I don't think it requires a similar action.

    Whitney
  • Hi Whitney,

    I am using the Control card. Can you explain me the problem that you suggested regarding wrong position of A:SW1?

    Rohan

  • Push the switch on the right (closest to the micro USB) up toward "ISO." Does that fix it?

    Whitney

  • Yes Whitney, This solved the problem for sci_echoback_cpu01 and is now working well. The problem with microSD card read/write still remains.

    I want to write a 12 bit data from ADC output at the speed of 100-200 Khz in microSD card.

  • Okay, so are you able to run the SD card example and interact with the SD card using the commands sent over SCI?

    I think a good starting point would be to modify that example to add a function to write to the SD card (since it currently only reads from it).

    Whitney