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.

DsPIC Block/Tx Output

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
Block UART Tx Output

The Tx Output Output block send the uint8 scalar or vector data throw the UART Tx pin of the microcontroller. The "UART Config" is needed to configure the UART parameters.This is a blocking function : The block will stop execution of current step until all its intput data are stored into the dsPIC 4 byte buffer.

To avoid real time violation, you should send throught the UART less than the max number of characteres that can be send within ont time step ( this value is computed in the UART Configuration dialog box). Also, note that when sending a vector with more than 5 characteres (ie, uint8 or int8 values), the block will wait until the UART send all caracteres minus the remaining 5 that will fill-in the buffer and transmition register at the end execution time of the block. In other word, try to send less than 5 data at once. (you could use several Tx blocks and optimize the execution time order of blocks...)

Dialog Box Parameters

n° UART

UART Used

Block Ordering Input / Output

Create one input and/or output port on simulink. This port is just used to set the order of execution between severals blocks.