• SPI 2013.09.02
  • I2C 2013.09.02

SPI (Serial Peripheral Interface Bus)

o Summary 

모토로라의 de facto standard에서 만든 전이중 Full-Duplex 동기식 직렬 연결이다. Master-Slave 방식이며, SS(Slave Select)를 이용하여 개별 Slave와 연결됨.

o Operation 

- The SPI bus specifies four logic signals:

. SCLK: serial clock (output from master);

. MOSI: master output, slave input (output from master);

. MISO: master input, slave output (output from slave);

. SS: slave select (active low, output from master).

- Alternative naming conventions are also widely used:

. SCLK: SCK, CLK: serial clock (output from master)

. MOSI: SIMO, SDO, DO, DOUT, SO, MTSR: serial data out; data out, serial out, master transmit slave receive

. MISO: SOMI, SDI, DI, DIN, SI, MRST: serial data in; data in, serial in, master receive slave transmit

. SS: nCS, CS, CSB, CSN, nSS, STE: chip select, slave transmit enable (active low, output from master)

The SDI/SDO (DI/DO, SI/SO) convention requires that SDO on the master be connected to SDI on the slave, and vice versa. Chip select polarity is rarely active high, although some notations (such as SS or CS instead of nSS or nCS) suggest otherwise.

o 장단점
- 장점
. Full duplex communication
. Higher throughput than I²C or SMBus
Complete protocol flexibility for the bits transferred
Not limited to 8-bit words
Arbitrary choice of message size, content, and purpose
Extremely simple hardware interfacing
Typically lower power requirements than I²C or SMBus due to less circuitry (including pull up resistors)
No arbitration or associated failure modes
Slaves use the master's clock, and don't need precision oscillators
Slaves don't need a unique address ? unlike I²C or GPIB or SCSI
Transceivers are not needed
. Uses only four pins on IC packages, and wires in board layouts or connectors, much fewer than parallel interfaces
. At most one unique bus signal per device (chip select); all others are shared
. Signals are unidirectional allowing for easy Galvanic isolation
. Not limited to any maximum clock speed, enabling potentially high throughput

- 단점
. Requires more pins on IC packages than I²C, even in the three-wire variant
. No in-band addressing; out-of-band chip select signals are required on shared buses
. No hardware flow control by the slave (but the master can delay the next clock edge to slow the transfer rate)
. No hardware slave acknowledgment (the master could be transmitting to nowhere and not knowing it)
Supports only one master device
. No error-checking protocol is defined
. Generally prone to noise spikes causing faulty communication
. Without a formal standard, validating conformance is not possible
. Only handles short distances compared to RS-232, RS-485, or CAN-bus
. Many existing variations, making it difficult to find development tools like host adapters that support those variations
. SPI does not support hot plugging (dynamically adding nodes).

o Revision 

Master는 SS(Slave Select)를 통해 Slave를 정함 
-> Master는 MOSI(Master Output Slave Input)으로 SCLK를 전송
-> Slave는 SS를 통해 수신모드로 들어가 MOSI를 통해 전달되는 신호를 SCLK에 맞춰 수신 
-> 신호는 8 or 16-bits or 그 이상의 비트로 조합하여 전송

o Reference 

- Kor Wiki : http://ko.wikipedia.org/wiki/%EC%A7%81%EB%A0%AC_%EC%A3%BC%EB%B3%80%EA%B8%B0%EA%B8%B0_%EC%9D%B8%ED%84%B0%ED%8E%98%EC%9D%B4%EC%8A%A4_%EB%B2%84%EC%8A%A4

- Eng Wiki : http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus

http://blog.daum.net/trts1004/12108902



 I2C (Inter-Integrated Circuit)

o Summary

: 필립스에서 개발한 직렬 컴퓨터 버스이며 마더보드, 임베디드 시스템, 휴대전화등에 저속의 주변 기기를 연결하기 위해 사용 (1982년대 초반)

- Serial Data Line (SDA) , Serial Clock (SCL) (pull-up / Open-drain)

- Master-Slave 구조, Multi-Slave 지원  

- Max is 5V / 7 bits Address (16 ea is reserved) 

- Speed : 10kbps (low-spped) -> 100kbps (Common) -> 400kbps (fast mode) -> 1 Mbps (fm+, fast mode plus) -> 3.4Mbps(high-speed)

- High-Speed (3.4Mbps) is 16 bits Address


o Operation

- Master에서 SCL을 제어, Slave는 Master의 요구에 따른 데이터 송부. 그리고 최종 Ack or NACK을 받는다. (이것에 따라 I2C Error or I2C Timeout 발생)
- 일반적으로 Embedded에서는 400kbps 사용. 초당 50kBytes의 최대 데이터 전송 가능. 
- Single Message <-> Mass Data 가능.
- 프로토콜은 I2C Controller에서 제어가능.

o Revision

- In 1982, the original 100-kHz I²C system was created as a simple internal bus system for building control electronics with various Philips chips.

- In 1992, Version 1.0 (the first standardized version) added 400-kHz Fast-mode (Fm) and a 10-bit addressing mode to increase capacity to 1008 nodes.

- In 1998, Version 2.0 added 3.4-MHz High-speed mode (Hs) with power-saving requirements for electric voltage and current.

- In 2000, Version 2.1[2] introduced a minor cleanup of version 2.0.

- In 2007, Version 3.0[3] added 1-MHz Fast-mode plus (Fm+), and a device ID mechanism.

- In 2012, Version 4.0[4] added 5-MHz Ultra Fast-mode (UFm) for new USDA and USCL lines using push-pull logic without pull-up resistors, and added assigned manufacturer ID table. This is the most recent standard.


o Reference

- Eng Wiki : http://en.wikipedia.org/wiki/I%C2%B2C

- Kor Wiki : http://ko.wikipedia.org/wiki/I2c

- 예제는 이 문서를 참고 : http://www.robot-electronics.co.uk/acatalog/I2C_Tutorial.html

 

+ Recent posts