MC68331
USER’S MANUAL
QUEUED SERIAL MODULE
MOTOROLA
6-19
6
riod (DT = 1) is used. The following expression is used to calculate the delay:
32
DTL
×
System Clock Frequency
where DTL equals {1, 2, 3,..., 255}.
A zero value for DTL causes a delay-after-transfer value of 8192/system clock.
17
System Clock
Adequate delay between transfers must be specified for long data streams because
the QSPI requires time to load a transmit RAM entry for transfer. Receiving devices
need at least the standard delay between successive transfers. If the system clock is
operating at a slower rate, the delay between transfers must be increased proportion-
ately.
Operation is initiated by setting the SPE bit in SPCR1. Shortly after SPE is set, the
QSPI executes the command at the command RAM address pointed to by NEWQP.
Data at the pointer address in transmit RAM is loaded into the data serializer and
transmitted. Data that is simultaneously received is stored at the pointer address in re-
ceive RAM.
When the proper number of bits have been transferred, the QSPI stores the working
queue pointer value in CPTQP, increments the working queue pointer, and loads the
next data for transfer from transmit RAM. The command pointed to by the incremented
working queue pointer is executed next, unless a new value has been written to
NEWQP. If a new queue pointer value is written while a transfer is in progress, that
transfer is completed normally.
When the CONT bit in command RAM is set, PCS pins are continuously driven in
specified states during and between transfers. If the chip-select pattern changes dur-
ing or between transfers, the original pattern is driven until execution of the following
transfer begins. When CONT is cleared, the data in register PORTQS is driven be-
tween transfers.
When the QSPI reaches the end of the queue, it sets the SPIF flag. If the SPIFIE bit
in SPCR2 is set, an interrupt request is generated when SPIF is asserted. At this point,
the QSPI clears SPE and stops unless wraparound mode is enabled.
6.3.5.2 Master Wraparound Mode
Wraparound mode is enabled by setting the WREN bit in SPCR2. The queue can wrap
to pointer address $0 or to the address pointed to by NEWQP, depending on the state
of the WRTO bit in SPCR2.
In wraparound mode, the QSPI cycles through the queue continuously, even while the
QSPI is requesting interrupt service. SPE is not cleared when the last command in the
queue is executed. New receive data overwrites previously received data in receive
RAM. Each time the end of the queue is reached, the SPIF flag is set. SPIF is not au-
tomatically reset. If interrupt-driven SPI service is used, the service routine must clear
the SPIF bit to abort the current request. Additional interrupt requests during servicing
Delay after Transfer
------------------------------------------------------------------
=
Standard Delay after Transfer
------------------------------------
=