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.

how to store data into computer?

Hi,

I am currently using a F28027 Piccolo launchpad for motor control application and my CCS version is v4.  If I wish to store all the data of a variable (e.g. speed) from the beginning to the end of the test, it is not possible to store such a huge amount of data on chip. Is it possible to store data in computer memory instead of DSP memory as the DSP memory is very limited.

Thank you very much.

Regards,

Jingzhe

  • Hi Jingzhe,

    1. Simplest way, what you can do is, while debugging you can add the variables to be watched on the Watch window. Later you can export these to an excel file.

    2. Else you can keep bursting out data using serial port and then by using some serial data logging software you can extract and log the data on computer.

    3. Finally, about logging the data on mcu itself. Yes you can explore that by using FLASH APIs; but you won't have much scope for logging data as such.

    Regards,

    Gautam

  • Jingzhe,

    As Gautam suggested, sending the data to a PC serial port is probably your best bet. The module to do this on the F28027 is called the SCI. If your computer doesn't have a serial port, you can get a USB<->serial adapter. You can get over 100 kbit/sec, which would hopefully be enough.

    Alternately, you could do extra calculations on-chip to reduce the amount of data -- record average/min/max values for each time interval, for instance.

  • Hi Gautam,

    Thank you very much for answering. Indeed the watch window is the simplest and most convinient way to observe a variable, and I often use this function. As you mentioned, the data can be exported to an excel file. Do you mean that all the previous data can be exported or just the current data can be exported? How am I supposed to do this?

    Thanks.

    Jingzhe

  • It would be like all the current variables during debugging. Once you stop debugging the logging would stop. You can personally check it by yourself by using some adc example.

    Regards,

    Gautam

  • Hi all,

    I too am trying to get logged data to the PC. I only want to store the data to the computer after the acquisition is complete. I am trying to make use of fwrite, which can write to a file in the CCS Build Directory. Off course this requires the debugger but this is OK for testing.

    However, I am facing a problem: when I tried to write a test string to the file using fputs it worked, but when I try to write binary values using fwrite the final file size i correct but every seconf byte is read from the source buffer. I have tried with element size 1,2 and 4 and all rpoduce the same result. My guess is that there is some conflict due to char being 16bit on C2000 but I do not know how I could correct this.

    Any thoughts are welcome.