Terminating Data Transfer In Master Mode; Data Transfer In Slave Mode - Epson S1C17M20 Technical Manual

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

13 SYNCHRONOUS SERIAL INTERFACE (SPIA)
Data reception
(
Assert the slave select signal output from
a general-purpose port
Read the SPInINTF.TBEIF bit
SPInINTF.TBEIF = 1 ?
YES
Write dummy data (or transmit data) to
the SPInTXD register
Wait for an interrupt request
(SPInINTF.RBFIF = 1)
Read receive data from
the SPInRXD register
Receive data remained?
NO
(
Negate the slave select signal output from
a general-purpose port
End
(A) Intermittent data reception

13.5.4 Terminating Data Transfer in Master Mode

A procedure to terminate data transfer in master mode is shown below.
1. Wait for an end-of-transmission interrupt (SPInINTF.TENDIF bit = 1).
2. Set the SPInCTL.MODEN bit to 0 to disable the SPIA Ch.n operations.
3. Stop the 16-bit timer to disable the clock supply to SPIA Ch.n.

13.5.5 Data Transfer in Slave Mode

A data sending/receiving procedure and operations in slave mode are shown below. Figures 13.5.5.1 and 13.5.5.2
show a timing chart and flowcharts, respectively.
Data sending procedure
1. Check to see if the SPInINTF.TBEIF bit is set to 1 (transmit buffer empty).
2. Write transmit data to the SPInTXD register.
3. Wait for a transmit buffer empty interrupt (SPInINTF.TBEIF bit = 1).
4. Repeat Steps 2 and 3 until the end of transmit data.
Note: Transmit data must be written to the SPInTXD register after the SPInINTF.TBEIF bit is set to 1 by
the time the sending SPInTXD register data written is completed. If no transmit data is written
during this period, the data bits input from the SDIn pin are shifted and output from the SDOn
pin without being modified.
13-8
)
(
Assert the slave select signal output from
Read the SPInINTF.TBEIF bit
NO
Write dummy data (or transmit data) to
Write dummy data (or transmit data) to
YES
)
(
Negate the slave select signal output from
(B) Continuous data reception
Figure 13.5.3.2 Data Reception Flowcharts in Master Mode
Seiko Epson Corporation
Data reception
a general-purpose port
SPInINTF.TBEIF = 1 ?
YES
the SPInTXD register
Wait for an interrupt request
(SPInINTF.TBEIF = 1)
the SPInTXD register
Wait for an interrupt request
(SPInINTF.RBFIF = 1)
Read receive data from
the SPInRXD register
Receive data remained?
NO
a general-purpose port
End
)
NO
Execute this sequence
within theSPICLKn
cycles equivalent to
"Data bit length - 1" from
an interrupt request
YES
)
S1C17M20/M21/M22/M23/M24/M25
TECHNICAL MANUAL (Rev. 1.0)

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c17m25S1c17m21S1c17m22S1c17m23S1c17m24

Table of Contents