Serial Peripheral Interface (SPI)
C2000 Microcontroller Workshop - Communications 13 - 7
SPI Registers
SPI Baud Rate Register
SpixRegs.SPIBRR
15-7 6-0
reserved
SPI BIT RATE
SPICLK signal =
LSPCLK
(SPIBRR + 1)
LSPCLK
4
, SPIBRR = 3 to 127
, SPIBRR = 0, 1, or 2
Need to set this only when in master mode!
Baud Rate Determination: The Master specifies the communication baud rate using its baud rate
register (SPIBRR.6-0):
• For SPIBRR = 3 to 127: SPI Baud Rate =
bits/sec
• For SPIBRR = 0, 1, or 2: SPI Baud Rate =
bits/sec
From the above equations, one can compute
Maximum data rate = 20 Mbps @ 80 MHz
Character Length Determination: The Master and Slave must be configured for the same
transmission character length. This is done with bits 0, 1, 2 and 3 of the configuration control
register (SPICCR.3-0). These four bits produce a binary number, from which the character length
is computed as binary + 1 (e.g. SPICCR.3-0 = 0010 gives a character length of 3).