Spi (Serial Peripheral Interface Bus); General Introduction; Initializing And Configuring Spi - Bosch XDK110 Getting Started

Cross-domain development kit
Hide thumbs Also See for XDK110:
Table of Contents

Advertisement

Extension Bus Advanced Guide | XDK110

4. SPI (serial peripheral interface bus)

4.1 General Introduction

SPI is short for Serial Peripheral Interface and is a synchronous serial bus specification to transfer data between integrated
circuits. It uses four lines for the data transmission and integrates the roles of master and slave. With the selection through
a chip select line, multiple slave devices can be connected to one master. The data transmission is a full-duplex
synchronous communication between the master and multiple slaves.
The serial lines of SPI are named and have a certain functionality as follows:
Clock: Serial Clock controlled by the master device and provided to the slave device for synchronized data exchange. 

CS (Chip Select): Chip select is controlled by the master device and as active low line an indication that the master is
sending data to or requesting data from the corresponding slave device.

MOSI (Master Out Slave In): Data transmission from the master device to the slave device. The MOSI line on the
master device needs to be connected to the MOSI line on the slave device.

MISO (Master In Slave Out): Data transmission from the slave device to the master device. The MISO line on the
master device needs to be connected to the MISO line on the slave device.
Possible SPI data rates are between 600 and 230400 bps.
Additional configurable parameters for SPI are:
Baud rate: The Baud rate is a measure of the speed of data transfer at which data can be transferred and incoming data
is read. It is expressed in bits per second (bps).
SPI mode: The SPI mode allows manipulation over the clock polarity and the rising or falling edge to modify when
incoming or outgoing data is sampled. For a detailed information about which modes are available on the XDK, please
BSP_ExtensionPort.h
refer to the interface
SPI bit order: The SPI bit order parameter allows the configuration about the sampled byte order of outgoing or
incoming data stream is represented with the most significant bit or the least significant bit first.
4.2 Initializing and configuring SPI
This section describes the steps necessary to configure and initialize the SPI module to transmit and receive data. It also
covers the necessary configuration for the baud rate, the SPI mode and the bit order. For that, the following interfaces will
be used.
Code 15. Including the required SPI interfaces
#include
"BCDS_MCU_SPI.h"
#include
"BSP_ExtensionPort.h"
#include
"semphr.h"
BSP_ExtensionPort.h
The
configuration of the Baud rate, the SPI mode and the SPI bit order will be implemented. 

.
is mainly used to connect and configure the SPI interface on the Extension Bus. With it, the
15 24
|

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents