19 SPI
19-4
EPSON
S1C17704 TECHNICAL MANUAL
19.4 Setting the Data Transfer Conditions
The SPI module can be set in master or slave mode and the SPI clock polarity and phase can be set using the
SPI_CTL register.
The data length is fixed at eight bits.
Note
: Make sure that the SPI module is disabled (SPEN/SPI_CTL register = 0) before selecting master/
slave mode and setting the clock conditions.
∗
SPEN
: SPI Enable Bit in the SPI Control (SPI_CTL) Register (D0/0x4326)
Selecting master/slave mode
Use MSSL (D1/SPI_CTL register) to select whether the SPI module is set in master mode or slave mode.
Setting MSSL to 1 selects master mode, and setting to 0 (default) selects slave mode. In master mode, the SPI
performs data transfer using the internal clock. In slave mode, the SPI performs data transfer using a clock
input from the master device.
∗
MSSL
: Master/Slave Mode Select Bit in the SPI Control (SPI_CTL) Register (D1/0x4326)
Setting the SPI clock polarity and phase
Use CPOL (D2/SPI_CTL register) to select the SPI clock polarity. The SPI clock is configured as active low
when CPOL is set to 1 or active high when CPOL is set to 0 (default).
∗
CPOL
: Clock Polarity Select Bit in the SPI Control (SPI_CTL) Register (D2/0x4326)
The SPI clock phase is selected with CPHA (D3/SPI_CTL register).
∗
CPHA
: Clock Phase Select Bit in the SPI Control (SPI_CTL) Register (D3/0x4326)
Setting these control bits determines the transfer timing as in the figure shown below.
SPICLK (CPOL = 1, CPHA = 1)
SPICLK (CPOL = 1, CPHA = 0)
SPICLK (CPOL = 0, CPHA = 1)
SPICLK (CPOL = 0, CPHA = 0)
SDI/SDO
Fetching receive data
into shift register
D7 (MSB)
D0 (LSB)
Figure 19.4.1 Clock and Data Transfer Timing
Содержание S1C17704
Страница 1: ...TECHNICAL MANUAL S1C17704 CMOS 16 BIT SINGLE CHIP MICROCOMPUTER ...
Страница 22: ...1 OVERVIEW 1 10 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 42: ...3 MEMORY MAP BUS CONTROL 3 12 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 82: ...6 INTERRUPT CONTROLLER ITC 6 26 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 108: ...8 CLOCK GENERATOR CLG 8 8 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 112: ...9 PRESCALER PSC 9 4 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 138: ...10 I O PORTS P 10 26 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 156: ...11 16 BIT TIMERS T16 11 18 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 208: ...14 8 BIT OSC1 TIMER T8OSC1 14 16 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 234: ...16 STOPWATCH TIMER SWT 16 14 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 242: ...17 WATCHDOG TIMER WDT 17 8 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 264: ...18 UART 18 22 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 300: ...20 I2C 20 20 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 320: ...21 REMOTE CONTROLLER REMC 21 20 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 360: ...24 ON CHIP DEBUGGER DBG 24 6 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 362: ...25 BASIC EXTERNAL WIRING DIAGRAM 25 2 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...