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.

Beginner: TMS320F28335, Tips for creating a GUI for real-time display of data on a graph?

Other Parts Discussed in Thread: TMS320F28335

Hi everyone.

I am currently working on a project using the TMS320F28335, and considering my extreme lack of experience with Ti products and with programming/designing any type of Graphical User Interface (GUI), I thought I would turn to the experts for some tips or to at least point me in the right direction.

I am hoping to display two variables on a real-time graph, and I was wondering if anyone had any tips for which communication link to use and/or what type of software I should look into. 

I have been searching for a little bit now, and I thought Matlab and Labview might work great, however it seems as though you need to buy a license for these applications, which costs quite a bit of money and is not very practical for my purposes.  I also know that there is a graphing feature for Code Composer Studio 4, but it doesn't seem like it preforms any real-time updates even though we might have to resort to using this if all else fails.  (I also have seen that there is a COM interface that could potentially work, but I don't know much about how to go about this).

If anyone has suggestions on a simple GUI that would be custom or would be something that would work for my situation, I would be very thankful if you could point me in the right direction.

Thank you

  • Benjamin,

    The way I would probably do it is to use the graphing feature in CCS.  You will have to buffer your data into a form that you'd want to display though.  For example, every second you could use a CPU Timer to log one data point into an array.  Once the buffer is full you'd then start refilling the buffer.  You could have the update rate be 1 second or whatever you want.  Graphing is found at Tools->Graph once you've loaded code and are in the Debug Perspective. 

    (the way TI C2000 often uses graphs is to fill one element in the buffer within each system interrupt (which runs very fast) after some value of voltage level is reached in the data that is perhaps to-be-buffered.  In this way we get a graph that is triggered like an oscilloscope)

    Another option could be to use Crosshairs Embedded's Interface Designer.  I think it would be able to do what you want.  It isn't free, but it isn't too expensive.


    Thank you,
    Brett

  • Brett,

    Thank you very much for the response.  I was able to use the graphing feature in CCS by buffering the data and I am successfully able to view it using the continuous refresh feature, which is very helpful.

    The only problem I am running into now is that I would love to create an X-Y graph which has two buffers being displayed on one figure.  It does not seam as though Code Composer Studio has this capability, and their single time and dual time graphs are always with respect to time.

    Since that does not seem possible, I was wondering if there was a way for me to export data.

    I know that the data --> export to .csv (from the right-click menu on the graph) is not supported in CCSv4, and I have not had success using the printf function in order to print and copy my data into another software application so that I can view a static graph of the data (an x-y graph to be exact).

    If you or anyone has any ideas on how I could export my data (I currently have two variables with a buffer size of 128 per each variable), it would be greatly appreciated.

    Thank you,

    Ben

  • On your original question you mentioned which comm to use:

    - To answer that I guess most people will agree that comms doesn't get any simpler then UART (FTDI do some nice 3V3 cables ready to connect to your chip http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm).

    Regarding the visualization of your data:

    - If you don't mind not using real-time data, it's a very easy job (on my point of view) create a .NET application to open the serial (UART) connection, read the data and save into a .csv file. After you collect everything Excel is your best tool for generating any kind of graph you want. If you really need the real-time stuff than it's a bit more complex to program, but certainly achievable, to include this graph functionality on the .NET application.

    And for as licensing costs: you can grab yourself Visual Studio Express (free version) from Microsoft website.

  • Benjamin,

    While not perfect, take a look at the post below.  Basically export the memory.
    http://e2e.ti.com/support/microcontrollers/tms320c2000_32-bit_real-time_mcus/f/171/t/98293.aspx#343592

    Excel should then be able to take care of graphing the data.

    Hopefully, this could work for you.


    Thank you,
    Brett

  • Brett,

    Thank you once again for your quick response.

    I was able to download the data successfully, and I should be able to use this functionality in my project.

    This may work well for one or two of the buffer variables I am hoping to view however it will be tough to view some of the other variables since they are being continuously updated and the buffer variables are only able to store a limited amount of memory.  I don't know if you have any other suggestions to solve this problem?

    I might try to use the .net approach (by opening the UART) suggested above however I might not have the time to get into .Net programming even though I only really need to capture the data.

    Thanks again,

    Ben

  • Ronaldo,

    Thank you for your response.

    Do you happen to have any suggestions or documentation for how to connect the UART cable to our TMS320F28335 Microcontroller?

    In addition, do have any suggestions on tutorials for the simple read and save functions using .NET programming in Visual Studio?

    Thanks again for all your help,

    Ben

  • hi Benjamin,

    I'm at home and don't have my development environment, and also I'm half drunk, so I'll tell you what I rememebr by heart:

    the cable is as simple as it gets, find where the TMS320F28335 can mux the UART ports, use the UARTStdio library from TI (check the examples on how to use), and start transmit the data you need with UARTprintf(), you can already send it ready for CSV by sending every value comma-separated and with a carriage return at the end.

    The 3V3 version of FTDI cables are ready to go, chose the connector or solder of your preference and put Tx->Rx; Rx->Tx and the GND from the cable to the GND of your MCU.

    Stick the cable on your PC and will install the drivers opening a virtual USB com port, check on Device Manager which port it was assigned to.

    On VSExpress you drag a ComPort (I guess it's a telephone icon) from the left-hand side toolbar to your form1. Select it, on the right-hand side you'll have the properties bar, put there the COM port number, and the comm properties the same way you setup on UARTStdio (for example, 19200kbps, 8bits, 1 stop bit, no parity). Double click the icon and you will be programming inside the "OnDataReceived" event... that simple! You'll have to write String buff = ComPort1.read() or something similar to get that data. Google on VB.NET write file, and you'll find it the code to write that data to a CSV.

    Drag a button to the form, double click the button, you'll be programming inside the "button click" event, put there code to initialise the com port (something like ComPort1.Open() ). Put another button to use a ComPort1.Close() so you can stop the logging, make a copy of the file and carry on logging. So you can open the copy on excel.

    That's the quick and dirty version of it, if you never used VB.net before it might take an hour or so, but that's all.
    If you need a nice finished product, that you'll need to dive a bit more inside it. 

    happy coding!!!

  • If you haven't invested too much in this yet, you could wait for a product called GUI Composer. This is a TI product that we are going to beta with in July time frame. This will allow you to graph multiple variables in a single graph widget. It will re-use a lot of the foundational layers that is used by CCS, so it will work via real time JTAG.

    Raj