
MOTOROLA
MC68341 USER’S MANUAL
9- 41
The QSPI transmits and receives data until reaching the end of the queue (defined as a
match with the address in ENDQP), regardless of whether PCS0/SS remains selected or
is toggled between serial transfers. Receiving the proper number of bits causes the
received data to be stored. The QSPI always transmits as many bits as it receives at each
queue address, until the BITS value is reached or PCS0/SS is negated.
9.5.5.2.2 Slave Wraparound Mode. When the QSPI reaches the end of the queue, it
always sets the SPIF flag, whether wraparound mode is enabled or disabled. An optional
interrupt to the CPU is generated when SPIF is asserted. At this point, the QSPI clears
SPE and stops unless wraparound mode is enabled. A description of SPIFIE bit can be
found in 9.5.4.3 QSPI Control Register 2 (SPCR2).
In wraparound mode, the QSPI cycles through the queue continuously. Each time the end
of the queue is reached, the SPIF flag is set. If the CPU fails to clear SPIF, it remains set,
and the QSPI continues to send interrupt requests to the CPU (assuming SPIFIE is set).
The user may avoid causing CPU interrupts by clearing SPIFIE. As SPIFIE is buffered,
clearing it after the SPIF flag is asserted does not immediately stop the CPU interrupts,
but only prevents future interrupts from this source. To clear the current interrupt, the CPU
must read QSPI register SPSR with SPIF asserted, followed by a write to SPSR with zero
in SPIF (clear SPIF).
Execution continues in wraparound mode even while the QSPI is requesting interrupt
service from the CPU. The internal working queue pointer is incremented to the next
address and the commands are executed again. SPE is not cleared by the QSPI. New
receive data overwrites previously received data located in the receive-data segment.
Wraparound mode is properly exited in two ways: a) The CPU may disable wraparound
mode by clearing WREN. The next time end of the queue is reached, the QSPI sets SPIF,
clears SPE, and stops; and, 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.
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
..
.