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.

Adc data record

Other Parts Discussed in Thread: TMS320F28335

Hello everone, 

I have a question regarding the adc data log. Im curring using ccsv5 and ezdsp tms320f28335. I was wondering if it is possible to log the data of variable that is connected to for example one of the ADC pins for 20 second and export it as text or excel or .mat file. This way i can analyze the signal. I understand that there is a graph option which can show signal in real time but the problem is my samplimg frequency is high (100 khz) and i am not gettimg accurate result from it.Any help is appreciated.

regards, 

Kamyar

  • Kamyar,

    To do what you want, you first need to be able to fit the 20 seconds of data in memory, all at the same time.  I don't know what your sample rate is, but that is something to consider.  Assuming you get everything to fit into some array, open a memory window in CCSv5 to show the array.  You can save the array from the memory window.  I believe ASCII format requires the .dat file extension.  Read what the save window says carefully.  The filename extension determines the file format.

    The ASCII format file will have a first line with some magic number in it and some info about the source address and length from which the dump occurred.  You will need to manually remove this line using a text editor.  You can then import the file into EXCEL or MATLAB.  Sometimes you have to add commas or some other delimiter to be able to import (depends on what you are importing it to).  I have use WORD find/replace to insert these.  I fine line feeds, and replace with comma and line feed.  Something like that.

    I have described above a manual process where you need to potentially do a little file editing.  This works fine if you're just doing this a few times.  If you are going to be doing this a lot, then you can write a PC console program that parses the file, removes the first line, and then adds the commas.

    Regards,

    David

     

  • Kamyar,

    I just re-read your post, and I see you already said your sample rate is 100 kHz.  Way to high to fit 20 seconds of data in memory.  The method I proposed won't work for you.

    Perhaps you can use RS232 to connect the SCI to your PC, and log the data on your PC directly?  That is reasonably straightforward.

    - David

  • David,

    Thank you so much for the reply. I will try  to implement the RS232.

    Kamyar

  • Kamyar,

    One of the C2000 guys pointed out to me that RS232 cannot handle the bit rates you need.  At 100 kHz, you need 1.6 Mbps throughput (you must transmit in chunks of 8 bits even though your data is 12 bit.  So, you need to send 16 bits).

    RS232 can only handle about 119200 baud on most PCs.

    I know RS485 can handle the bit rate, but you'll need to look for a card for your PC.

    Alternately, you'll need some other gizmo capable of capturing the SCI data at 1.6 Mbps.

    The SCI is not a problem.  It will handle the bit rate.

    Regards,

    David