MC68F375
QUEUED SERIAL MULTI-CHANNEL MODULE
MOTOROLA
REFERENCE MANUAL
Rev. 25 June 03
6-37
of the bit in PORTQS that corresponds to the chip-select pin determines the base state
of the chip-select signal. If the base state is zero, chip-select assertion must be active
high (PCS bit in command RAM must be set); if base state is one, assertion must be
active low (PCS bit in command RAM must be cleared). PORTQS bits are cleared dur-
ing reset. If no new data is written to PORTQS before pin assignment and
configuration as an output, the base state of chip-select signals is zero and chip-select
pins are configured for active-high operation.
6.7.5.7 Master Wraparound Mode
Wraparound mode is enabled by setting the WREN bit in SPCR2. The queue can wrap
to pointer address 0x0 or to the address pointed to by NEWQP, depending on the state
of the WRTO bit in SPCR2.
In wraparound mode, the QSPI cycles through the queue continuously, even while the
QSPI is requesting interrupt service. SPE is not cleared when the last command in the
queue is executed. New receive data overwrites previously received data in receive
RAM. Each time the end of the queue is reached, the SPIF flag is set. SPIF is not auto-
matically reset. If interrupt-driven QSPI service is used, the service routine must clear
the SPIF bit to end the current interrupt request. Additional interrupt requests during
servicing can be prevented by clearing SPIFIE, but SPIFIE is buffered. Clearing it does
not end the current request.
Wraparound mode is exited by clearing the WREN bit or by setting the HALT bit in
SPCR3. Exiting wraparound mode by clearing SPE is not recommended, as clearing
SPE may abort a serial transfer in progress. The QSPI sets SPIF, clears SPE, and
stops the first time it reaches the end of the queue after WREN is cleared. After HALT
is set, the QSPI finishes the current transfer, then stops executing commands. After
the QSPI stops, SPE can be cleared.
6.7.6 Slave Mode
Clearing the MSTR bit in SPCR0 selects slave mode operation. In slave mode, the
QSPI is unable to initiate serial transfers. Transfers are initiated by an external SPI bus
master. Slave mode is typically used on a multi-master SPI bus. Only one device can
be bus master (operate in master mode) at any given time.
Before QSPI operation is initiated, QSMCM register PQSPAR must be written to
assign necessary pins to the QSPI. The pins necessary for slave mode operation are
MISO, MOSI, SCK, and PCS0/SS. MISO is used for serial data output in slave mode,
and MOSI is used for serial data input. Either or both may be necessary, depending
on the particular application. SCK is the serial clock input in slave mode and must be
assigned to the QSPI for proper operation. Assertion of the active-low slave select sig-
nal SS initiates slave mode operation.
Before slave mode operation is initiated, DDRQS must be written to direct data flow
on the QSPI pins used. Configure the MOSI, SCK and PCS0/SS pins as inputs. The
MISO pin must be configured as an output.
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
..
.