

The slave line for sending data to the master is MISO (Master In Slave Out), sometimes called SDI (Serial Data In). When the slave select pin is high, it ignores the master, which allows multiple devices to share the same data and clock lines. When a device's slave select pin goes low it tries to send data to the SPI master or receive data. However, in some cases-when multiple SPI buses are required for a single MCU or when debugging a new SPI interface- bit banging can be very useful. Software SPI is much slower than hardware SPI and can chew away valuable program memory and processor overhead. Bit banging involves manually specifying all aspects of the SPI communication with software and can be implemented on any pin, whereas hardware SPI must take place in the MCU's SPI pins. The other method is through software SPI or "bit banging". The Arduino comes with an SPI library for interfacing with the hardware SPI controller, so we will be using this library in our examples. The first and most common method is with the hardware SPI controller. There are two general ways to implement SPI communication on the Arduino or any MCU. For large package microcontrollers capable of 20 MHz clock speeds and higher with hundreds of GPIO, this is hardly a limitation. The primary limiting features of the SPI bus are bandwidth and the number of slave select pins available. In the case of the DAC714 this line is used to clear a double buffer, permitting up to three DAC714 ICs on a single five wire bus eliminating an additional slave select control line. Some devices such as the DAC714 use additional control lines. The clock and data lines are shared between all peripherals or slaves on the bus and a slave select pin to identify each connected peripheral.Īll SPI buses must contain a single master and a single or multiple slave nodes. SPI is most commonly implemented as a four wire bus with lines for clock, data in, data out and peripheral selection. SPI can even be used to communicate from one MCU to another or to communicate to physical interfaces for Ethernet, USB, USART, CAN, and WiFi modules. SPI can be used to interface any peripheral imaginable such as sensors, touchscreens, and IMU's. Serial Peripheral Interface, more commonly known as SPI, was created by Motorola to send data between microcontrollers and peripheral devices using fewer pins than a parallel bus.

Introduction to the Arduino SPI Library with example sketch for the LTC1286 12 Bit ADC and the DAC714 16 bit DAC.
