Serial Receive - Configure MPC555 for serial receive on either of QSMCM submodules SCI1 or SCI2

Library

Target Support Package FM5/ MPC555 Driver Library/ Serial Communications Interface (SCI)

Description

The Serial Receive block receives bytes via either of the MPC555 QSMCM submodules SCI1 or SCI2. It requests either a fixed number of bytes to be received, or, by enabling the first input, a variable number of bytes can be requested each time this block is called. When the block is called, the requested number of bytes are retrieved from a hardware buffer provided by the submodule SCI1 or SCI2. On SCI1, the total size of the buffer is 16 bytes; note however that the effective capacity is reduced due to the hardware behavior and the circular mode of buffer operation used by the software driver. You should design your application on the basis of 9 bytes for the maximum buffer size for SCI1. On SCI2, the size of this buffer is 1 byte.

If the buffer contains fewer bytes than the number requested, these bytes are pulled from the buffer and made available at the block output. The number of bytes actually retrieved from the buffer is made available at the second output. This block will only retrieve bytes that have already been received and placed in the hardware buffer; it will never wait for additional data to be received.

To configure the serial interface bit rate and data format, see Serial Communications Interface (SCI) Configuration Parameters.

The device driver used for the Serial Receive block does not require the use of CPU interrupts.

Block Inputs and Outputs

The first input can be enabled so a variable number of bytes can be requested each time.

The second input, if enabled, is a reset signal, which must have a Boolean data type. You must reset the SCI1 module if an overrun error or framing or parity error occurs. No reset is required for SCI2.

The first output (marked Data) pulls bytes from the buffer — either the number requested or the number available, whichever is the lower. Note that the number requested is the value of the first input signal if supplied, or the width of the output signal otherwise.

The second output (marked Num) is the number of bytes actually retrieved from the buffer. Up to four outputs can be enabled — the third showing framing error and parity error flags, and the fourth showing overrun flags.

See Data Type Support and Scaling for Device Driver Blocks for information on supported input/output data types and scaling of input/output signals.

Dialog Box

SCI module

Select either 1 or 2 (to choose module SCI1 or SCI2).

Show requested number of bytes input port

Enables an inport (the top one if there are two) where you can input the number of bytes to request.

Maximum number of bytes

Maximum number of bytes to receive (this is only visible if the requested number of bytes input port is enabled). This sets an upper limit on the number of bytes that will be read each time the block is called.

Show reset port

Enables the reset input (the lower inport).

Show actual number of bytes output port

Enables another output that shows the number of bytes actually read from the SCI buffer.

Show framing error and parity error flags

Enables another output. This output is zero if no framing or parity error occurred during the current read; it is true (1) otherwise. Note that for SCI1 only, a reset is required once a data overrun has occurred.

Show overrun flag

Enables another output. This output is true (1) if a data overrun occurred. Note that for SCI1 only, a reset is required once a data overrun has occurred.

Sample time

The time interval between samples. To inherit the sample time, set this parameter to -1. See "Specifying Sample Time" in the Simulink documentation for more information.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS