Matlab-Simulink device driver Blockset for Microchip dsPIC / PIC24 / PIC32 Microcontrollers.
DsPIC Block/Rx Input
The Rx block require the 'Uart Config block' that will configure all parameters of the UART peripheral.
When no interruption are used, the Rx Input block can receive only one byte (uint8 scalar) at each step. If several bytes have been received during the previous time step, only the first one will be available in the current step execution time.
When interruption are enabled, the Rx Input block can receive as many data as there is some empty space in the buffer. When the buffer is full, last received data are lost. The block act as a FIFO stack. The block output in priority the first data logged. You can place as many Rx block as you want.
If no bytes have been received, the output is set to the default value. The block can be a blocking function : stop the step execution until one byte is received ( not recommended due to possible real-time constraint violation).
Dialog Box Parameters
Multiple instance of this block are allowed to receive several bytes within one time-step.
-1 for inherited
if checked, the block will stop execution of others blocks until one byte is received
If no data has been received, the block will output the value defined here. The value must be within the range [0 255]. -1 mean that the last value received (by this block) is keept
Received Output Flag
If checked, one logical output appears. Its value is
- 1 if one byte has been received,
- 0 if no data has been received ; the output value is the "Output Default" value.