Content deleted Content added
MicroPixel (talk | contribs) I forgot to mention avrdude for Atmel flash and EEPROM programming +short BIOS mention |
m Reverted edits by 80.147.224.36 (talk) to last version by Remsense |
||
(9 intermediate revisions by 8 users not shown) | |||
Line 1:
{{Short description|Synchronous serial communication interface}}
{{Cleanup rewrite|[[WP:NOTTEXTBOOK|it reads like a guide or textbook]]|article|date=March 2021}}
{{Infobox connector <!-- NOTE: Not a perfect template match, but good enough for now -->
Line 8 ⟶ 7:
| data_style = [[Full-duplex]] [[serial communication|serial]]
| daisy_chain = [[#Daisy chain configuration|Depends]] on devices
| manufacturer =
| data_devices = [[#Multidrop configuration|Multidrop]] limited by slave selects. [[#Daisy chain configuration|Daisy chaining]] unlimited.
| data_bit_width = 1 bit (bidirectional)
Line 24 ⟶ 23:
| maximum_current = Unspecified
| physical_connector = Unspecified
| design_date = Around early 1980s{{NoteTag|The earliest definitive mention of a "Serial Peripheral Interface" in bitsavers archives of Motorola manuals is from 1983 (see {{slink||Original definition}}). While some sources on the web allege that Motorola introduced SPI when 68000 was introduced in 1979, however many of those appear to be [[citogenesis]] or speculation, and Motorola's 1983 68000 manual has no mention of "Serial Peripheral Interface", so the alleged 1979 date
}}
'''Serial Peripheral Interface''' ('''SPI''') is a <!--DO NOT ITALICIZE; CONSIDERED ANGLICIZED-->[[de facto standard]] (with many [[#Variations|variants]]) for [[Comparison of synchronous and asynchronous signalling|synchronous]] [[serial communication]], used primarily in [[embedded systems]] for short-distance [[wired communication]] between [[integrated circuits]].
SPI follows a [[master–slave (technology)|master–slave architecture]],<ref name=":0">{{Cite web |last=Stoicescu |first=Alin |date=2018 |title=Getting Started with SPI |url=https://ww1.microchip.com/downloads/en/Appnotes/TB3215-Getting-Started-with-SPI-90003215A.pdf
[[Motorola]]'s original specification (from the early 1980s) uses four [[logic signal]]s, aka lines or wires, to support [[full duplex]] communication. It is sometimes called a ''four-wire'' [[serial bus]] to contrast with [[Serial Peripheral Interface#Three-wire|three-wire]] variants which are [[half duplex]], and with the ''two-wire'' [[I²C]] and [[1-Wire]] serial buses.
Line 62 ⟶ 61:
===Data transmission===
[[File:SPI 8-bit circular transfer.svg|upright=1.8|thumb|A typical hardware setup using two [[shift register]]s to form an inter-chip [[circular buffer]] ]]
To begin communication, the SPI master first selects a slave device by pulling its {{Overline|SS}} low. (
If a waiting period is required, such as for an analog-to-digital conversion, the master must wait for at least that period of time before issuing clock cycles.{{NoteTag|Some slaves require a falling edge of the {{Overline|Slave Select}} signal to initiate an action. An example is the Maxim MAX1242 ADC, which starts conversion on a high→low transition.}}
Line 74 ⟶ 73:
If a single slave device is used, its {{Overline|SS}} pin ''may'' be fixed to [[logic level|logic low]] if the slave permits it. With multiple slave devices, a [[#Multidrop configuration|multidrop configuration]] requires an independent {{Overline|SS}} signal from the master for each slave device, while a [[#Daisy chain configuration|daisy-chain configuration]] only requires one {{Overline|SS}} signal.
Every slave on the bus that has not been selected should disregard the input clock and MOSI signals. And to prevent [[Bus contention|contention]] on MISO, non-selected slaves must use [[Three-state logic|tristate]] output. Slaves that
===Clock polarity and phase===
Line 95 ⟶ 94:
*** Sampling occurs when SCLK transitions ''to'' its idle voltage level.
** Conversion between these two phases is non-trivial.
**
===Mode numbers ===
Line 130 ⟶ 129:
===Interrupts===
Interrupts are outside the scope of SPI; their usage is neither forbidden nor specified, and so may
==== From master to slave ====
Line 199 ⟶ 198:
** Uses only four pins on IC packages, and wires in board layouts or connectors, much fewer than [[Parallel communication|parallel interfaces]]
*** At most one unique signal per device ({{Overline|SS}}); all others are shared
****
** Typically lower power requirements than [[I²C]] or SMBus due to less circuitry (including pull up resistors)
** Single master means no [[bus arbitration]] (and associated failure modes) - unlike [[CAN-bus]]
Line 235 ⟶ 234:
* Control devices: [[audio codec]]s, [[digital potentiometers]], [[digital-to-analog converter|DACs]]
* Camera lenses: [[Canon EF lens mount]]
* Memory: [[flash memory#Serial flash|flash]] and [[EEPROM#Serial bus devices|EEPROMs]]
* [[Real-time clock|Real-time clocks]]
Line 265 ⟶ 263:
=== No slave select ===
Some devices
=== Connectors ===
|