Main Content

Serial Configuration for External Mode and PIL

To prepare your model for external mode or PIL with serial communication:

  1. In the Configuration Parameters dialog box, select Model Configuration Parameters > Hardware Implementation.

  2. Select a C2000 processor from the Hardware Implementation > Hardware board drop-down list.

  3. Under Target Hardware Resources, select External mode/PIL.

  4. In Communication interface drop-down list, select serial for Classic External mode or XCP on Serial for External mode over XCP.

    Note

    For PIL, the communication interface is only with serial.

  5. Select SCI module under Target hardware resource in Model Configuration Parameters > Hardware Implementation > Hardware board.

  6. For the selected SCI module, configure the additional parameters Desired baud rate in bits/sec, Pin assignment(Tx) and Pin assignment(Rx).

    Note

    • 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. For more information, see Optimizing Baud Rate Settings for External Mode Communication.

  7. 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.

    XCP on Serial

    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.

  8. 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.

  9. 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.

See Also

| |