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.

LAUNCHXL-F28379D: SCI Connection in Simulink External Mode

Part Number: LAUNCHXL-F28379D

Hey guys,

I want to use Simulink external mode to do online parameter tuning (for instance of gain blocks) in my control algorithm that runs on my target (Launchpad F28379D).

Furthermore I want to scope and log data in another model (a host model) that runs in normal mode so I can log data into the workspace of Matlab.

I also know that the external mode communication with my Launchpad works via the SCI_A communication.

So my question is: Is it possible to run the MCU algorithm on the Launchpad in External mode via SCI_A communication and 

send data to the computer via a SCI transmit block also with the SCI_A channel and run the host model in normal mode to receive the sent data? If not, is it possible to use SCI_B for sending the data to the host model?

My Launchpad is linked to the XDS100 Class USB Serial Port (COM10) of my computer over one USB cable. Does this physical USB connection provide only one SCI connection or for example the SCI_A and SCI_B connection that I can both use in Simulink at the same time for the purpose described above.

Thank you very much in advance. You guys would help me a lot!

  • Hi Johannes,

    I have some info from my development team I can share:

    • SCI-A cannot be used for data transfer as it is used for External mode. External mode can’t be shifted to SCI-B as USB emulation is needed, and that only works with SCI-A.
    • SCI-B can be used for data transfer, but you would need to set up your own connection via Rx/Tx blocks. Use a COM post on host PC to target SCI-B to read data.

    I'm not 100% sure how to completely set up SCI-B, but it's easy in the model to set up the Rx/Tx blocks. I suspect SCI-B would get transmitted out on the correct pin, and that would need to sent back into the PC via a COM port, and you may need some sort of MATLAB script to read from the COM port, which you would call in your model.

    If I get any more suggestions on how to make SCI-B work, I'll add them to this thread.

    As always, you can contact MathWorks Technical Support for immediate assistance. They may have additional resources and ideas on how to proceed.

    Cheers,

    -Brian

  • For Matlab/ Simulink related queries, pls contact Mathworks Tech support.
    For SCI / JTAG, someone will get back to you shortly
  • Hi Brian,

    thank you very much for your prompt reply and your information.
    Is it also possible to use SCI_A (external mode) and SCI_B (for sending signals to my host PC) at the same time over the same USB connection?
    Which means I would run the MCU model on the target in external mode (for online parameter tuning) and in this model send data with a SCI transmit Simulink block via the SCI_B connection to my host PC? That's actually what I want to do but doesn't work right now.

    Or would you recommend to transfer data to my host model via the SCI_A connection (and not with the SCI_B) and comment this block out in Simulink everytime I use external mode (via SCI_A connection) for online parameter tuning? I just need the host model to save internal signals on my PC.

    Also, how do you log internal signals of your MCU on your development PC for post-processing?

    Best,

    Johannes
  • Thank you Ramesh,

    I'm looking forward to your information about SCI / JTAG. Thanks!
  • Hi Johannes,

    From your description the need to use SCI_B is for signal logging in the host model. Correct? This is actually done by external mode on the same serial connection using which you are doing the parameter tuning.  So in the same connection we are supporting both features. Hence, you really dont need to investigate on using the SCI_B for logging data in host model. The data logging procedure is outlined in the link below:

    https://in.mathworks.com/help/supportpkg/texasinstrumentsc2000/examples/parameter-tuning-and-signal-logging-with-serial-external-mode.html

  • Hi Venkatesh,

    first, thanks for your time and effort. I really appreciate your kind advice.
    The question is actually if I can use external mode which runs by default via SCI_A in Simulink and in the same MCU model SCI_B to send some signals to a host model. Also which configurations do I have to make in the host model then to seperate between SCI_A and SCI_B so I can scope the right incoming signals?

    I already know about this example provided by Mathworks and I have already discussed with Mathworks about this example. The problem with this example is that I'm quite limited to log data in external mode (max 20 samples per file) because it depends on the internal storage capability of my Launchpad F28379D. Also when I follow this procedure I have to write the data directly to files on my PC via the External Mode Control Panel of Simulink which causes a huge amount of data storage for just one measurement on my development PC. Because I can only save 20 samples per file, Simulink generates about 1000 mat-files and saves them on my PC when I want to sample every 1 ms and simulate 20 sec long. This can't be a good way to log data because I also have to read all files afterwards and row the data sequentially together! Do you see the problem I face? Have you ever tried to log internal C2000 signals in Simulink in external mode or via a host model? Maybe you know a better way or you have a working example on how to realize that properly.

    That's why I want to log data via a host model right now.

    All the best
    Johannes
  • Hi Johannes,

    Please consider this, the SCI Tx and Rx blocks as provided in the C2000 support package works only with target. You cannot receive data on the host using these blocks as these blocks work from inside the target. However we have serial blocks that are meant to be used on the host side and for that you may have to work with 2 model approach. The first model is target model which will run in external mode on the target and second model is host model which runs in normal mode on the host. You need an external FTDI chip USB to serial converter to connect the SCI_B Rx and Tx lines from target and create a COM port for the same on the host. In the host model, you can configure the serial block(host specific block) for this COM port to receive the data as sent by target from target SCI_B port.
    Please refer the example for the same and the model c2000_host_read_12M.slx in the example.
    www.mathworks.com/.../texasinstrumentsc2000-ex78245720-dc-dc-buck-converter

    You may also consider increasing the duration by allocating more memory for heap in the target. The below link gives an idea on the same.

    in.mathworks.com/.../388466-how-to-resolve-error-not-enough-memory-on-the-target-to-process-the-packet-while-working-on-ti-c20