UART Tx Block
UART_TxBlock.PNG
The UART Tx block allows transmitting characters on UART

Note: In order to use the UART Tx block in a Simulink® model, it is necessary to first include and set up the UART Configuration block .

The UART Tx block sends one byte or a vector of uint8 bytes through the UART. Transmitted characters might be buffered depending on the UART configuration. The UART Ref selected must be configured using a UART Configuration block. Multiple instances of this block can be used in one Simulink model.

UART_Tx_MainTab.PNG
Click image to enlarge.
UART Tx: Main tab

The number of bytes to be sent can be specified by a block input parameter by enabling the option Send first N bytes from the vector input with N a block input from the Block Input tab.

Also, the transmission of the characters contained in the input vector can be stopped when the first occurrence of the NUL('\0') character is detected by enabling With vector input, do not send values following the first 0.

UART_Tx_BlockInputTab.PNG
Click image to enlarge.
UART Tx: Block Input tab

The number of bytes transmitted can be set as an output parameter by enabling Number of byte sent is a block output from the Block Output tab.

UART_Tx_BlockOutputTab.PNG
Click image to enlarge.
UART Tx: Block Output tab

UART Tx example:

The following example will print "Hello World!" on the UART. Visit the "UART Terminal Example" page for a complete UART example.

UART_Tx_Example.PNG
UART Tx example
© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.