SPI (Serial Peripheral Interface) is a method of data transmission. It’s designed to transmit data between microcontrollers and peripheral devices such as sensors, memory cards, and displays, among others.
At its basic physical level, it’s a 4-wire serial interface with data rates that can vary from a few MHz to upwards of 10 MHz, and claims of even higher rates in some cases. Data transmission is from 2 to 16 bits, depending on how it is programmed.
With regard to how SPI applies to dc motors, the motors themselves aren’t driven directly via SPI but rather by way of a motor driver. Typically, the motor driver will have an SPI port that can be connected to a microcontroller which sends control signals such as PWM signals. Or in some cases the controller may reside on the same chip where the control signals are generated. Aside from control, SPI can also be used for diagnostic purposes.
The pros from a microcontroller programming point of view are that most microcontroller families have built-in SPI communication, making it easy to connect with peripherals. Another plus is that programming via SPI is fairly simple. The protocol is fairly simple and support circuitry is not complex and is easy to implement.
On the down side, it is generally a short distance communication link. Some of the largest distances have pushed the 100 m mark. However, with longer runs more signal delay is introduced, which affects timing of signal propagation.
Still, there are many examples of controlling dc motors with simple controller chips using an SPI interface, including the Raspberry Pi, Arduino, as well as motor drives from Microchip.