SPI and I2C Flashcards

(17 cards)

1
Q

What are I2C and SPI

A

I2C and SPI are fast, synchronous comunication protocol that though relatively complex enable multiple devices to be connected

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

compare UART to I2C and SPI

A

▪ UART is slow
▪ UART allows only a limited number of devices
▪ UART is simple
▪ UART is asynchronous

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

what architecture does the I2C work on

A

Operates on a controller-target architecture
Two lines are:
* Serial Data (SDA): Line for controller and target to send and receive data
* Serial Clock (SCL): Clock signal line

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

advantages of I2C

A

Advantages:
▪ Allows multiple controllers and target peripherals
▪ Clock stretching
▪ 7 to 10 bit addressing (127+ devices)
▪ Two wires
▪ Synchronous
▪ Low power consumption
▪ Faster than serial ports (9600 baud = 9.6 kpbs)
▪ Data transmission acknowledgement
▪ Arbitration
▪ Variable data rates
▪ Acknowledgement/error detection

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

Disadvantages of I2C

A

Disadvantages:
▪ Half duplex
▪ Data overhead (12+ bits sent for every 8 bits of data)
▪ Speed not as fast as SPI (5 Mbps with Ultra Fast Mode)

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

Start condition for I2C

A

Controller sets SCL high (1) and pulls SDA low (0), which informs all peripherals that transmission is to start

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

Address Frame for I2C

A

Controller indicates which target peripheral is being sent data. MSB of 7 bit address sent first (27 (128)
possible addresses)

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

what is the ACK/NACK bit

A

Every 9th bit, target peripheral given control. If SDA does not go low (0) before 9th clock pulse we can infer that
transmission failed

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

what are the stop conditions for I2C

A

Defined by Low to High transition on SDA AFTER a low to high transition on SCL, with SCL staying high
afterwards. SDA should not change between SCL rising and subsequently falling, risk of false stop

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

I2C writing

A

When the controller writes to the target peripherals the information sent by the controller is in blue in above diagram,
information sent by the peripheral is orange. R/W control bit is 0

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

I2C reading

A

When the controller reads from the target peripherals the information sent by the controller is in blue in above
diagram, information sent by the peripheral is orange. R/W control bit is 1

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

what is the SPI

A

SPI is a 4 wire, full duplex synchronous serial communication mode which
uses a controller-target architecture

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

what is the architecture of SPI

A

A controller-target architecture means the controller is the controlling
device, with other devices called targets taking instruction from the
controller, in theory, you can have infinite targets but in reality, this is
limited by loading issues

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

what does SPI stand for

A

Serial Peripheral Interface

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

what does the controller do in SPI

A
  • The Controller can initiate data transmission at any time by outputting
    clock signal (SCLK) to synchronise Target
  • Only the Controller can generate clock signal
  • The Target is synchronised on the falling or rising clock edge
    Controller reads bits as received
    The Controller can select clock polarity and
    phase
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Advantages of SPI

A

Advantages
▪ No start and stop bits – continuous stream of data, no overhead
▪ High data transmission rates (10 Mbps)
▪ Full duplex

17
Q

Disadvantages of SPI

A

Disadvantages
▪ Four wires
▪ No error checking
▪ No data transmission acknowledgement
▪ Single Controller