Serial buses information page

General information

This page concentrates on links to inter-IC serial buses. When this page talks about 2-wire or 3-wire interfaces, this wire number is the number of control lines. In addition to this those interfaces generally need a common ground, which is the ground plane in circuit board applications and a seprate wire in inter-circuit-board connections.

The serial bus interfaces are widely used for interfacing EEPROMs, data converters and many peripheral chips to microcontrollers. They are also often used for inter-microcontroller communication. Serial bus system are also used to build control buses inside equipments like TV receivers, AV amplifiers and cellular phones.

The major advantage of usign s serial bus is the small number of wires needed. A major disadvantage of serial interfacing is the tradeoff of speed for space. The processor???s I/O port spends a relatively large amount of time communicating with a serial device. Consequently, serial converters with throughput rates above 500 ksps are uncommon.


What Is the I2C Interface?

I2C is an acronym for Inter Integrated Circuit bus. I2C is a 2-wire serial interface standard defined by Philips Semiconductor in the early 1980's. It's purpose was to provide an easy way to connect a CPU to peripheral chips in a TV-set. The BUS physically consists of 2 active wires and a ground connection. The active wires, SDA and SCL, are both bidirectional. Where SDA is the Serial DAta line and SCL is the Serial CLock line.

The key advantage of this interface is that only two lines (clock and data) are required for full duplexed communication between multiple devices. The interface typically runs at a fairly low speed (100kHz to 400kHz). With I2C, each IC on the bus has a unique address. Chips can act as a receiver and/or transmitter depending on it's functionality.

The I??C-bus is devoloped by Philips to maximize hardware efficiency and circuit siplicity. The I2C interface is a simple master/slave type interface. Simplicity of the I??C system is primarily due to the bidirectional 2-wire design, a serial data line (SDA) and serial clock line (SCL), and to the protocol format. Bi-directional communication is facilitated through the use of wire and connection (the lines are either active-low or passive high). The I2C Bus protocol also allows collision detection, clock synchronization and hand-shaking for multi-master systems. The clock is always generated by the master, but the slave may hold it low to generate a wait state. In most systems the microcontroller is the master and the external peripheral devices are slaves.

The maximum number of devices connected to the I2C bus is dictated by the maximum allowable capacitance on the lines, 400 pF, and the protocol's addressing limit of 16k; typical device capacitance is 10 pF. The I2C protocol has 127 addresses available. The original vision was to assign addresses by device function, but when Philips began to sell microcontrollers for I2C, the address could be programmed, eliminating the need for a Philips-assigned address.

A device that controls signal transfers on the line in addition to controlling the clock frequency is the master and a device that is controlled by the master is the slave. The master can transmit or receive signals to or from a slave, respectively, or control signal transfers between two slaves, where one is the transmitter and the other is the receiver. I2C bus support more than one master connected to one bus.

The I2C bus is an innovative hardware interface which provides the software designer the flexibility to create a truly multi-master environment. It is possible to combine several masters, in addition to several slaves, onto an I??C-bus to form a multimaster system. If more than one master simultaneously tries to control the line, an arbitration procedure decides which master gets priority.

To begin communication, the bus master (typically a microcontroller) places the address of the device with which it intends to communicate (the slave) on the bus. All ICs monitor the bus to determine if the master device is sending their address. Only the device with the correct address communicates with the master.

Philips' has over 150 CMOS and bipolair chips who are I??C-bus compatible, and also some other companies make ICs with I2C control interface.

The I2C master is generally implemented with special I2C controller (sometimes integrated to microcontroller) or sometimes using a microcontroller and some software running on it. Both approaches are possible in typical one master I2C system. The multi-master system is not generally implemented with microcontroller software because it is extremely difficult to meet all the I2C Bus timing spec-ifications using software. For a true slave or multi-master system, some interface hardware is necessary (like START & STOP bit detection).

Data can be transferred at a rate of up to 100 kbps in Standard mode, up to 400 kbps in Fast mode, and up to 3.4 Mbps in High-Speed mode. Each slave on the bus is identified by a unique address. In Standard mode, 7-bit addressing is used. In other modes, slaves can have 7- or 10-bit addresses. The number of devices that can be connected to the same bus is limited by the maximum bus capacitance of 400 pF. Only the master generates the clock, but transmission speed can be adjusted to the internal operating rate of the addressed slave. This adjustment is made by clock stretching, in which the slave keeps the SCL pulled low until it is ready to continue.

Nowadays there are many different variations of I2C in use. Each of the various I2C derivatives defines a slightly different direct current (DC) electrical interface. I2C by definition is 5V. High and low thresholds, rather than being of fixed value, are a function of VCC for some parts. There are hacks to make I2C to work also on other voltages than 5V. In different application device addrressing can vary. A liberal fixed addressing scheme is quite common (different type of devices get for example four addresses each). ACCESS.bus uses dynamic addressing scheme.


The SPI-bus is a 4-wire serial communications interface used by many microprocessor peripheral chips. The Serial Peripheral Interface (SPI) circuit is a synchronous serial data link that is standard across many Motorola microprocessors and other peripheral chips. It provides support for a low/medium bandwidth (1 megabaud) network connection amongst CPUs and other devices supporting the SPI.

SPI bus is basically a relatively simple synchronous serial interface for connecting low speed external devices using quite minimal number of wires. SPI (serial peripheral interface) is an interface standard defined by Motorola on the MC68HCxx line of microcontrollers. A synchronous clock shifts serial data into and out of the microcontrollers in blocks of 8 bits. SPI - Serial Peripheral Interface. SPI is used frequently in handheld and other mobile platform systems.

SPI bus is a master/slave interface. Whenever two devices communicate, one is referred to as the "master" and the other as the "slave" device. The master drives the serial clock. When using SPI, data is simultaneously transmitted and received, making it a full-duplexed protocol.

Motorola's names for the signals are as follows: SCLK for serial clock, which is always driven by the master: MISO is master-in slave-out data: MOSI is master-out slave-in data. In a typical application, connect the microcontroller's SCLK to the converter's SCLK input, connect the MISO to the converter's DOUT pin, and connect the MOSI pin to the converter's DIN pin. Serial protocols such as SPI, a chip-select input is required to enable the IC. Using this chip-select signal it is possible to connect many ICs to same SPI bus in parallel. If there is a chip-select (CS) signal in use, it can be driven by a spare microcontroller general-purpose output. Every IC connected to bus needs it's own chip-select signal line. Thus, when 10 devices are on the bus, 10 chip-select lines, in addition to the shared clock and data lines, are needed to select the appropriate device.


MICROWIRE is a serial interface standard defined by National Semiconductor. The MICROWIRE protocol is essentially a subset of the SPI[tm] interface, namely CPOL = 0 and CPHA = 0. This protocol is also used for example by Microchip and Fairchild in their serial EEPROMs. In many applications Microwire devices can be interface to a microcontroller SPI interface with help of some software.

SPI (Serial Peripheral Interface) and MICROWIRE are serial interface standards developed by Motorola and National Semiconductor, respectively. Most synchronous serial converters can be easily interfaced to these ports; but in some cases additional "glue" logic may be necessary.

Maxim 3-wire

The Maxim 3-wire interface is found on the DS1620 and some other ICs from Maxim The data flow to and from the DS1620 is multiplexed on only one pin (DQ) while SPI needs two separate signals (MOSI, MISO).

Maxim/Dallas 1-Wire bus

1-Wire?? is a simple control network system developed by Dallas/Maxim. It allows one signal wire to carry both operating power and signal. 1-Wire?? devices aim to lower system cost and simplify design with an interface protocol that supplies control, signaling, and power over a single-wire connection. One wire is enough when ground is provided on some means. Usually the network is built using a wire pair where one wire caries the signal+power and the other wire is ground. The system is quite sensitive to the right timing to operate well.

A variety of identification, sensor, control, and memory functions are available with this interface. Those chips are available in traditional IC packages, ultra-small CSPs, and stainless-steel-clad iButtons??.

Interfacing techniques and questions on them

    Can I Connect a Serial A/D to My Computer's Serial Port?

    The answer to this question is yes, but there are simpler ways to interface to a computer. To begin with, the computer's RS-232 port uses higher voltage levels that are incompatible with most ADC's TTL/CMOS logic. Another problem is that the computer's RS-232 serial port is asynchronous, which places a few more requirements on the communication, including some additional handshaking control lines. Also, with the RS-232 serial port, you must set both ends of the link to the same baud rate. The A/D converter's serial port is synchronous; thus, its handshaking requirements are minimal and it only requires one wire for clock and one or two wires for data.

    If you are truly determined, you can bit-bang using the RS-232 port's handshake lines.

    What Is Bit-Banging?

    Bit-banging is a method of using general-purpose I/O lines to emulate a serial port. Microcontrollers that include serial-port modules like SPI[tm] and I2C[tm] manage all synchronization and timing signals, and this activity is transparent to the user. With bit-banging, however, each write to the port causes a single transition at the port pin. And it's up to the user, first, to provide the correct number of transitions to obtain the desired waveform and, second, to ensure that the timing requirements (particularly setup and hold times for reading and writing data) are met. Due to the overhead associated with the number of writes to the port, though the actual port speed might be quite high the actual bit-bang throughput rate is usually very slow. This technique is very inefficient from a software perspective, but it may be acceptable in some applications where the communication overhead is acceptable (for example for doing occasional controlling communication).

Related information

Related pages in

<[email protected]>

Back to ePanorama main page ??