MOTOROLA
MC68341 USER’S MANUAL
9- 39
Wraparound mode is properly exited in two ways: a) The CPU may disable wraparound
mode by clearing WREN. The next time the end of the queue is reached, the QSPI sets
SPIF, clears SPE, and stops; b) The CPU sets HALT. This second method halts the QSPI
after the current transfer is completed, allowing the CPU to negate SPE. The CPU can
immediately stop the QSPI by clearing SPE; however, this method is not recommended as
it causes the QSPI to abort a serial transfer in process.
9.5.5.2 SLAVE MODE. When operating in slave mode, the QSPI may respond to
externally initiated serial transfers. The QSPI is unable to initiate any serial transfers.
Slave mode is typically used when multiple devices are in an SPI bus network, because
only one device can be the SPI master (in master mode) at any given time.
QSPM register QDDR should be written to direct data flow on the QSPI pins used. The
MISO and MOSI pins, if needed, should be configured as output and input, respectively.
Pins SCK and PCS0/SS should be configured as inputs.
QSPM register QPAR should be written to assign the necessary bits to the QSPI. The pins
necessary for slave mode operation are MISO and/or MOSI, SCK, and PCS0/SS. MISO is
the data output pin in slave mode, and MOSI is the data input pin in slave mode. Either or
both may be necessary depending on the particular application. The serial clock (SCK) is
the slave clock input in slave mode. PCS0/SS is the slave select pin used to select the
QSPI for a serial transfer by the external SPI bus master when the QSPI is in slave mode.
The external bus master selects the QSPI by driving PCS0/ SS low. The command control
segment is not implemented in slave mode; therefore, the CPU does not need to initialize
it. This segment of the QSPI RAM and any other unused segments may be employed by
the CPU as general-purpose RAM. Other considerations for initialization are prescribed in
9.4.1 Overall QSPM Configuration Summary.
9.5.5.2.1 Description of Slave Operation. After reset, the QSPM registers and the QSPI
control registers must be initialized as described above. Although the command control
segment is not used, the transmit and receive data segments may, depending upon the
application, need to be initialized. If meaningful data is to be sent out from the QSPI, the
user should write the data to the transmit data segment before enabling the QSPI.
If SPE is set and MSTR is not set, a low state on the slave select (PCS0/SS) pin
commences slave mode operation at the address indicated by NEWQP. The QSPI
transmits the data found in the transmit data segment at the address indicated by
NEWQP, and the QSPI stores received data in the receive data segment at the address
indicated by NEWQP. Data is transferred in response to an external slave clock input at
the SCK pin.
Because the command control segment is not used, the command control bits and
peripheral-chip-select codes have no effect in slave mode operation. The QSPI does not
drive either of the two peripheral chip selects as outputs. PCS0/SS is used as an input.
Although CONT cannot be used in slave mode, a provision is made to enable receipt of
more than 16 data bits. While keeping the QSPI selected (PCS0/ SS is held low), the QSPI
stores the number of bits, designated by BITS, in the current receive data segment
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
..
.