UART Setup

<< Click to Display Table of Contents >>

Navigation:  STM32F0 Target > Block References > On-chip Peripherals > UART >

UART Setup

Previous pageReturn to chapter overviewNext page

User Interface

How this block appears in a Simulink model?

stm32f0_uart_setup_block

What can be configured?

stm32f0_uart_setup_mask

Configuration item

Selectable option/ Value

Description

UART Module

1| 2| 3| 4

Select UART/ USART module for the configuration

Baud rate (bps)

communication speed configuration value,

Example: 9600, 115200 or 1000000


Data bits

8

For latest version release of blockset support only 8 data bits

Parity

None| Odd| Even

Parity bit selection

Stop bit

0.5| 1| 1.5| 2

Stop bit selection

Tx Pin

Pin connect (remap) configuration for transmit pin (Tx).

Or select "Not used " to disable Tx for the selected module

The UART Tx signal will be transmitted to other device at selected pin

Rx Pin

Pin connect (remap) configuration for transmit pin (Rx).

Or select "Not used " to disable Rx for the selected module

The UART Rx signal will be received from other device via selected pin

Hardware flow control

None| RTS| CTS| RTS/CTS

This configuration available only UART with synchronous module 1, 2, 3 and 6. For module 4 and 5, this option will be automatic set to None.

Note:

None -  to disable hardware flow control

RTS - to enable RTS for hardware flow control

CTS - to ebable CTS for hardware flow control

RTS/CTS - to enable both RTS and CTS for hardware flow control

HW flow control, CTS Pin

Pin connect (remap) configuration for transmit pin (CTS)

The output signal CTS can be configured to control at selected pin

HW flow control, RTS Pin

Pin connect (remap) configuration for transmit pin (RTS)

The input signal RTS can be configured to receive by selected pin

Advance options

Checked| Unchecked

This option is to enable advance configuration mode, include memory buffer size.

Rx buffer size (bytes)

16| 32|64|128| 256| 512

Select buffer size for receiving (Rx) buffer, size must be in a number of 2^N and higher than packet length.

Example, to receive Rx packet with length 90 bytes, the Rx buffer can be configure to 128 or higher.

Tx buffer size (bytes)

16| 32|64|128| 256| 512

Similar to Rx buffer, size must be in a number of 2^N and higher than transmit packet length.

When to use this block?

The block must be placed into a simulink model to enable/ configure the selected UART module when the application need to send or receive data from external device using UART protocol.

How does this block work?

This block will perform configuration as below;

1. Enable GPIO clock using by Tx, Rx, RTS and CTS.

2. Configure remap pin for Tx, Rx, RTS and CTS.

3. Enable module clock for selected UART/ USART module.

4. Setup parameters for communication module.

5. Enable DMA clock.

6. Configuration for DMA transfer for Tx and Rx.

Demos

UART demo