banner
News center
Proven and reputable supplier of outstanding services

Discrete components address I2C bus conundrum

Aug 20, 2023

Torsten Siems, of Toshiba Electronics Europe, suggests using discrete optical isolators for cost-effective and flexible transfer in industrial applications.

I2C-bus applications sometimes require high voltage isolation to ensure safety and reliability. The inter-integrated circuit I2C bus was introduced in the 1980s to enable communication between a host CPU and peripheral devices for configuration, monitoring and control. Originally intended for short range, board level communication, its success has seen applications multiply and the maximum data-handling capability extend to include 100kHz standard mode, 1MHz fast mode plus and 5MHz ultra-fast mode plus.

The standard specifies a two-wire connection comprising bi-directional data and clock lines, which can be implemented cost-effectively.I2C's simplicity and efficiency have seen the underlying communication principles embodied in standards such as SMBbus and PMBus.

The I2C bus usually has one controller, such as an MCU or SoC, and one or more target devices. The controller has open-collector I/Os that can pull the serial data (SDA) and clock (SCL) lines low and needs a pull-up resistor, which allows multiple controllers and targets to co-exist without causing bus contention.

The controller uses the SDA line to select the target to be addressed and the register to access within that target. The target returns the requested data over the SDA line. Targets also use the SDA line to acknowledge correct reception of the request (ACK) by holding SDA low or deny correct reception (NACK) by letting SDA be pulled high.

The SCL line controls the speed of data communication over the bus. This signal is typically uni-directional, although a target can get more time to respond to a request, if needed, by holding both SCL and SDA low while generating an ACK. This is known as clock stretching.

As the popularity of I2C has grown, its uses have extended to situations that call for longer communication distances. In these situations, it is quite common for differences in the local ground potential between connected devices to affect the noise margins of the system. Moreover, critical device ratings such as the maximum negative I/O voltage may be exceeded.

I2C is also used to communicate between circuits that cannot have a shared ground reference, such as industrial automation and drives, motor controls, solar panel microinverters and medical systems that require safety isolation between the I2C control signals and AC mains power.

These situations require a convenient means of isolating I2C connections and there are integrated digital isolator ICs available that implement the entire isolation circuitry in a single device. Although easy to use, they can be expensive and leave the user without equivalents or a second source to protect against supply chain issues.

An isolated connection can be built using standard optocouplers, although there are some complications to consider. One is the bi-directional nature of the SDA and SCL lines because optocouplers are typically uni-directional. In addition, the chosen devices must have open-collector outputs to allow proper control of the bus.

They must also be able to satisfy the timing requirements of the I2C specification. One aspect is the ACK/NACK response of the target to the controller. The ACK/NACK signal must be valid after a setup time (tVD; ACK) of between 3.45µs in standard mode (100kHz) operation and 0.45µs in fast mode plus operation (1MHz). There are also timing constraints for data setup. A target must set up the SDA signal within 250ns after the falling edge of the previous clock bit in standard mode (according to Table 11 I2C Specification 1), and in 50ns for fast mode plus.

Figure 1 shows how two pairs of optocouplers can be inserted in the SDA and SDL lines to provide isolation and preserve bi-directional communication.

The SDA and SCL paths of the circuit operate in an identical manner. Concentrating on the SDA path, the resistor R1 pulls the SDA signal from the non-isolated side (NIS) up to the supply, while R8 pulls up SDA on the isolated side (IS). The resistance values depend on the supply voltage used, the capacitive loading seen by the controller or target, and the opto-isolator output characteristics. Chapter 7.1 of the I2C specification defines maximum and minimum values:

R_p(max) =t_r/(0.8473 × C_b )andR_(p(min))=(V_DD-V_(OL(max)))/I_OL

where tr is the maximum allowable rise time for the operating mode selected and Cb is the estimated bus capacitance. VOL and IOL are the opto-isolator's low-level output voltage and current.

The circuit is in its default state with SDA on both sides pulled high. When the NIS SDA signal is pulled low, current flows through R4 and the LED of optocoupler I2C. This passes the zero state to the IS SDA signal as it is pulled low by the output of I2C and the small-signal barrier diode D2. The reverse pole implementation of the LED in IC1 prevents zero state returning to the NIS side, thereby avoiding a permanent zero state. As the circuit is symmetrical, a zero state generated at SDA on the IS passes to the NIS in the same manner.

This approach requires 20 components, that is, four optocouplers, four diodes and associated passives. The diodes separate the sending signal from the returning signal in the bi-directional SDA and SCL paths. They should have low capacitance, such as Schottky barrier diodes (SBD), to ensure low noise and distortion, especially at the fastest signalling speeds. Small-signal types are sufficient. They should also have low forward voltage to ensure that the low signal level meets the I2C specification (VIL = 0.3VDD).

Knowing the maximum output low voltage VOL of an open collector opto-isolator dictates the SBD choice. For example, the TLP2362 optocoupler provides 3750Vrms isolation and has a maximum data transfer rate of 10Mbps with maximum output low voltage VOL of 0.6V (0.2V typical), an SBD with 0.3V VF ensures VIL is within specification even with VDD of 3.3V. Only a single ceramic 1µF bypass capacitor is required between each TLP2362 supply pin to stabilise the operation of the output logic.

I<sup>2</sup>C peripherals can vary greatly, so check that the devices used in conjunction with this circuit can deliver the current required by the opto-isolator's internal LED. In this example, the TLP2362 input threshold current IFHL is 5.0mA maximum (typical 1.0mA). For a lower current, another optocoupler operating at, for example, 3.3V, will have maximum IFHL of 2.4mA (typical 0.9mA).

Other devices can be considered to meet specific application requirements, for example to provide larger isolation voltage and creepage distance, a faster clock speed or higher logic levels for isolating LIN bus directly.

Figure 2 shows the waveform passing through the optocoupler. Its clean shape with an almost symmetric delay of around 60ns is well within the requirements for fast-mode (400kHz) I<sup>2</sup>C operation.

While greater integration is often preferred when implementing circuitry, such as isolation in I2C-bus connections, discrete opto-isolators can provide greater flexibility or lower cost and meet the I2C timing specifications with the necessary open-collector output configuration.

EW Staff