Communication Protocols: Case Study
Communication Protocols: Case Study
Communication Protocols: Case Study
Study
• 9 axis IMU (Inertial Measurement Unit)
• Accelerometer
%
Measure
Capacitance via
!" → Δ% Impedance
Divider
!"
!. [6 − 1]
• What to do?
Serial Communications
Common Chip-Chip Communication Protocols • Sending information one bit at a time vs. many bits in parallel
• Serial: good for long distance (save on cable, pin and connector cost,
easy synchronization). Requires “serializer” at sender, “deserializer” at
• Parallel (not so much anymore). receiver
• Parallel: issues with clock skew, crosstalk, interconnect density, pin
count. Used to dominate for short-distances (eg, between chips).
• Serial (UART) (still common in some communication and GPS devices) • BUT modern preference is for parallel, but independent serial links (eg,
PCI-Express x1,x2,x4,x8,x16) as a hedge against link failures.
• A zillion standards
• SPI (Serial Peripheral Interface) very common • Asynchronous (no explicit clock) vs. Synchronous (CLK line in addition
to DATA line).
• Recent trend to reduce signaling voltages: save power, reduce
• I2C (Inter-Integrated Circuit Communication) very common transition times
• Control/low-bandwidth Interfaces: SPI, I2C, 1-Wire, PS/2, AC97
• Networking: RS232, Ethernet, T1, Sonet
• Computer Peripherals: USB, FireWire, Fiber Channel, Infiniband, SATA,
• I2S (Inter-Integrated Circuit Sound Bus) common Serial Attached SCSI
MOSI
CE/CS
• Stands for Universal Asynchronous Receiver Transmitter • Stands for Serial-Peripheral Interface
• Requires agreement ahead-of-time between devices regarding things • Four Wires:
like clock rate (BAUD), etc… • MOSI: Master-Out-Slave-In
• Two wire communication • MISO: Master-In-Slave-Out
• Cannot really share • SCK: Serial Clock
• (every pair of devices needs own pair of lines) TX/RX • CE/CS (Chip Enable or Chip Select)
Device 2
• Data rate really < 115.2Kbps Device 1 • SCK removes need to agree ahead of time on data rate (from UART)
RX/TX
• High Data Rates: (1MHz up to ~70 MHz clock (bits))
SPI Master
Device
MISO
SCK
Slave
Device 1 SPI Example
“Give me a
CE0/CS0 single-ended
reading…” “From your “0001011011” ”We’re done
• Can share MOSI/MISO Bus “Hey MCP3008” channel 1” here. ”
• Addition of multiple slaves requires
additional select wires CS
Slave
• Hardware/firmware for SPI is pretty easy to Device 2
MOSI
implement: X X 1 1 0 0 1 X X X X X X X X X X X X X
CE1/CS1
• Wires are uni-directional
• Classic “duh” sort of approach to digital
MISO …
X X X X X X X X 0 0 0 0 1 0 1 1 0 1 1
communication, but very robust.
SCK
MOSI
• I’m saying, give me your measurement 11001000001011011
MOSI
X X 1 1 0 0 1 X X X X X X X X X X X X X on Channel 1, and it is responding
Here I am talking to a MCP3008 10 bit ADC
with 10’b0001011011 mapped to 3.3V
MISO … or 0.293 V MISO
X X X X X X X X 0 0 0 0 1 0 1 1 0 1 1
SCK
Wires
Device Device
SCK
CE0/CS0
• Six Wires: D/C • Devices come with their own
• MOSI: Master-Out-Slave-In RES ID numbers (originally a 7 bit Master SDA
Device Slave
• MISO: Master-In-Slave-Out value but more modern ones Device 1
• SCK: Clock have 10 bits)…allows SCL
• CE/CS (Chip Enable or Chip Select) potentially up to 2^7 devices or
• RES: Reset Device 2^10 on a bus (theoretically
• D/C: Data/Command (often seen in devices where you need
anyways)
to write tons of data (i.e. a display) Slave
• Three/Two Wires: • ID’s are specified at build, Device 2
• If a device has nothing to say, drop MISO: usually several to choose from
and you select them by pulling
• If you assume only one device on bus drop CE/CS
external pins HI or LOW
6.111 Fall 2017 25 6.111 Fall 2017 27
SCL
3.3V
i2C Master 7x
ACKNACK1C
NACK
SCL READ1
READWRITE2 ACKNACK2C ACKNACK2A
VCC GND
SCL
GND
SCL SDA
Nexys4 “I’m here. Sounds good” “OK” “Hey, 0x68…” MPU9250
SDA “Hey, 0x68…” “For sure”
”More, please”
“Different thought” “Read to me
MPU9250 “Look at your
“I wanna tell from where
Nexys4 0x6B register” “0x6D”
“I claim this bus” you something” you’re looking”
1 0 1 1 0 1 0 0 0 0 0 0 0 1 1 1 0 1 1 0 1 0 0 1 1 0 1 0 0 0 1 0 0 1 1 0 1 1 1 0 0 1 0 1 1 0 1 0 0 0 0 0 0 0 1 1 1 0 1 1 0 1 0 0 1 1 0 1 0 0 0 1 0 0 1 1 0 1 1 1 0 0
SDA
SDA
01010101010101010101010101010101010101110101010101010101010101010101010101010 … 01010101010101010101010101010101010101110101010101010101010101010101010101010 …
SCL
SCL
6.111 Fall 2017 41 Nexys4 (Master Device) Dialog 6.111 Fall 2017
MPU9250 (Slave Device) Dialog
43
GND
SDA = Yellow
SCL
SDA
Nexys4 Acknowledge=0 ReStart MPU9250
Write=0 Read=1 Acknowledge=0
Device Address (0x68) Device Address (0x68) Data Read In
Start Device Register (0x3B)
1 0 1 1 0 1 0 0 0 0 0 0 0 1 1 1 0 1 1 0 1 0 0 1 1 0 1 0 0 0 1 0 0 1 1 0 1 1 1 0 0 SCL = Purple
SDA
SCL
01010101010101010101010101010101010101110101010101010101010101010101010101010 …
6.111 Fall 2017 42 6.111 Fall 2017 44
Triggered on leaving IDLE state
Running and reading X acceleration: Master Slave
I2s (Inter-IC Sound Bus) SDA
WS
SCL:
SATA 1: 1.5Gb/s
SATA 2: 3Gb/s • Current USB 3.2 (9/22/2017 release!...so new! so fresh!)
SATA 3: 6Gb/s • spec is 103 MB zip file*
• Approximately 8,000 pages long at this point
• I’ll summarize in a few slides
*and hosted on web page that has painfully slow DL speeds and looks like it is from 2000
6.111 Fall 2017 57 6.111 Fall 2017 59
USB: Universal Serial Bus How is Data Transmitted in USB (High Level):
• USB 1.0 (12 Mbit/s) introduced in 1996
• USB 2.0 (480 Mbit/s) in 2000 • Communication uses handshakes to establish capable/expected data
• USB 3.0 (5 Gbit/s) in 2012 rates
• USB-C 2016.
• Host device (computer for example), assigns connected devices
• USB 3.2 (30 Gbit/s) in July 20, 2017
• Created by Compaq, Digital, IBM, Intel, Northern Telecom and Microsoft. Credit: Reddit
temporary IDs on shared bus.
• Uses differential bi-direction serial communications • Packets of information, including headers, payloads, and error checks
(CRC5, CRC16, and CRC32 are used) are sent between host and client
devices
Type A USB 2.0 – 4 pins
The Great FTDI Bricking of 2014 RFID: Radio Frequency Identification Like in MIT IDs:
Receiver
Powered by 125khz broadcast
125khz transmitter signal