RM0082
LS_Synchronous serial peripheral (SSP)
Doc ID 018672 Rev 1
275/844
To generate a maximum bit rate of 1.8432 Mbps in the Master mode, the frequency of
SSPCLK must be at least 3.6864 MHz. With an SSPCLK frequency of 3.6864 MHz, the
SSPCPSR register has to be programmed with a value of two and the SCR[7:0] field in the
SSPCR0 register needs to be programmed as zero.
To work with a maximum bit rate of 1.8432 Mbps in the slave mode, the frequency of
SSPCLK must be at least 22.12 MHz. With an SSPCLK frequency of 22.12 MHz, the
SSPCPSR register can be programmed with a value of 12 and the SCR[7:0] field in the
SSPCR0 register can be programmed as zero. Similarly the ratio of SSPCLK maximum
frequency to SSPCLKOUT minimum frequency is 254 x 256.
The minimum frequency of SSPCLK is governed by the following equations, both of which
have to be satisfied:
●
FSSPCLK(min) => 2 x FSSPCLKOUT(max) [for master mode]
●
FSSPCLK(min) => 12 x FSSPCLKIN(max) [for slave mode].
The maximum frequency of SSPCLK is governed by the following equations, both of which
have to be satisfied:
●
FSSPCLK(max) <= 254 x 256 x FSSPCLKOUT(min) [for master mode]
●
FSSPCLK(max) <= 254 x 256 x FSSPCLKIN(min) [for slave mode]
13.5.3 Programming
the
SSPCR0 control register
The SSPCR0 register is used to:
●
Program the serial clock rate
●
Select one of the three protocols
●
Select the data word size (where applicable).
The Serial Clock Rate (SCR) value, in conjunction with the SSPCPSR clock prescale divisor
value (CPSDVSR), is used to derive the SSP transmit and receive bit rate from the external
SSPCLK.
The frame format is programmed through the FRF bits and the data word size through the
DSS bits.
Bit phase and polarity, applicable to Motorola SPI format only, are programmed through the
SPH and SPO bits.
13.5.4 Programming
the
SSPCR1 control register
The SSPCR1 register is used to:
●
Select master or slave mode
●
Enable a loop back test feature
●
Enable the SSP peripheral.
To configure the SSP as a master, clear the SSPCR1 register master or slave selection bit
(MS) to 0, which is the default value on reset.
Setting the SSPCR1 register MS bit to 1 configures the SSP as a slave. When configured as
a slave, enabling or disabling of the SSP SSPTXD signal is provided through the SSPCR1
slave mode SSPTXD output disable bit (SOD). This can be used in some multi-slave
environments where masters might parallel broadcast.