2 master/slave mode, 3 serial bit rate generation, 4 frame format – Cirrus Logic EP93xx User Manual
Page 715
DS785UM1
23-3
Copyright 2007 Cirrus Logic
Synchronous Serial Port
EP93xx User’s Guide
2
3
2
3
23
23.5.2 Master/Slave Mode
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).
23.5.3 Serial Bit Rate Generation
The serial bit rate is derived by dividing down the 7.4 MHz SSPCLK. The clock is first divided
by an even prescale value CPSDVSR from 2 to 254, which is programmed in SSPCPSR. The
clock is further divided by a value from 1 to 256, which is 1 + SCR, where SCR is the value
programmed in SSPCR0. The frequency of the output signal bit clock, SCLKOUT, is defined
below:
F
sspclkout
= F
sspclk
/ (cpsdvr
(1 + scr))
23.5.4 Frame Format
Each data frame is between 4 and 16 bits long depending on the size of data programmed,
and is transmitted starting with the MSB. There are three basic frame types that can be
selected:
•
Texas Instruments synchronous serial
•
Motorola SPI
•
National Semiconductor Microwire.
For all three formats, the serial clock (SCLKOUT) is held inactive while the SSP is idle, and
transitions at the programmed frequency only during active transmission or reception of data.
The idle state of SCLKOUT is utilized to provide a receive timeout indication that occurs
when the receive FIFO still contains data after a timeout period.
For Motorola SPI and National Semiconductor Microwire frame formats, the serial frame
(SFRMOUT) pin is active LOW, and is asserted (pulled down) during the entire transmission
of the frame.
For Texas Instruments synchronous serial frame format, the SFRMOUT pin is pulsed for one
serial clock period starting at its rising edge, prior to the transmission of each frame. For this
frame format, both the SSP and the off-chip slave device drive their output data on the rising
edge of SCLKOUT, and latch data from the other device on the falling edge.
Unlike the full-duplex transmission of the other two frame formats, the National
Semiconductor Microwire format uses a special master-slave messaging technique, which
operates at half-duplex. In this mode, when a frame begins, an 8-bit control message is
transmitted to the off-chip slave. During this transmit, no incoming data is received by the
SSP. After the message has been sent, the off-chip slave decodes it and, after waiting one
serial clock after the last bit of the 8-bit control message has been sent, responds with the
requested data. The returned data can be 4 to 16 bits in length, making the total frame length
anywhere from 13 to 25 bits.