Data Transmission In Master Mode - Epson S1C31W74 Technical Manual

Cmos 32-bit single chip microcontroller
Table of Contents

Advertisement

14 SYNCHRONOUS SERIAL INTERFACE (SPIA)

14.5.2 Data Transmission in Master Mode

A data sending procedure and operations in master mode are shown below. Figures 14.5.2.1 and 14.5.2.2 show a
timing chart and a flowchart, respectively.
Data sending procedure
1. Assert the slave select signal by controlling the general-purpose output port (if necessary).
2. Check to see if the SPIA_nINTF.TBEIF bit is set to 1 (transmit buffer empty).
3. Write transmit data to the SPIA_nTXD register.
4. Wait for an SPIA interrupt when using the interrupt.
5. Repeat Steps 2 to 4 (or 2 and 3) until the end of transmit data.
6. Negate the slave select signal by controlling the general-purpose output port (if necessary).
Data sending operations
SPIA Ch.n starts data sending operations when transmit data is written to the SPIA_nTXD register.
The transmit data in the SPIA_nTXD register is automatically transferred to the shift register and the SPIA_
nINTF.TBEIF bit is set to 1. If the SPIA_nINTE.TBEIE bit = 1 (transmit buffer empty interrupt enabled), a
transmit buffer empty interrupt occurs at the same time.
The SPICLKn pin outputs clocks of the number of the bits specified by the SPIA_nMOD.CHLN[3:0] bits and
the transmit data bits are output in sequence from the SDOn pin in sync with these clocks.
Even if the clock is being output from the SPICLKn pin, the next transmit data can be written to the SPIA_
nTXD register after making sure the SPIA_nINTF.TBEIF bit is set to 1.
If transmit data has not been written to the SPIA_nTXD register after the last clock is output from the SPI-
CLKn pin, the clock output halts and the SPIA_nINTF.TENDIF bit is set to 1. At the same time SPIA issues an
end-of-transmission interrupt request if the SPIA_nINTE.TENDIE bit = 1.
SPICLKn
SDOn
SPIA_nINTF.TBEIF
SPIA_nINTF.TENDIF
Software operations
Figure 14.5.2.1 Example of Data Sending Operations in Master Mode (SPIA_nMOD.CHLN[3:0] bits = 0x7)
14-6
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
Data (W) → SPIA_nTXD
Data (W) → SPIA_nTXD
Seiko Epson Corporation
1 2 3 4 5 6 7 8
Data (W) → SPIA_nTXD
1 (W) → SPIA_nINTF.TENDIF
S1C31W74 TECHNICAL MANUAL
(Rev. 1.1)

Advertisement

Table of Contents
loading

Table of Contents