Epson S1C17F13 Technical Manual page 110

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

11 SYNCHRONOUS SERIAL INTERFACE (SPI)
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
The SPI 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 eight clocks and the transmit data bits are output in sequence from the SDOn pin in
sync with this clock.
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 eighth clock is output from the SPICLKn
pin, the clock output halts and the SPInINTF.TENDIF bit is set to 1. At the same time the SPI issues an end-of-
transmission interrupt request if the SPInINTE.TENDIE bit = 1.
SPICLKn
SDOn
SPInINTF.TBEIF
SPInINTF.TENDIF
Software operations
Figure 11.
(
Assert the slave select signal output from
(
Negate the slave select signal output from
11-6
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
Data (W) → SPInTXD
Data (W) → SPInTXD
5.2.1 Example of Data Sending Operations in Master Mode
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 11.
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)
)
1 2 3 4 5 6 7 8
S1C17F13 TeChniCal Manual
(Rev. 1.0)

Advertisement

Table of Contents
loading

Table of Contents