LS_Synchronous serial peripheral (SSP)
RM0082
274/844
Doc ID 018672 Rev 1
Control registers SSPCR0 and SSPCR1 need to be programmed to configure the peripheral
as a master or slave operating under one of the following protocols:
●
Motorola SPI
●
Texas Instruments SSI
●
National Semiconductor.
The bit rate, derived from the APB clock (PCLK), requires the programming of the clock
prescale register SSPCPSR. (Refer to the miscellaneous registers description for the PCLK
frequency).
Defining the chip select
Four chip select lines are available to verify the real availability of the external signal but only
one can be operational at time. The selection of the active one is done using the upper two
GPIO lines. The
FSSOUT
will be connected to the external CSx according to the
13.5.2 Enable
SSP
operation
You can either prime the transmit FIFO, by writing up to eight 16 bit values when the SSP is
disabled, or allow the transmit FIFO service request to interrupt the CPU. Once enabled,
transmission or reception of data begins on the transmit (SSPTXD) and receive (SSPRXD)
pins.
Clock ratios
There is a constraint on the ratio of the frequencies of PCLK to SSPCLK. The frequency of
SSPCLK must be less than or equal to that of PCLK. This ensures that control signals from
the SSPCLK domain to the PCLK domain are certain to get synchronized before one frame
duration:
FSSPCLK <= FPCLK
In the slave mode of operation, the SSPCLKIN signal from the external master is double
synchronized and then delayed to detect an edge. It takes three SSPCLKs to detect an edge
on SSPCLKIN. SSPTXD has less setup time to the falling edge of SSPCLKIN on which the
master is sampling the line. The setup and hold times on SSPRXD with reference to
SSPCLKIN must be more conservative to ensure that it is at the right value when the actual
sampling occurs within the SSPMS. To ensure correct device operation, SSPCLK must be at
least 12 times faster than the maximum expected frequency of SSPCLKIN.
The frequency selected for SSPCLK must accommodate the desired range of bit clock
rates. The ratio of minimum SSPCLK frequency to SSPCLKOUT maximum frequency in the
case of the slave mode is 12 and for the master mode it is two.
Table 210.
External CS selection
GPIO[7]
GPIO[6]
CSx
0
0
CS1
0
1
CS2
1
0
CS3
1
1
CS4