Epson S1C17W03 Technical Manual page 139

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

13 SYNCHRONOUS SERIAL INTERFACE (SPIA)
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 SPInTXD register.
The transmit data in the SPInTXD register is automatically transferred to the shift register and the SPInINTF.
TBEIF bit is set to 1. If the SPInINTE.TBEIE bit = 1 (transmit buffer empty interrupt enabled), a transmit buf-
fer empty interrupt occurs at the same time.
The SPICLKn pin outputs clocks of the number of the bits specified by the SPInMOD.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 SPInTXD
register after making sure the SPInINTF.TBEIF bit is set to 1.
If transmit data has not been written to the SPInTXD register after the last clock is output from the SPICLKn
pin, the clock output halts and the SPInINTF.TENDIF bit is set to 1. At the same time SPIA issues an end-of-
transmission interrupt request if the SPInINTE.TENDIE bit = 1.
SPICLKn
SDOn
SPInINTF.TBEIF
SPInINTF.TENDIF
Software operations
Figure 13.5.2.1 Example of Data Sending Operations in Master Mode (SPInMOD.CHLN[3:0] bits = 0x7)
(
Assert the slave select signal output from
(
Negate the slave select signal output from
13-6
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
Data (W) → SPInTXD
Data (W) → SPInTXD
Data transmission
a general-purpose port
Read the SPInINTF.TBEIF bit
SPInINTF.TBEIF = 1 ?
YES
Write transmit data to
the SPInTXD register
Transmit data remained?
NO
a general-purpose port
End
Figure 13.5.2.2 Data Transmission Flowchart in Master Mode
Seiko Epson Corporation
Data (W) → SPInTXD
1 (W) → SPInINTF.TENDIF
)
NO
YES
Wait for an interrupt request
(SPInINTF.TBEIF = 1)
)
S1C17W03/W04 TECHNICAL MANUAL
1 2 3 4 5 6 7 8
(Rev. 1.2)

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c17w04

Table of Contents