| Target Support Package™ IC1 | ![]() |
Target Support Package IC1/ C166 Driver Library/ Asynchronous/Synchronous Serial Interface

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.
Note If your model contains a serial transmit or receive block, it is not possible to perform on-chip debugging over the same serial interface. Attempting to use the debugger in this case causes an error. If you need to debug an application that includes the serial transmit and receive blocks, you must run the debugger using a hardware simulator; alternatively, it may be possible to run your debugger on-chip without using the serial interface, for example, if debugging over CAN is available. See Debugging and Using The Code Profile Report. |
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.

Enables second output to show actual number of bytes retrieved from the buffer.
Enables inport so you can vary the number of bytes requested per call.
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.
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.
![]() | Fast External Interrupt | Serial Transmit | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |