47.5.11 Host Mode Clocking
The SPI macro has a 13-bit baud rate generator to allow flexibility in baud rate generation. The SPIxBRG register is readable and writable and determines the baud rate. The GCLK_IxS provided to the peripheral is a divider function of the CPU core clock. This clock can then again be divided, based on the value loaded in the SPIxBRG register, before it is provided to the external devices via the SCK pin. The SCK clock is of 50% duty cycle. Some sample SPI clock frequencies are shown in Sample SCK Frequencies.
SCK Frequency Calculation
FPB = Peripheral Bus clock frequency
Baud Rate = FPB / (2* (SPIxBRG + 1))
Therefore, the maximum baud rate possible is FPB/2 (SPIXBRG = 0) and the minimum baud rate possible is FPB/16384.
SPIxBRG | ||||||||
APBm_clk | 1 | 15 | 31 | 63 | 85 | 127 | 255 | 511 |
100.00E+6 | 25.00E+6 | 3.13E+6 | 1.56E+6 | 781.25E+3 | 581.40E+3 | 390.63E+3 | 195.31E+3 | 97.66E+3 |
SPIxBRG | ||||||||
APBm_clk | 1 | 15 | 31 | 63 | 85 | 127 | 255 | 511 |
96.00E+6 | 24.00E+6 | 3.00E+6 | 1.50E+6 | 750.00E+3 | 558.14E+3 | 375.00E+3 | 187.50E+3 | 93.75E+3 |
SPIxBRG | ||||||||
APBm_clk | 1 | 15 | 31 | 63 | 85 | 127 | 255 | 511 |
80.00E+6 | 20.00E+6 | 2.50E+6 | 1.25E+6 | 625.00E+3 | 465.12E+3 | 312.50E+3 | 156.25E+3 | 78.13E+3 |
SPIxBRG | ||||||||
APBm_clk | 1 | 15 | 31 | 63 | 85 | 127 | 255 | 511 |
60.00E+6 | 15.00E+6 | 1.88E+6 | 937.50E+3 | 468.75E+3 | 348.84E+3 | 234.38E+3 | 117.19E+3 | 58.59E+3 |
SPIxBRG | ||||||||
APBm_clk | 0 | 15 | 31 | 63 | 85 | 127 | 255 | 511 |
50.00E+6 | 25.00E+6 | 1.56E+6 | 781.25E+3 | 390.63E+3 | 290.70E+3 | 195.31E+3 | 97.66E+3 | 48.83E+3 |
SPIxBRG | ||||||||
APBm_clk | 0 | 15 | 31 | 63 | 85 | 127 | 255 | 511 |
48.00E+6 | 24.00E+6 | 1.50E+6 | 750.00E+3 | 375.00E+3 | 279.07E+3 | 187.50E+3 | 93.75E+3 | 46.88E+3 |
SPIxBRG | ||||||||
APBm_clk | 0 | 15 | 31 | 63 | 85 | 127 | 255 | 511 |
40.00E+6 | 20.00E+6 | 1.25E+6 | 625.00E+3 | 312.50E+3 | 232.56E+3 | 156.25E+3 | 78.13E+3 | 39.06E+3 |
SPIxBRG | ||||||||
APBm_clk | 0 | 15 | 31 | 63 | 85 | 127 | 255 | 511 |
33.00E+6 | 16.50E+6 | 1.03E+6 | 515.63E+3 | 257.81E+3 | 191.86E+3 | 128.91E+3 | 64.45E+3 | 32.23E+3 |
SPIxBRG | ||||||||
APBm_clk | 0 | 15 | 31 | 63 | 85 | 127 | 255 | 511 |
25.00E+6 | 12.50E+6 | 781.25E+3 | 390.63E+3 | 195.31E+3 | 145.35E+3 | 97.66E+3 | 48.83E+3 | 24.41E+3 |
SPIxBRG | ||||||||
APBm_clk | 0 | 15 | 31 | 63 | 85 | 127 | 255 | 511 |
20.00E+6 | 10.00E+6 | 625.00E+3 | 312.50E+3 | 156.25E+3 | 116.28E+3 | 78.13E+3 | 39.06E+3 | 19.53E+3 |
SPIxBRG | ||||||||
APBm_clk | 0 | 15 | 31 | 63 | 85 | 127 | 255 | 511 |
12.00E+6 | 6.00E+6 | 375.00E+3 | 187.50E+3 | 93.75E+3 | 69.77E+3 | 46.88E+3 | 23.44E+3 | 11.72E+3 |
SPIxBRG | ||||||||
APBm_clk | 0 | 15 | 31 | 63 | 85 | 127 | 255 | 511 |
10.00E+6 | 5.00E+6 | 312.50E+3 | 156.25E+3 | 78.13E+3 | 58.14E+3 | 39.06E+3 | 19.53E+3 | 9.77E+3 |
SPIxBRG | ||||||||
APBm_clk | 0 | 15 | 31 | 63 | 85 | 127 | 255 | 511 |
8.00E+6 | 4.00E+6 | 250.00E+3 | 125.00E+3 | 62.50E+3 | 46.51E+3 | 31.25E+3 | 15.63E+3 | 7.81E+3 |