Serial Receive - Configure C166 microcontroller for serial receive

Library

Target Support Package IC1/ C166 Driver Library/ Asynchronous/Synchronous Serial Interface

Description

The Serial Receive block receives bytes over the Infineon C166 microcontroller Synchronous/Asynchronous Serial Interface ASC0. 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 FIFO buffer that is internal to the device driver. If this 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 retrieves only those bytes that have already been received and placed in the internal buffer; it never waits for additional data to be received.

Whenever bytes are received at the serial interface, a Peripheral Event Controller (PEC) interrupt is generated to move the byte into the internal buffer. If there is no more space available in the internal buffer, any additional data is lost. The PEC interrupts are extremely fast and have minimal effect on the rest of the application.

To configure the serial interface bit rate, buffer size, PEC interrupt priority, and other parameters, see Asynchronous/Synchronous Serial Interface Configuration Parameters.

Block Inputs and Outputs

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

The first output 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 input signal if supplied, or the width of output signal otherwise.

The second output is the number of bytes actually retrieved from the buffer.

Dialog Box

Show number of bytes read

Enables second output to show actual number of bytes retrieved from the buffer.

Show length input

Enables inport so you can vary the number of bytes requested per call.

Maximum length of data

Set this as required up to the maximum buffer size. You can set receive and transmit buffer size (up to a maximum of 256 bytes) within the C166 Resource Configuration object. See Asynchronous/Synchronous Serial Interface Configuration Parameters.

Sample time

The time interval between samples. The default is 1. 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