9- 38
MC68341 USER’S MANUAL
MOTOROLA
Transmit data is loaded into the data serializer (refer to 9.5.4.4 QSPI Control Register 3
(SPCR3)). The QSPI employs control bits, CPHA and CPOL, to determine which SCK
edge the MISO pin uses to latch incoming data and which edge the MOSI pin uses to start
driving the outgoing data. SPBR of SPCR0 determines the baud rate of SCK. DSCK and
DSCKL determine any peripheral chip selects valid to SCK start delay.
The number of bits transferred is determined by BITSE and BITS fields. Two options are
available: the user may use the default value of 8 bits, or the user may program the length
from 8–16 bits, inclusive.
Once the proper number of bits are transferred, the QSPI stores the received data in the
receive data segment, stores the internal working queue pointer value in CPTQP,
increments the internal working queue pointer, and loads the next data required for
transfer from the queue. The internal working queue pointer address is the next command
executed unless the CPU writes a new value first.
If CONT is set and the peripheral-chip-select pattern does not change between the current
and the pending transfer, the PCS pins are continuously driven in their designated state
during and between both serial transfers. If the peripheral-chip-select pattern changes,
then the first pattern is driven out during execution of the first transfer, followed by the
QSPI switching to the next pattern of the second transfer when execution of the second
transfer begins. If CONT is clear, the deselected peripheral-chip-select values (found in
register QPDR) are driven out between transfers.
DT causes a delay to occur after the specified serial transfer is completed. The length of
the delay is determined by DTL. When DT is clear, the standard delay (1
s at a 16.78-
MHz system clock) occurs after the specified serial transfer is completed.
9.5.5.1.2 Master 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 may 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 a
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 increments to the next address,
and the commands are executed again. SPE is not cleared by the QSPI. New receive
data overwrites previously received data in the 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
..
.