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

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

11 SYNCHRONOUS SERIAL INTERFACE (SPI)
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
11.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 SPI Ch.n operations.
3. Stop the 16-bit timer to disable the clock supply to the SPI Ch.n.
11.5.5

Data Transfer in Slave Mode

A data sending/receiving procedure and operations in slave mode are shown below. Figures 11.5.5.1 and 11.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 un-
til the seventh SPICLKn clock is output. 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.
Data receiving procedure
1. Wait for a receive buffer full interrupt (SPInINTF.RBFIF bit = 1).
2. Read the received data from the SPInRXD register.
3. Repeat Steps 1 and 2 until the end of data reception.
11-8
)
(
Assert the slave select signal output from
NO
Write dummy data (or transmit data) to
Write dummy data (or transmit data) to
YES
)
(
Negate the slave select signal output from
Figure 11.
5.3.2 Data Reception Flowcharts in Master Mode
Seiko epson Corporation
Data reception
a general-purpose port
Read the SPInINTF.TBEIF bit
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
(B) Continuous data reception
)
NO
Execute this sequence
within seven SPICLKn
cycles from an interrupt
request
YES
)
S1C17F13 TeChniCal Manual
(Rev. 1.0)

Advertisement

Table of Contents
loading

Table of Contents