Internal Clock Generation - The Fractional Baud Rate Generator

The baud rate generator is used for internal clock generation for asynchronous modes, synchronous master mode, and master SPI mode operation. The output frequency generated (fBAUD) is determined by the Baud register value (BAUD in USART.BAUD) and the peripheral clock frequency (fCLK_PER). The following table contains equations for calculating the baud rate (in bits per second) and for calculating the BAUD value for each mode of operation. It also shows the maximum baud rate versus peripheral clock frequency. For asynchronous operation, the BAUD register value is 16 bits. The 10 MSBs (BAUD[15:6]) hold the integer part, while the 6 LSBs (BAUD[5:0]) hold the fractional part. In synchronous mode, only the integer part of the BAUD register determine the baud rate.

Table 1. Equations for Calculating Baud Rate Register Setting
Operating Mode Conditions Baud Rate (Bits Per Seconds) USART.BAUD Register Value Calculation
Asynchronous
fBAUDfCLK_PERS
fBAUD=64×fCLK_PERS×BAUD
BAUD=64×fCLK_PERS×fBAUD
Synchronous
fBAUDfCLK_PER2
fBAUD=fCLK_PER2×BAUD[15:6]
BAUD[15:6]=fCLK_PER2×fBAUD

S is the number of samples per bit. In Asynchronous operating mode (CMODE[0]=0), it could be set as 16 (NORMAL mode) or 8 (CLK2X mode) by RXMODE in USART.CTRLB. For Synchronous operating mode (CMODE[0]=1), S equals 2.