8 Serial Interfaces 3 Flashcards

1
Q

History I2C?

A
  • Philips Semiconductor is now NXP, who used to hold a patent on the protocol, but this has now expired
  • Originally used by Philips inside television sets but is now a very common peripheral bus standard
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

I2C overview?

A
  • I2C is a two wire serial bus that was invented by Philips Semiconductor in the early 1980s
  • Intended for use in embedded systems
  • I 2C is a multi-master multi-slave interface designed for connecting integrated circuits together
  • The original specification was fixed to operate at 100 kHz, the most recent version supports clock rates of up to ~5 MHz
  • Inspired I2S (inter-integrated sound)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Main difference I2C?

A

there are strict conditions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Common I2C layout?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

I2C connections

A

• I²C uses only two bidirectional open-drain lines, Serial Data Line (SDA) and Serial Clock Line (SCL), pulled up with resistors (don’t forget these!)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

I2C typical voltages?

A

Typical voltages used are + 5 V or + 3.3 V although systems with other voltages are permitted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

I2C chip select lines?

A

There are no chip select lines, instead, I²C devices have a 7-bit or a 10-bit address, each device is required to have a unique address

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Data Transmission I2C?

A
  • Each device has an open drain output and so lines can be pulled low by any device, and are high when all devices release them. Multiple devices pulling the lines low do not cause internal short circuits
  • Data is clocked synchronously to SCL, with the clock being generated by the master device
  • It is possible to have multiple masters, but arbitration must be used to ensure correct communication. The arbitration is normally as simple and checking both SDA and SCL have been high for some time before transmitting
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How is the basic flow of communication controlled by the master?

A

Starts the communication

Signals the slave address, including a read/write bit

Looks for an acknowledgement

Reads/write data until done, then stops

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Diagram I2C communication?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to write I2C?

A
  1. All Devices: Allow SDA & SCL to float high
  2. Master: Pull SDA low to signal start
  3. Master: Drive clock on SCL, and 7 bit address followed by 0 (W) on SDA
  4. Slave: Pull SDA low to signify ACKnowledge
  5. Master: Clock out 8 data bits on SDA
  6. Slave: ACK
  7. All: Allow SDA to float high when SCL is high (stop)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to read I2C?

A
  1. Master: Address followed by 1 (R) on SDA
  2. Slave: Clock out 8 data bits on SDA
  3. Master: ACK
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is clock stretching?

A
  • Clock stretching is a tool used to temporarily slow down the data transfer if the slave device is not ready to receive/transmit more data
  • Commonly seen on very high speed data converters where sometimes data just isn’t ready for transmission yet
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Advantages of I2C?

A
  • Multi-master and multi-slave are supported
  • Individual chip addressing, up to 127 slave devices using only two wires!
  • Very low pin count compared to parallel or SPI
  • Fairly simple, although more complex than SPI
  • Uses ACK to confirm that the devices have correctly understood each other
  • Clear, fixed specification so generally easier to implement
  • Possible to perform verification against the specification
  • Supports hot swapping (you can connect new devices with the bus running)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Disadvantages of I2C?

A
  • Signals are bidirectional, more difficult to achieve Galvanic isolation
  • Each slave device must have a unique address, in practice this means you can’t have more than a handful of the same device
  • If two devices have the same address then bus conflicts can occur
  • Due to the open-drain design, the maximum clock frequency can be lower than SPI
  • Only handles short distances
  • Only one device can ever be driving the bus at once (so if you have lots of devices you have to talk to them one at a time)
  • Full compliance to the specification sometimes involves paying NXP a license fee
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Goals of USB?

A
  • Ease-of-use for PC peripheral expansion
  • Support fast data rates, up to 7.2 Gb/s for USB 3.1
  • Native support for voice, audio and video
  • Flexibility for isochronous and asynchronous messaging
  • Integration into commodity device technology
  • Enable a new class of devices that are “plug-and-play”
  • No limitations on what the devices might “be
17
Q

The requirements of USB?

A

USB requires a single master (host) device, but with multiple slave devices over multiple hubs

Upon “insertion” the slave devices are enumerated and specify data formats, communications speeds, power requirements and class conformance. Very flexible!

18
Q

Aims of USB?

A

USB is designed for connecting products together, as opposed to SPI and I2C that are designed to operate at the component level

19
Q

USB cost?

A
  • Sadly, if you want to sell a certified USB product (and get hold of the full documentation) then you have to pay a licence fee to the USB Implementers Forum (Microsoft et al)
  • Currently $5,000 USD setup plus $3,500 USD a year
20
Q

USB capabilities?

A
  • USB is a very complicated serial communication system, you often need to write your own device drivers for Windows/Linux (unless your device conforms to a standard such as mass storage)
  • USB devices can be powered from the bus, often up to a few Amps, this is how you can charge your iPhone from USB, or power the PIC programmer
21
Q

Main issue with USB?

A

• Partly because it is so powerful, USB is notoriously difficult to implement and debug, it is almost never used for small embedded systems

22
Q

How can you make usb devices easily?

A
  • You can buy USB-to-SPI type chips to speed things up for simple devices
  • Designing a fully custom USB device typically requires both a hardware and software development team and about a person year of work
  • Devices like the Arduino and the mbed are now providing some simple open source USB libraries that implement things like audio devices – this is very cool and means you can easily make your own USB sound card
  • The USB 3.1 specification, which covers only the low level basics, is over 600 pages long!
23
Q
A