Electronics circuit calculation > AVR USART Baud rate calculation.
USART The Universal Synchronous and Asynchronous serial Receiver and Transmitter (USART) is a highly flexible serial communication device. The main features are:
- Full Duplex Operation (Independent Serial Receive and Transmit Registers)
- Asynchronous or Synchronous Operation
- Master or Slave Clocked Synchronous Operation
- High Resolution Baud Rate Generator
- Supports Serial Frames with 5, 6, 7, 8, or 9 Data Bits and 1 or 2 Stop Bits
- Odd or Even Parity Generation and Parity Check Supported by Hardware
- Data OverRun Detection
- Framing Error Detection
- Noise Filtering Includes False Start Bit Detection and Digital Low Pass Filter
- Three Separate Interrupts on TX Complete, TX Data Register Empty, and RX Complete
- Multi-processor Communication Mode
- Double Speed Asynchronous Communication Mode
Equations for calculating baud rate
| U2X = 0 | UBRR = [Fosc / 16 x Baud Rate] - 1 |
| U2X = 1 | UBRR = [Fosc / 8 x Baud Rate] - 1 |
| Synchronous | UBRR = [Fosc / 2 x Baud Rate] - 1 |