Chapter 12

SPI Communication

Abstract

This chapter covers the popular Serial Peripheral Interface (SPI) for microcontroller communication. One master device controls bidirectional communication with one or more slave devices on the SPI bus, with a chip select line for each device to choose the device. This chapter explains how SPI works, describes the special function registers (SFRs) that control the SPI peripherals, and provides sample code for interfacing with a static RAM chip and an accelerometer/magnetometer at speeds of 10 Mbit/s.

Keywords

Serial Peripheral Interface (SPI)

SPI bus

Accelerometer

Magnetometer

The Serial Peripheral Interface (SPI) allows the PIC32 to communicate with other devices at high speeds. Numerous devices use ...

Get Embedded Computing and Mechatronics with the PIC32 Microcontroller now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.