Main Content

SCI Setup

Configure host-side serial communications interface for host-side SCI Transmit and SCI Receive blocks

  • Library:
  • Embedded Coder / Embedded Targets / Host Communication

  • SCI Setup block

Description

The SCI Setup block standardizes the serial communications interface (COM port) settings for use by the host-side SCI Transmit and SCI Receive blocks. This block is a standalone block that sets up one configuration for a COM port that SCI Transmit and SCI Receive blocks share. This block prevents conflicting configurations for the SCI Transmit and SCI Receive blocks. For example, the host-side SCI Transmit block cannot use COM1 with settings that differ from the COM1 settings used by the host-side SCI Receive block.

Parameters

expand all

Specify the communication mode to use for data transmissions. The communication mode can be raw data or protocol. Use raw data if you want the transmitting side to send unformatted data whenever the transmitting side is ready to send, whether the receiving side is ready or not. Without a wait state, deadlocks do not occur. Data transmission is asynchronous. With raw data mode, it is possible for the receiving side to miss data. If the data is noncritical, using raw data mode can avoid blocking processes.

When you specify protocol mode, handshaking between host and target computers occurs. The transmitting side sends $SND, indicating that it is ready to transmit. The receiving side sends back $RDY, indicating that it is ready to receive. The transmitting side then sends data and, when the transmission is completed, the receiving side sends a checksum.

Advantages to using protocol mode include:

  • Data is received as expected (checksum).

  • Data is received by the target computer.

  • Time consistency; each side waits for its turn to send or receive.

Note

Deadlocks can occur if an SCI Transmit block tries to communicate with more than one SCI Receive block on different COM ports when both SCI Receive blocks are blocking (use protocol mode). Deadlocks cannot occur on the same COM port.

Specify the baud rate of the COM port.

Specify the number of stop bits that the COM port uses.

Specify the parity mode that the COM port uses.

When you specify protocol for Communication mode, specify a value greater than or equal to 0, which indicates the number of seconds the transmitting side waits for an acknowledgement from the receiving side and how long the receiving side waits for data. The system displays a warning message each time a wait period exceeds the timeout value.

Extended Capabilities

Introduced in R2011a