Queued Serial Multi-Channel Module
MPC561/MPC563 Reference Manual, Rev. 1.2
Freescale Semiconductor
15-41
QSPI is selected it resumes storing bits in the same receive-data segment address where it left off. If more
than 16 bits are transferred before negating the PCS0/SS, the QSPI stores the number of bits indicated by
BITS in the current receive data segment address, then increments the address and continues storing as
described above.
NOTE
PCS0/SS does not necessarily have to be negated between transfers.
Once the proper number of bits (designated by 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 new transmit data from the transmit data segment into the
data serializer. The internal working queue pointer address is used the next time PCS0/SS is asserted,
unless the CPU writes to the NEWQP first.
The DT and DSCK command control bits are not used in slave mode. As a slave, the QSPI does not drive
the clock line nor the chip-select lines and, therefore, does not generate a delay.
In slave mode, the QSPI shifts out the data in the transmit data segment. The trans-mit data is loaded into
the data serializer (refer to
) for transmission. When the PCS0/SS pin is pulled low the MISO
pin becomes active and the serializer then shifts the 16 bits of data out in sequence, most significant bit
first, as clocked by the incoming SCK signal. The QSPI uses CPHA and CPOL to determine which
incoming SCK edge the MOSI pin uses to latch incoming data, and which edge the MISO pin uses to drive
the data out.
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.
15.6.7
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 gen-erated 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 <XrefBlue>15.6.1.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
Summary of Contents for MPC561
Page 84: ...MPC561 MPC563 Reference Manual Rev 1 2 lxxxiv Freescale Semiconductor...
Page 144: ...Signal Descriptions MPC561 MPC563 Reference Manual Rev 1 2 2 46 Freescale Semiconductor...
Page 206: ...Central Processing Unit MPC561 MPC563 Reference Manual Rev 1 2 3 62 Freescale Semiconductor...
Page 302: ...Reset MPC561 MPC563 Reference Manual Rev 1 2 7 14 Freescale Semiconductor...
Page 854: ...Time Processor Unit 3 MPC561 MPC563 Reference Manual Rev 1 2 19 24 Freescale Semiconductor...
Page 968: ...Development Support MPC561 MPC563 Reference Manual Rev 1 2 23 54 Freescale Semiconductor...
Page 1144: ...Internal Memory Map MPC561 MPC563 Reference Manual Rev 1 2 B 34 Freescale Semiconductor...
Page 1212: ...TPU3 ROM Functions MPC561 MPC563 Reference Manual Rev 1 2 D 60 Freescale Semiconductor...
Page 1216: ...Memory Access Timing MPC561 MPC563 Reference Manual Rev 1 2 E 4 Freescale Semiconductor...