15-26
MPC561/MPC563 Reference Manual
MOTOROLA
Queued Serial Peripheral Interface
15.6.4
QSPI Operation
The QSPI uses a dedicated 160-byte block of static RAM accessible by both the QSPI and
the CPU to perform queued operations. The RAM is divided into three segments: 32
command control bytes, 64 transmit data bytes, and 64 receive data bytes.
Once the CPU has set up a queue of QSPI commands, written the transmit data segment
with information to be sent, and enabled the QSPI, the QSPI operates independently of the
CPU. The QSPI executes all of the commands in its queue, sets a flag indicating
completion, and then either interrupts the CPU or waits for CPU intervention.
QSPI RAM is organized so that one byte of command data, one word of transmit data, and
one word of receive data correspond to each queue entry, 0x0 to 0x2F.
The CPU initiates QSPI operation by setting up a queue of QSPI commands in command
RAM, writing transmit data into transmit RAM, then enabling the QSPI. The QSPI
executes the queued commands, sets a completion flag (SPIF), and then either interrupts
the CPU or waits for intervention.
There are four queue pointers. The CPU can access three of them through fields in QSPI
registers. The new queue pointer (NEWQP), contained in SPCR2, points to the first
command in the queue. An internal queue pointer points to the command currently being
executed. The completed queue pointer (CPTQP), contained in SPSR, points to the last
command executed. The end queue pointer (ENDQP), contained in SPCR2, points to the
final command in the queue.
The internal pointer is initialized to the same value as NEWQP. During normal operation,
the command pointed to by the internal pointer is executed, the value in the internal pointer
Table 15-20. QSPI Pin Functions
Pin Names
Mnemonic
Mode
Function
Master in slave out
MISO
Master
Slave
Serial data input to QSPI
Serial data output from QSPI
Master out slave in
MOSI
Master
Slave
Serial data output from QSPI
Serial data input to QSPI
Serial clock
SCK 1
1 All QSPI pins (except SCK) can be used as general-purpose I/O if they are not used by the QSPI while the QSPI is operating.
SCK can only be used for general-purpose I/O if the QSPI is disabled.
Master
Slave
Clock output from QSPI clock
Input to QSPI
Peripheral chip selects
PCS[1:3]
Master
Outputs select peripheral(s)
Peripheral chip select 2
Slave select 3
2 An output (PCS0) when the QSPI is in master mode.
3 An input (SS) when the QSPI is in slave mode.
PCS0 /
SS
Master
Slave
Output selects peripheral(s)
Input selects the QSPI
Slave select 4
4 An input (SS) when the QSPI is in master mode; useful in multimaster systems.
SS
Master
May cause mode fault