Blockset described on this wiki is deprecated since 2012.

For Model Based Design (MBD), use the free MPLAB Device Blocks for Simulink, tool from Microchip.
Updated Rapid Control Prototyping (RCP) custom projects are published at: https://lubin.kerhuel.eu.

Difference between revisions of "DsPIC Block/Rx Input"

From http://www.kerhuel.eu/wiki - Simulink device driver Blockset for dsPIC / PIC24 / PIC32 Microcontrollers --[[User:LubinKerhuel|LubinKerhuel]] 12:40, 3 September 2009 (UTC)
Jump to navigation Jump to search
m (LubinKerhuel moved page Block/Rx Input to DsPIC Block/Rx Input: Block is a special page, creates many issues)
 
(2 intermediate revisions by the same user not shown)
Line 15: Line 15:
 
=Dialog Box Parameters=
 
=Dialog Box Parameters=
 
[[Image:Block_UARTRx_DialogBox.png|thumb|right|450px|UART Rx Dialog]]
 
[[Image:Block_UARTRx_DialogBox.png|thumb|right|450px|UART Rx Dialog]]
 +
 +
Multiple instance of this block are allowed to receive several bytes within one time-step.
 +
 
===n° UART===
 
===n° UART===
 
UART Used
 
UART Used
Line 25: Line 28:
  
 
===Output Default===
 
===Output Default===
If no data has been received, the block will output the value defined here.
+
If no data has been received, the block will output the value defined here. The value must be within the range [0 255].
Received Output Flag
+
-1 mean that the last value received (by this block) is keept
  
 +
===Received Output Flag===
 
If checked, one logical output appears. Its value is
 
If checked, one logical output appears. Its value is
 
*1 if one byte has been received,
 
*1 if one byte has been received,
 
*0 if no data has been received ; the output value is the "Output Default" value.
 
*0 if no data has been received ; the output value is the "Output Default" value.
 +
 +
 +
----
 +
<comments \>

Latest revision as of 18:30, 3 May 2015

Block UART 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).

Related blocks : Block/UART_Configuration Block/Rx_Input Block/Tx_Output Block/Tx_Output_Multiplexed_For_Matlab-Labview Block/Interface_Tx-Matlab

Dialog Box Parameters

UART Rx Dialog

Multiple instance of this block are allowed to receive several bytes within one time-step.

n° UART

UART Used

Sample Time

-1 for inherited

Blocking Function

if checked, the block will stop execution of others blocks until one byte is received

Output Default

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.



<comments \>