1) SPI

• Features: – One of the most popular serial interfaces – Serial, four-wire interface – Used for internal communication – Master-slave architecture – Two state TTL logic used! – Fully synchronous data transfer. Clock controlled by the master! – Full duplex transmission – Point – to – point transmission – Throughput up to tens of Mb/s

SPI in STM32F4

• Main features: – Full-duplex synchronous transfers on three lines – Simplex synchronous transfers on two lines with or without a bidirectional data line – 8- or 16-bit transfer frame format selection – Master or slave operation – Multimaster mode capability – Programmable clock polarity and phase – Programmable data order with MSB-first or LSB-first shifting – Hardware CRC feature for reliable communication – 1-byte transmission and reception buffer with DMA capability: Tx and Rx requests

• Half-duplex operation – The SPI is capable of operating in half-duplex mode in 2 configurations: • 1 clock and 1 bidirectional data wire • 1 clock and 1 data wire (receive-only or transmit-only)

• SPI communication using DMA: – SPI can be configured to operate at throughput exceeding 10Mb/s – To facilitate the transfers, the SPI features a DMA the capability of implementing a simple request/acknowledge protocol – In transmission, a DMA request is issued each time TXE is set to 1. The DMA then writes to the SPI_DR register. – In reception, a DMA request is issued each time RXNE is set to 1. The DMA then reads the SPI_DR register

2) UART

• Features: – One of the most popular serial interfaces – The serial, two-wire interface – Used for internal and external communication – Original versions (e.g. RS-232C) require many control lines (DB9, DB25) – Two state logic used, but not TTL! – Asynchronous data transfer. No clock transmitted! – Full duplex transmission – Point – to – point transmission – Throughput up to hundreds of kb/s

3) I2C

• Features: – Serial, two-wire interface – Used for internal communication – Master-slave architecture – Two state TTL logic used – Fully synchronous data transfer. Clock controlled by the master – Half-duplex transmission – Point – to – point transmission – Data rate 400kb/s (3.4Mb/s in HS mode)

I2C – special modes • In the first protocol specifications (1982) the max speed was set to 100 kb/s • Nex the Fast Mode was introduced with the maximum speed of 400 kb/s • In 2006 the Fast Mode Plus was defined with maximum speed of 1Mb/s • With additional logic the, so called, Highspeed Mode can be implemented with a maximum speed of 3.4 Mb/s