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/UART Configuration"
LubinKerhuel (talk | contribs) |
LubinKerhuel (talk | contribs) |
||
Line 7: | Line 7: | ||
=Dialog Box Parameters= | =Dialog Box Parameters= | ||
− | + | [[Image:Block_UARTGeneral_DialogBox.png|thumb|right|450px|UART Dialog, Tab General]] | |
+ | [[Image:Block_UARTTxTab_DialogBox.png|thumb|right|450px|UART Dialog, Tab Tx]] | ||
+ | [[Image:Block_UARTRxTab_DialogBox.png|thumb|right|450px|UART Dialog, Tab Rx]] | ||
==n° UART== | ==n° UART== | ||
UART to be used | UART to be used |
Revision as of 20:25, 12 June 2008
The UART Configuration block set the parameters for the UART. Each UART has one Receive Rx pin and one Transmit pin Tx. The UART parameters are commmon for Rx and Tx of the same UART. The number or UART available depend on the Microcontroller used ( defined in the master block). Following parameters are fixed :
- 1 stop bit
- 8 bits data
- no parity
- no flow control
Contents
Dialog Box Parameters
n° UART
UART to be used
Baud (kb/s)
UART Speed you want to use. The exact speed will usually not be reach. An error above 4% usually gives no transmission errors. Check the error speed before use.
Tx Rx Alternativ
Use the Alternative Tx and Rx pin of the microcontroller if available. Use default pin otherwise.
Tx Interrupt Priority
Tx Interrupt are used when the block "Tx Output Multiplexed For Matlab Labview" is present. This block stores input into a circular buffer. The Tx interrupt get datas from this buffer.
Tx Interrupt
The Microcontroller has an internal 4 bytes buffer TXBUF. "Interrupt on TXBUF becoming empty" will gives fewer but longer interrupt."Interrupt on transfer of every character to TSR" will fullfill the microcontroller internal buffer as soon as there is one empty place. This will result in more interrupts.
TXEN
Set the output pin TX active for transmitting serial data. This is automatically checked when a Tx or "Tx Output Multiplexed For Matlab Labview" is present.
RX Interrupt Priority
Interrupt Priority
Info
Gives following information : UxBRG register value. The real bit rate achieved by the microcontroller and the error in percent between the real bit rate and the requested bit rate. The max Byte/Step is the maximum number of byte that can physically be sent during one diagram time step. If your schematic send more data throw the UART, somme data will be lost or the real time constraint will be violated (ie, the time step will be longer than expected).