Ameba-D User Manual
User Manual All information provided in this document is subject to legal disclaimers. © REALTEK 2019. All rights reserved.
396
Data item size (4 to 16 bits) – Item size of each data transfer under the control of the programmer.
Configurable clock polarity and phase
Programmable delay on the sample time of the received serial data bit (rxd), when configured in Master Mode; enables
programmable control of routing delays resulting in higher serial data-bit rates.
19.2
Functional Description
This chapter describes the functional operation of the SPI.
The SPI is a configurable, synthesizable, and programmable component that is a full-duplex master or slave-synchronous serial interface. It can
be configured in one of two modes of operations: as a serial master or a serial slave. The SPI can connect to any serial-master or serial-slave
peripheral device using Motorola Serial Peripheral Interface (SPI).
19.2.1
Overview
In order to connect to a serial-master or serial-slave peripheral device for the SPI, the peripheral must have Motorola Serial Peripheral
Interface (SPI) – A four-wire, full-duplex serial protocol from Motorola.
The serial protocols supported by the SPI allow for serial slaves to be selected or addressed using either hardware or software. When
implemented in hardware, only one slave can be selected under the control of hardware select line. When implemented in software, users can
use GPIO to control more SPI salves. And there cannot be more than one slave be selected at any time. In this mode, it is assumed that the
serial master has only a single slave select output.
19.2.1.1
Motorola Serial Peripheral Interface (SPI)
There are four possible combinations for the serial clock phase and clock polarity. The clock phase (SCPH) determines whether the serial
transfer begins with the falling edge of the slave select signal or the first edge of the serial clock. The clock polarity (SCPOL) configuration
parameter determines whether the inactive state of the serial clock is high or low. To transmit data, both SPI peripherals must have identical
serial clock phase (SCPH) and clock polarity (SCPOL) values.
When the configuration parameter SCPH = 0, data transmission begins on the falling edge of the slave select signal. The first data bit is captured
by the master and slave peripherals on the first edge of the serial clock; therefore, valid data must be present on the txd and rxd lines prior to
the first serial clock edge. Fig 19-2 shows a timing diagram for a single SPI data transfer with SCPH = 0. The serial clock is shown for
configuration parameters SCPOL = 0 and SCPOL = 1.
The signals are illustrated in the timing diagrams in this section:
sclk_out – serial clock from SPI master (master configuration only)
sclk_in – serial clock from SPI slave (slave configuration only)
ss_0_n – slave select signal from SPI master (master configuration only)
ss_in_n – slave select input to the SPI slave
ss_oe_n – output enable for the SPI master/slave
txd – transmit data line for the SPI master/slave
rxd – receive data line for the SPI master/slave
Realtek confidential files
The document authorized to
SZ99iot
2019-05-15 10:08:03