Serial Configuration for External Mode and PIL
To prepare your model for external mode or PIL with serial communication:
In the Configuration Parameters dialog box, select Model Configuration Parameters > Hardware Implementation.
Select a C2000 processor from the Hardware Implementation > Hardware board drop-down list. For more, see Configuring Additional Options for Hardware Selection
Under Target Hardware Resources, select External mode/PIL.
In Communication interface drop-down list, select
serialfor Classic External mode or
XCP on Serialfor External mode over XCP.
For PIL, the communication interface is only with
Select SCI module under Target hardware resource in Model Configuration Parameters > Hardware Implementation > Hardware board.
For the selected SCI module, configure the additional parameters Desired baud rate in bits/sec, Pin assignment(Tx) and Pin assignment(Rx).
By default SCI_A module is selected for Controlcards and Launchpads. For custom boards, if you are using different serial module to connect FTDI then select the appropriate serial module.
The default baud for Controlcards is 115200 bits/sec. For better performance, you may increase the baud to a value that your hardware board permits.
Select the corresponding COM port that the target hardware uses from the drop-down. The COM port value will be saved as Serial port in MATLAB® preference for a given target and not on a model. Click Refresh to see the latest value in MATLAB preference and updated list from device manager.
To see the list of available COM ports on your computer, select Start > Control Panel > Device Manager > Ports (COM & LPT)
You can also set the serial port in MATLAB preferences for the given hardware board using the MATLAB command:
codertarget.tic2000.setSerialPortPreferences(Hardware board, CPU value, Serial port)
Here CPU value is optional argument.
Make sure that the Verbose check box is selected to view the external mode execution progress and updates in the Diagnostic Viewer or in the Command Window.
Select Use a dedicated timer to improve time stamp accuracy parameter to log hardware time data inside ISR at ISR trigger rate and idle task at trigger rate for XCP External mode for Serial and CAN. For more information, see External Mode.
Your model is now ready to perform Monitor and Tune action (External Mode) over serial communication.