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.

Note: In normal SPI mode, the host clock (via SCK pin) is not free-running. It will only run for 8, 16 or 32 pulses when SPIxBUF is loaded with data. However, the clock will run continuously in Framed SPI mode a subset of the TDM mode.

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.

Table 47-3. Sample SCK Frequencies
SPIxBRG
APBm_clk115316385127255511
100.00E+625.00E+63.13E+61.56E+6781.25E+3581.40E+3390.63E+3195.31E+397.66E+3
SPIxBRG
APBm_clk115316385127255511
96.00E+624.00E+63.00E+61.50E+6750.00E+3558.14E+3375.00E+3187.50E+393.75E+3
SPIxBRG
APBm_clk115316385127255511
80.00E+620.00E+62.50E+61.25E+6625.00E+3465.12E+3312.50E+3156.25E+378.13E+3
SPIxBRG
APBm_clk115316385127255511
60.00E+615.00E+61.88E+6937.50E+3468.75E+3348.84E+3234.38E+3117.19E+358.59E+3
SPIxBRG
APBm_clk015316385127255511
50.00E+625.00E+61.56E+6781.25E+3390.63E+3290.70E+3195.31E+397.66E+348.83E+3
SPIxBRG
APBm_clk015316385127255511
48.00E+624.00E+61.50E+6750.00E+3375.00E+3279.07E+3187.50E+393.75E+346.88E+3
SPIxBRG
APBm_clk015316385127255511
40.00E+620.00E+61.25E+6625.00E+3312.50E+3232.56E+3156.25E+378.13E+339.06E+3
SPIxBRG
APBm_clk015316385127255511
33.00E+616.50E+61.03E+6515.63E+3257.81E+3191.86E+3128.91E+364.45E+332.23E+3
SPIxBRG
APBm_clk015316385127255511
25.00E+612.50E+6781.25E+3390.63E+3195.31E+3145.35E+397.66E+348.83E+324.41E+3
SPIxBRG
APBm_clk015316385127255511
20.00E+610.00E+6625.00E+3312.50E+3156.25E+3116.28E+378.13E+339.06E+319.53E+3
SPIxBRG
APBm_clk015316385127255511
12.00E+66.00E+6375.00E+3187.50E+393.75E+369.77E+346.88E+323.44E+311.72E+3
SPIxBRG
APBm_clk015316385127255511
10.00E+65.00E+6312.50E+3156.25E+378.13E+358.14E+339.06E+319.53E+39.77E+3
SPIxBRG
APBm_clk015316385127255511
8.00E+64.00E+6250.00E+3125.00E+362.50E+346.51E+331.25E+315.63E+37.81E+3