Selecting a Serial Bus

There is a good article about selecting the right microcontroller serial bus in this months Electronic Products magazine. Many people are like me, they use what they know. This article has a good explanation of the differences so that we can make a better informed decision for the next product.

“At the heart of most of today’s advanced electronic products is a microcontroller that communicates with one or more peripheral devices. At one time, microcontroller periphery was memory mapped and connected to the data and address bus.

Chip-select signals were decoded from address lines to give each component its unique location in the limited address range. The access time was short, but the overhead inflated the package size and overall cost. The obvious alternative is a serial interface, and there are some options in this area.

Key differences in available serial interfaces include data rate and operating voltage. One also needs to consider:

• How the peripheral device gets selected—by a hardware chip-select line (SPI, or Microwire) or by a software protocol (1-Wire, LIN, Sensorpath, CAN, USB, FireWire, I2C, or SMBus).

• How the peripheral device stays synchronized with the microcontroller—via a hardware clock line (I2C, SMBus, SPI, or Microwire) or via self-clocking using information embedded in the data stream (1-Wire, LIN, Sensorpath, CAN, USB, or FireWire).

• Transmission by a single unterminated line (1-Wire, LIN, Sensorpath, I²C/SMBus, or SPI/Microwire) or a two-line terminated differential connection (CAN, USB, or FireWire).

The application may add further requirements such as the maximum distance between microcontroller and peripheral device, the structure of the cabling, and immunity to noise or reversal of wires. This article focuses box level interconnect methods.

What makes for a good interface?
A serial bus system for peripheral functions should not add any significant burden on the system. In particular:

• The connection must be easy to route (the fewer signals the better).

• The protocol must be easy to implement in software (or natively supported by the chosen MCU/MPU).

• There needs to be an adequate selection of device functions.

• Expansion should be easy

I2C/SMBus
If the application can support a clock line, then the choice can include I2C and SMBus. The SMBus can be regarded as a variation of the original 100-kbit/s I2C bus specification with a timeout feature added. This timeout prevents the bus from becoming inoperable from a node that lost synchronization with the bus driver; an I²C system requires a power-on reset to recover from this situation.

Besides the clock line, I2C/SMBus uses an acknowledge bit for every byte sent. Transactions begin with a start condition followed by a device address and a data-direction bit and end with a stop condition.

SPI/Microwire
SPI and Microwire, a subset of SPI, require an additional chip-select line for each device. Due to the chip-select signal, the SPI protocol only defines commands such as read and write for memory addresses and the status register. It does not use an acknowledge function.

Typically, SPI devices have different pins for data input and data output. Since the data output is tri-stated (disabled) for anything except read functions, the two data pins may be tied together to form a single bidirectional data line. SPI is often chosen for special functions that only it furnishes and/or for its high data rate, which may be 2 Mbits/s or higher.

1-Wire, LIN, and Sensorpath
There are significant advantages to buses requiring only a single data wire such as 1-Wire, LINbus, and Sensorpath. Table 1 shows some further details.

In 1-Wire systems, the Reset/Presence detect cycle resets the communication interface to a defined starting condition.Also, transactions begin after requirements of the network layer are met (that is, selecting a particular device, search ROM, or broadcast); then data begins with a device-specific command code, which also affects the data direction.

The simple interface makes 1-Wire devices one of the best choices for functions such as identification and authentication of circuit boards/accessories, temperature sensors, and actuators. Further, 1-Wire devices with secure memory and challenge-and-response functionality provide two-way authentication and protect intellectual property.”

1 Comment


Comments are closed.