主要内容

Serial Receive

R2026b

Receive data on Texas Instruments mmWave radar sensor through serial communication interface (SCI) module

Since R2026b

Libraries:
Radar Toolbox Support Package for Texas Instruments mmWave Radar Sensors

Description

The SCI Receive block supports asynchronous serial digital communication between the TI mmWave radar sensor and other asynchronous peripherals. This block receives scalar or vector data using the SCI A hardware module.

The block outputs the received data either in blocking mode or in non-blocking mode. In blocking mode, the model pauses execution until the requested data is available. In the non-blocking mode, the model runs continuously. To set the block in blocking mode, select the Wait till requested data is received option.

Ports

Output

expand all

At each sample time, the Data port outputs the values read from the SCI module A. The port outputs an array of size N-by-1, where N is the value that you specify in the Data length parameter.

The data type depends on the value selected for Data type parameter.

In the Device Manager on Windows, SCI A module corresponds to the port displayed as Silicon Labs Dual CP2105 USB to UART Bridge: Enhanced COM Port or XDS110 Class Application/User UART.

Data Types: int8 | uint8 | int16 | uint16 | int32 | uint32 | single | double

The length port outputs the number of valid data bits in the received message.

For example, if 10 data bits are requested, but only 2 are available in the Rx buffer:

  • The data output is a 10-by-1 vector, with the first 2 values holding valid data and the rest filled with zeros.

  • The length output is 2.

Dependencies

This output is available only if you do not select the Wait till requested data is received option.

Data Types: uint8

Indicates the status of the received serial data:

  • 0 – No errors.

  • 1 – A time-out occurred while the block was waiting to receive data. This is the default status if expected header is not received.

  • 2 – The received data contains an error (checksum error) or if the required tail is not received.

  • 3 – The buffer is full.

  • 4 – Parity mismatch.

  • 5 – Framing mismatch.

Dependencies

This port appears only when you select the Output status parameter.

Data Types: uint8

Parameters

expand all

Number of data bits used to represent the actual data in each transmission frame. If this parameter is set to more than 1, the data output is a vector.

Data type of data to be received through the SCI module.

  • on — When you select this parameter, the read operation runs in blocking mode. The read operation is blocked while waiting for the requested data to be available. If data is available, the data port outputs it. If data is not available, the data port waits.

  • off — When you clear this parameter, the read operation runs in non-blocking mode. The control returns immediately after reading the serial data that is available in buffer. If no data is available, the read operation outputs zeros.

    For example, if 10 bits are requested, but only 2 are available in the Rx buffer:

    • The data output is a 10-by-1 vector, with the first 2 values holding valid data and the rest filled with zeros.

    • The length output is 2.

Select this parameter to enable the status output port.

Specify how often the block reads data from the SCI module. When you specify this parameter as -1, Simulink determines the best sample time for the block based on the block context in the model.

Note

The baud rate is set as part of Simulink Configuration Parameters (In the Configuration Parameters dialog box, go to Hardware Implementation > Target Hardware Resources > Serial properties, and specify the baud rate for SCI Module A). The default baud rate is 921600.

Version History

Introduced in R2026b