Figure 280. Configurable Stop Bits - ST STM32F101 series Reference Manual

Advanced arm-based 32-bit mcus
Hide thumbs Also See for STM32F101 series:
Table of Contents

Advertisement

Universal synchronous asynchronous receiver transmitter (USART)
Procedure:
1.
Enable the USART by writing the UE bit in USART_CR1 register to 1.
2.
Program the M bit in USART_CR1 to define the word length.
3.
Program the number of stop bits in USART_CR2.
4.
Select DMA enable (DMAT) in USART_CR3 if Multi buffer Communication is to take
place. Configure the DMA register as explained in multibuffer communication.
5.
Select the desired baud rate using the USART_BRR register.
6.
Set the TE bit in USART_CR1 to send an idle frame as first transmission.
7.
Write the data to send in the USART_DR register (this clears the TXE bit). Repeat this
for each data to be transmitted in case of single buffer.
8.
After writing the last data into the USART_DR register, wait until TC=1. This indicates
that the transmission of the last frame is complete. This is required for instance when
the USART is disabled or enters the Halt mode to avoid corrupting the last
transmission.
Single byte communication
The TXE bit is always cleared by a write to the data register.
The TXE bit is set by hardware and it indicates:
The data has been moved from TDR to the shift register and the data transmission has
started.
The TDR register is empty.
The next data can be written in the USART_DR register without overwriting the
previous data.
This flag generates an interrupt if the TXEIE bit is set.
785/1128

Figure 280. Configurable stop bits

8-bit Word length (M bit is reset)
Data Frame
Start
Bit0
Bit1
Bit
CLOCK
a) 1 Stop Bit
Data Frame
Start
Bit0
Bit1
Bit
b) 1 1/2 stop Bits
Data Frame
Start
Bit0
Bit1
Bit
c) 2 Stop Bits
Data Frame
Start
Bit0
Bit1
Bit
d) 1/2 Stop Bit
DocID13902 Rev 15
Bit2
Bit3
Bit4
Bit5
Bit6
Bit2
Bit5
Bit6
Bit3
Bit4
Bit2
Bit3
Bit4
Bit5
Bit6
Bit2
Bit3
Bit4
Bit5
Bit6
Possible
Next Data Frame
Parity
Bit
Next
Start
Stop
Bit7
Bit
Bit
****
**
** LBCL bit controls last data clock pulse
Possible
Next Data Frame
Parity
Bit
Next
Start
Bit7
Bit
1 1/2 stop bits
Possible
Next Data Frame
Parity
Bit
Next
2 Stop
Start
Bit7
Bits
Bit
Possible
Next Data Frame
Parity
Bit
Next
Start
Bit7
Bit
1/2 stop bit
RM0008

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F101 series and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Stm32f107 seriesStm32f102 seriesStm32f103 seriesStm32f105 seriesStm32f101 series

Table of Contents