34.5.2.3 Clock Generation – Baud-Rate Generator

Each SERCOM contains a baud rate generator as shown in the following figure, which can generate an internal clock for asynchronous or synchronous communication. The output frequency (fBAUD) is determined by the Baud register (BAUD) setting and the baud reference clock frequency (fref). The baud reference clock is the serial engine clock, and it can be internal or external.

For asynchronous communication, the /16 (divide-by-16) output is used when transmitting, whereas the /1 (divide-by-1) output is used while receiving.

For synchronous communication, the /2 (divide-by-2) output is used.

This functionality is automatically configured, depending on the selected operating mode.

Figure 34-3. Baud Rate Generator

The following table contains equations for the baud rate (in bits per second) and the BAUD register value for each operating mode.

For Asynchronous Arithmetic mode, the BAUD register value is 16 bits (0 to 65,535).

For Asynchronous Fractional mode, the BAUD register value contains 13 bits of integer (BAUD.BAUD) as well as a 3 bit fractional adjustment (BAUD.FP). In this mode the BAUD setting must be greater than or equal to 1. This mode is used for auto baud detection. See CTRLA.FORM and CRTLA.SAMPR.

For Synchronous operation, the BAUD register value is 8 bits (0 to 255). CRTLA.CMODE=1.

Table 34-2. Baud Rate Equations
Operating ModeConditionBaud Rate (Bits Per Second)BAUD Register Value Calculation
Asynchronous ArithmeticfBAUDfref16fBAUD=fref16(1BAUD65536)BAUD=65536(116fBAUDfref)
Asynchronous FractionalfBAUDfrefSfBAUD=frefS(BAUD+FP8)BAUD=frefSfBAUDFP8
SynchronousfBAUDfref2fBAUD=fref2(BAUD+1)BAUD=fref2fBAUD1

S = Number of samples per bit, which can be 16, 8, or 3.

The baud rate error is represented by the following formula:

Error=1(ExpectedBaudRateActualBaudRate)

Asynchronous Arithmetic Mode BAUD Value Selection

The formula given for fBAUD calculates the average frequency over 65536 fref cycles. Although the BAUD register can be set to any value between 0 and 65536, the actual average frequency of fBAUD over a single frame is more granular. The BAUD register values that will affect the average frequency over a single frame lead to an integer increase in the cycles per frame (CPF)

CPF=freffBAUD(D+S)

where:

  • D represent the data bits per frame
  • S represent the sum of start and first stop bits, if present.

The following table shows the BAUD register value versus baud frequency fBAUD at a serial engine frequency of 48 MHz. This assumes a D value of 8 bits and an S value of 2 bits (10 bits, including start and stop bits).

Table 34-3. BAUD Register Value vs. Baud Frequency
BAUD Register ValueSerial Engine CPFfBAUD at 48MHz Serial Engine Frequency (fREF)
0 – 4061603 MHz
407 – 8081612.981 MHz
809 – 12051622.963 MHz
.........
652063177515.11 kHz
652073187115.06 kHz
652083196915.01 kHz