
XBUS high-speed synchronous serial interface
UM0404
DocID13284 Rev 2
which it expects data either by separate select lines, or by sending a special command to
this slave.
After performing all necessary initialization of the XSSC, the serial interfaces can be
enabled. For a master device, the alternate clock line will now go to its programmed polarity.
The alternate data line will go to either '0' or '1', until the first transfer will start. After a
transfer the alternate data line will always remain at the logic level of the last transmitted
data bit.
When the serial interfaces are enabled, the master device can initiate the first data transfer
by writing the transmit data into register XSSCTB. This value is copied into the shift register
(which is assumed to be empty at this time), and the selected first bit of the transmit data will
be placed onto the MTSR1 line on the next clock from the Baud rate generator
(transmission only starts, if SSCEN = ‘1’). Depending on the selected clock phase, also a
clock pulse will be generated on the SCLK1 line.
With the opposite clock edge the master at the same time latches and shifts in the data
detected at its input line MRST1. This “exchanges” the transmit data with the receive data.
Since the clock line is connected to all slaves, their shift registers will be shifted
synchronously with the master's shift register, shifting out the data contained in the registers,
and shifting in the data detected at the input line. After the pre-programmed number of clock
pulses (via the data width selection) the data transmitted by the master is contained in all
slaves’ shift registers, while the master's shift register holds the data of the selected slave.
In the master and all slaves the content of the shift register is copied into the receive buffer
XSSCRB and the receive interrupt flag SSCRIR is set.
A slave device will immediately output the selected first bit (MSB or LSB of the transfer data)
at pin MRST1, when the content of the transmit buffer is copied into the slave's shift register.
It will not wait for the next clock from the Baud rate generator, as the master does. The
reason for this is that, depending on the selected clock phase, the first clock edge generated
by the master may be already used to clock in the first data bit. So the slave's first data bit
must already be valid at this time.
Note:
A transmission
and
a reception takes place at the same time, regardless whether valid data
has been transmitted or received. This is different from asynchronous reception on ASC0.
The initialization of the SCLK1 pin
on the master requires some attention in order to avoid
undesired clock transitions, which may disturb the other receivers. The state of the internal
alternate output lines is '1' as long as the XSSC is disabled. This alternate output signal is
ANDed with the respective port line output latch. Enabling the XSSC with an idle-low clock
(SSCPO = ‘0’) will drive the alternate data output and (via the AND) the port pin SCLK1
immediately low. To avoid this, use the following sequence:
•
Select the clock idle level (SSCPO = ‘x’)
•
Load the port output latch with the desired clock idle level (XP6.5 = ‘x’)
•
Switch the pin to output (XDP6.5 = ‘1’)
•
Enable the XSSC (SSCEN = ‘1’)
•
If SSCPO = ‘0’: enable alternate data output (XP6.5 = ‘1’)
The same mechanism as for selecting a slave for transmission (separate select lines or
special commands) may also be used to move the role of the master to another device in
the network. In this case the previous master and the future master (previous slave) will
have to toggle their operating mode (SSCMS) and the direction of their port pins (see
description above).