MC68F375
QUEUED SERIAL MULTI-CHANNEL MODULE
MOTOROLA
REFERENCE MANUAL
Rev. 25 June 03
6-24
6.7.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 seg-
ment 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 com-
mand 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 opera-
tion, the command pointed to by the internal pointer is executed, the value in the
internal pointer is copied into CPTQP, the internal pointer is incremented, and then the
Table 6-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
SCK1
NOTES:
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 select2
Slave select3
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 select4
4. An input (SS) when the QSPI is in master mode; useful in multimaster systems.
SS
Master
May cause mode fault
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
..
.