Lecture – Communications

Ryan Robucci

Table of Contents

References

Wired Communications

Parallel or Serial

Novice user note: Parallel can be easier to debug by hand if system
can be paused and there are a few states to step through. But,
dealing with so many wires can be cumbersome and can increase
size and cost of system.

Parallel Example: Off-chip RAM

Wait States for Interfaces

Handshaking

Handshaking with Parallel Interface

Example:

ADC: ADS8412 https://www.ti.com/lit/ds/symlink/ads8412.pdf


https://www.ti.com/lit/ds/symlink/ads8412.pdf

https://www.ti.com/lit/ds/symlink/ads8412.pdf

Pseudocode:

  1. configure external interrupt for falling-edge response (denoted as INT\overline{\rm INT})
  2. set CS_n=low and RD_n=low
  3. initialize busy: BUSY = low
  4. start conversion: CONVST_n = low
  5. wait BUSY == high
  6. set CONVST_n==high
  7. if polling, wait BUSY==low, else wait for signal from falling-edge-triggered interrupt
  8. read MSB from data pins
  9. set BYTE=high
  10. read LSB from data pins
  11. set BYTE=low
  12. goto start conversion to repeat

Bit banging

Tristate Signals

Common Serial Interfaces

RS232 + UART

Data Packet Framing using Start and Stop bits

Interface

Bit Slippage and Clock Drift

UART Universal Asynchronous Receiver Transmitter Buffer

HARDWARE SERIALIZATION TXD Application HARDWARE WORD FIFO (1 byte on AVR) SOFTWARE BUFFER (FIFO) Application HARDWARE WORD FIFO HARDWARE DESERIALIZATION SOFTWARE BUFFER (FIFO)

SPI

I2C

Illustration with two-phase: address and one data packet

Contention

Cleverness in the monitoring of lines while they are intended to be controlled

See CAN section of notes for Contention and Arbitration Example

CAN

CAN Arbitration Example

Startbit ID bits The rest of the frame
10 9 8 7 6 5 4 3 2 1 0
Node 15 0 0 0 0 0 0 0 0\green 0 1 1 1 1
Node 16 0 0 0 0 0 0 0 1\red 1 Stopped Transmitting
CAN data 0 0 0 0 0 0 0 0\green 0 1 1 1 1

Table Source: https://en.wikipedia.org/wiki/CAN_bus Provided under Creative Commons Attribution-ShareAlike 3.0 Unported License https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License

USB

Logical

Physical Signals

Non-Return to Zero Inverted and Bit stuffing

Non-Return to Zero Inverted (NRZI) scheme - 0 encoded as transition and 1 encoded as non-transition
Bit stuffing - if six ones are encountered, a "dummy" zero is sent

USB Device detection


†James K. Peckol

Barrier to entry using USB

Review

Slide Changes

These notes were added Aug 2022:

## Common Serial Interfaces
* CAN
  * like I2C: multi-master, uses addresses
## CAN
,with multiple masters that may drive the bus