RM0453
Configurable stop bits
The number of stop bits to be transmitted with every character can be programmed in
LPUART_CR2 (bits 13,12).
•
1 stop bit: This is the default value of number of stop bits.
•
2 Stop bits: This is supported by normal LPUART, Single-wire and Modem modes.
An idle frame transmission includes the stop bits.
A break transmission is 10 low bits (when M[1:0] = '00') or 11 low bits (when M[1:0] = '01') or
9 low bits (when M[1:0] = '10') followed by 2 stop bits. It is not possible to transmit long
breaks (break of length greater than 9/10/11 low bits).
CLOCK
b) 2 Stop bits
Character transmission procedure
To transmit a character, follow the sequence below:
1.
Program the M bits in LPUART_CR1 to define the word length.
2.
Select the desired baud rate using the LPUART_BRR register.
3.
Program the number of stop bits in LPUART_CR2.
4.
Enable the LPUART by writing the UE bit in LPUART_CR1 register to '1'.
5.
Select DMA enable (DMAT) in LPUART_CR3 if Multi buffer Communication is to take
place. Configure the DMA register as explained in
multiprocessor
6.
Set the TE bit in LPUART_CR1 to send an idle frame as first transmission.
7.
Write the data to send in the LPUART_TDR register. Repeat this operation for each
data to be transmitted in case of single buffer.
– When FIFO mode is disabled, writing a data in the LPUART_TDR clears the TXE
flag.
– When FIFO mode is enabled, writing a data in the LPUART_TDR adds one data to
the TXFIFO. Write operations to the LPUART_TDR are performed when TXFNF flag
is set. This flag remains set until the TXFIFO is full.
8.
When the last data is written to the LPUART_TDR register, wait until TC = 1. This
indicates that the transmission of the last frame is complete.
– When FIFO mode is disabled, this indicates that the transmission of the last frame is
complete.
Low-power universal asynchronous receiver transmitter (LPUART)
Figure 334. Configurable stop bits
a) 1 Stop bit
Data frame
Start bit
Bit0
Bit1
Data frame
Start bit
Bit0
Bit1
communication.
8-bit Word length (M[1:0]=00 bit is reset)
Bit2
Bit3
Bit4
Bit5
Bit6
Bit2
Bit3
Bit4
Bit5
Bit6
RM0453 Rev 1
Possible
Next
Next data frame
parity bit
start
Stop
Bit7
bit
bit
**
** LBCL bit controls last data clock pulse
Possible
Next
Next data frame
parity bit
start
Bit7
2
bit
Stop
bits
Section 35.5.10: USART
MS31885V1
1221/1461
1266
Need help?
Do you have a question about the STM32WL5 Series and is the answer not in the manual?
Questions and answers