15 Quad Synchronous Serial Interface (QSPI)
15-12
Seiko Epson Corporation
S1C31D50/D51 TECHNICAL MANUAL
(Rev. 2.00)
- QSPI_
n
MMACFG2.DUMDL[3:0] bits
(Select dummy cycle drive length)
- QSPI_
n
MMACFG2.DUMLN[3:0] bits
(Select dummy cycle length)
- QSPI_
n
MMACFG2.DATTMOD[1:0] bits (Select data cycle transfer mode)
- QSPI_
n
MMACFG2.DUMTMOD[1:0] bits (Select dummy cycle transfer mode)
- QSPI_
n
MMACFG2.ADRTMOD[1:0] bits (Select address cycle transfer mode)
- QSPI_
n
MMACFG2.ADRCYC bit
(Select 24 or 32-bit address cycle)
- QSPI_
n
MB.XIPACT[7:0] bits
(Set XIP activation mode byte)
- QSPI_
n
MB.XIPEXT[7:0] bits
(Set XIP termination mode byte)
4. Assign the QSPI Ch.
n
input/output function to the ports. (Refer to the “I/O Ports” chapter.)
5. Set the following QSPI_
n
CTL register bits:
- Set the QSPI_
n
CTL.SFTRST bit to 1.
(Execute software reset)
- Set the QSPI_
n
CTL.MODEN bit to 1.
(Enable QSPI Ch.
n
operations)
6. Set the following bits when using the interrupt:
- Write 1 to the interrupt flags in the QSPI_
n
INTF register.
(Clear interrupt flags)
- Set the interrupt enable bits in the QSPI_
n
INTE register to 1. * (Enable interrupts)
*
The initial value of the QSPI_
n
INTF.TBEIF bit is 1, therefore, an interrupt will occur immediately after the
QSPI_
n
INTE.TBEIE bit is set to 1.
7. Configure the DMA controller and set the following QSPI control bits when using DMA transfer:
- Write 1 to the DMA transfer request enable bits in the QSPI_
n
TBEDMAEN, QSPI_
n
RBFDMAEN,
and QSPI_
n
FRLDMAEN registers.
(Enable DMA transfer requests)
15.5.4 Data Transmission in Master Mode
A data sending procedure and operations in master mode are shown below. Figures 15.5.4.1 and 15.5.4.2 show a
timing chart and a flowchart, respectively.
Data sending procedure
1. Set the QSPI_
n
CTL.DIR bit to 0 when QSPI Ch.
n
is set to dual or quad transfer mode. (This setting is not
necessary in single transfer mode.)
2. Assert the slave select signal for the external slave device to be accessed by controlling the QSPI_
n
CTL.
MSTSSO bit or the general-purpose output port used for an extra slave select signal output (if necessary).
3. Check to see if the QSPI_
n
INTF.TBEIF bit is set to 1 (transmit buffer empty).
4. Write transmit data to the QSPI_
n
TXD register.
5. Wait for a QSPI interrupt when using interrupt.
6. Repeat Steps 3 to 5 (or 3 and 4) until the end of transmit data.
7. Negate the slave select signal that has been asserted in Step 2 by controlling the QSPI_
n
CTL.MSTSSO bit
or the general-purpose output port (if necessary).
Data sending operations
QSPI Ch.
n
starts data sending operations when transmit data is written into the QSPI_
n
TXD register.
The transmit data in the QSPI_
n
TXD register is automatically transferred to the shift register and the QSPI_
n
INTF.TBEIF bit is set to 1. If the QSPI_
n
INTE.TBEIE bit = 1 (transmit buffer empty interrupt enabled), a
transmit buffer empty interrupt occurs at the same time.
The QSPICLK
n
pin outputs clocks for the number of cycles specified by the QSPI_
n
MOD.CHLN[3:0] bits and
the transmit data bits are output in sequence from the QSDIO
n
pins, according to the transfer mode specified by
the QSPI_
n
MOD.TMOD[1:0] bits, in sync with these clocks.
Even if the clock is being output from the QSPICLK
n
pin, the next transmit data can be written to the QSPI_
n
TXD register after making sure the QSPI_
n
INTF.TBEIF bit is set to 1.
If transmit data has not been written to the QSPI_
n
TXD register after the last clock is output from the QSPI-
CLK
n
pin, the clock output halts and the QSPI_
n
INTF.TENDIF bit is set to 1. At the same time QSPI issues an
end-of-transmission interrupt request if the QSPI_
n
INTE.TENDIE bit = 1.