
QSM
REFERENCE MANUAL
QSPI SUBMODULE
MOTOROLA
4-9
The SPIF interrupt must be cleared by clearing SPIF. Later interrupts may then be pre-
vented by clearing SPIFIE to zero.
The QSPI has three possible interrupt sources, but only one interrupt vector. These
sources are SPIF, MODF, and HALTA. When the CPU responds to a QSPI interrupt,
the user must ascertain the exact interrupt cause by reading register SPSR. Any inter-
rupt that was set may then be cleared by writing to SPSR with a zero in the bit position
corresponding to the exact interrupt source. Clearing SPIFIE does not immediately
clear an interrupt already caused by SPIF.
WREN — Wrap Enable
1 = Wraparound mode enabled
0 = Wraparound mode disabled
WREN enables or disables wraparound mode. If enabled, the QSPI executes com-
mands in the queue through the command contained in ENDQP. Execution continues
at either address $0 or at the address found in NEWQP, depending on the state of WR-
TO. The QSPI continues looping until either WREN is negated, HALT is asserted, or
SPE is negated. Once WREN is negated, the QSPI finishes executing commands
through the command at the address contained in ENDQP, sets the SPIF flag, and
stops. When WREN is set, SPIF is set each time the QSPI transfers the entry indicated
by ENDQP.
WRTO — Wrap To
When wraparound mode is enabled and after the end of queue has been reached,
WRTO determines which address the QSPI executes next. End of queue is deter-
mined by an address match with ENDQP. Execution wraps to address $0 if WRTO is
not set, or to the address found in NEWQP if WRTO is set.
Bit 12 — Not Implemented
ENDQP — Ending Queue Pointer
This field determines the last absolute address in the queue to be completed by the
QSPI. After completing each command, the QSPI compares the queue pointer value
of the just-completed command with the value of ENDQP. If the two values match, the
QSPI assumes it has reached the end of the programmed queue and sets the SPIF
flag to so indicate.
The QSPI RAM queue has 16 entries: $0–$F. The user may program the NEWQP to
start executing commands, beginning at any of the 16 addresses. Similarly, the user
may program the ENDQP to stop execution of commands at any of the 16 addresses.
The queue is a circular data structure. If ENDQP is set to a lower address than
NEWQP, the QSPI executes commands through address $F, and then continues ex-
ecution at address $0 and so on until it stops after executing the command at address
ENDQP. A maximum of 16 commands are executed before stopping, unless wrap-
around mode is enabled or unless the user modifies NEWQP and/or ENDQP.
The user may write a NEWQP value at any time, changing the flow of execution.
ENDQP may also be written at any time, changing the length of the queue. Wrap-
around mode may also be enabled, causing continuous execution until the mode is
disabled or the QSPI is halted.
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.