5.1.6.2.1. Informational requirements
USART is used for serial communication between two devices. |
The functionality of the USART includes mode of operation such as data transmission and reception |
The functionality of the USART includes mode of operation such as controlling transmission speed. |
The functionality of the USART includes mode of operation such as operating modes(synchronous and asynchronous). |
The functionality of the USART includes modes of operation such as additional flow control and error detection failures. |
Transmitter is sending data |
Receiever is recieving data |
Control register are used to configure parameters such as baud rate, operating mode and parity. |
USART is used to support asynchronous and synchronous operation modes |
USART has configurable baud rate for flexible communication speed |
Baud rate is the measure of the number of changes to the signal (per second) that propagate through a transmission medium. |
USART has configurable data size(8-bit, 9-bit). |
Odd parity means that the total number of 1s in the data should always be odd number, if bit is corrupted during transmission, the parity check will fail. |
Even parity means that the total number of 1s must always be an even number, if the data is recieved and the total number of 1s is not even, this indicates an error during transmission. |
USART provides even parity control for error detection |
USART provides support for Direct Memory Access, speeding up data transmission. |
Single-wire Half-duplex uses one pin for both data transmission and reception |
STM32F411 supports USART1 which is connected to APB2 bus and uses pins PA9 (TX) and PA10 (RX) |
STM32F411 supports USART2 connected to the APB1 bus and uses pins PA2 (TX) and PA3 (RX). |
STM32F411 supports USART6 connected to APB2 bus and uses pins PC6 (TX) and PC7 (RX). |
USART has two modes: asynchronous mode and synchronous mode |
In asynchronous mode start and stop bits are used to mark the beginning and end of a data packet |
Formula for Baud Rate = fPLCK / (8*(2 - OVER8) * USARTDIV) where FPLCK=Clock frequency, OVER8=Oversampling configuration, USARTDIV=Value in the BRR register. |
In USART the baud rate is controlled using the Baud Rate Register. |
The baud rate depends on the peripheral clock frequency (fPCLK) and the configuration of the USART peripheral. |
The oversampling factor (OVER8) can be adjusted to control the precision and speed of data transmission. |
16x oversampling provides more stable signal |
|
The CR1 is a critical regiter used to configure Baud Rate, Data bits, Stop bits, Parity, Mode of communication for USART communication. |
Basic parameters for USART communication are: Baud Rate, Word lenght, Stop bits, Parity, Flow Control, Oversampling |
UE (Usart Enable) bit enables or disables the USART peripheral |
TE (Transmitter Enable) bit enables or disables data transmission through the USART |
RE (Reciever Enable) bit enables or disables data reception through the USART |
Oversampling refers to taking multiple samples of the data during a single bit cycle to improve the accuracy in data reception. |
USART1 uses AF1, AF4 and AF7 |
USART2 uses AF1, AF4 and AF7 |
USART6 uses AF5, AF8 and AF11 |