Design & Integration Files
- Bill of Materials
- Layout Files
- Gerber Files
- Assembly Drawing
Part Numbers with "Z" indicate RoHS Compliance. Boards checked are needed to evaluate this circuit.
- EVAL-CN0564-ARDZ ($75.00) SPI and I2C Bus Extender Arduino Shield
Features & Benefits
- Extends SPI/I2C Buses up to 1200m
- Ground potential isolated up to +/-25V
- Fault protection monitoring
Circuit Function & Benefits
The Serial Peripheral Interface (SPI) and Inter-Integrated Circuit (I2C) interface are popular de-facto communication standards for short-distance, intra-board connectivity between a controller and external peripherals. SPI and I2C have been widely adopted by sensor, actuator, and data converter manufacturers due to widely available hardware and software support. Implementation of these interfaces is straightforward when the controller and peripheral are on the same circuit board, share a common ground plane, and are not separated by long distances ( >1 meter).
However, applications such as condition-based monitoring, factory automation, building automation, and structural monitoring, require peripherals be located remotely, typically far from the controller. System designers have traditionally extended these interfaces using repeaters or drivers with a higher drive strength at the expense of increasing the overall cost and power consumption. The circuit shown in Figure 1 solves the problem of long distance, robust, SPI/I2C communication simply and easily without any sacrifices to circuit component count, operating speed, or software complexity. Error free operation in high noise, harsh industrial environments requires tolerance to large ground potential differences.
The SPI/ I2C extenders feature robust transceivers which operate over an extended common mode range of ± 25V (for SPI communication) and ± 15V (for I2C communication) for distances up to 1200m. Each link consists of a single device at either end of the cable, capable of being powered from 3V to 5.5V, while a separate logic supply allows the I2C or SPI interface to operate from 1.62V to 5.5V. The extenders also provide an internal control interface for fault monitoring, which is critically important when monitoring equipment over long distances.
I2C Signaling Standard Summary
I2C is a serial protocol for a bidirectional two-wire interface to connect low-speed devices like EEPROMs, A/D and D/A converters, I/O interfaces and other peripheral to an embedded processor. It is a very popular go-to for sensors because of its simplicity and expandability; multiple devices can exist on the bus, each with its own unique address. It requires just 2 wires to transfer data between devices. The 2 wires include:
- SCL - The serial clock signal line
- SDA - The serial data line for sending and receiving data between the controller and peripheral
The SCL and SDA signals are open-drain logic, with logic levels and timing specifications defined in the I2C -bus specification and user manual (Specification - I2C Bus)
The number of peripheral devices which can exist on a given I2C bus is limited by the address space and by the maximum total bus capacitance of 400 pF. The relatively high impedance and low noise immunity of open-drain logic requires that all peripherals have a low-impedance connection to a common ground return, and maximum bus length is restricted to approximately one meter at 100kHz. The CN0564 on the other hand, features differential transceivers that extend the length of the bus up to 1200 meters, and tolerate up to ± 15V common-mode difference between the controller and peripheral.
SDA is inherently bidirectional, with direction of data flow between controller and peripheral changing direction over the course of a transaction. While not very common, I2C supports clock stretching where a peripheral device may hold SCK low in order to slow down the clock rate. Thus, SCL is also bidirectional. The bidirectional nature of I2C makes it inconvenient to extend with buffers, isolate, or translate to other physical layers, requiring multiple logic levels and other nonstandard techniques.
Common I2C bus speeds are the 100 kHz standard mode and the 400 kHz fast mode. The LTC4331 controller interface supports all common I2C clock rates up to 2000 kHz. However, a controller fully supporting SCL clock-stretching is strongly recommended at high clock frequencies and long cable lengths. (Refer to the LTC4331 datasheet for more details).
SPI Signaling Standard Summary
The Serial Peripheral Interface (SPI) is a synchronous serial communication interface specification used for short-distance communication, primarily in embedded systems. Unlike I2C, SPI is not rigorously defined; a wide variety of clock frequencies, logic levels, and timing relationships are supported, requiring careful inspection of the controller and peripheral specifications. SPI is full-duplex communication (i.e. data can flow from the controller to peripheral and vice versa, simultaneously)
The SPI physical layer consists of 4 signals:
- SCLK - Serial clock, usually driven by the controller
- MISO - Controller data input, peripheral data output
- MOSI - Controller data output, peripheral data input
- CS - Chip select enables communication with a peripheral. One CS line is required per peripheral device.
SPI pins use push-pull logic (rather than Open Drain), and the logic level between a controller and peripheral must match. Each peripheral device requires its own CS signal, further complicating physical extension of the SPI bus.
Four different timing relationships between clock and data are supported, referred to as modes (0,1,2,3) that correspond to the four possible clocking configurations. Each transaction begins when the chip-select line is driven to logic low (chip select is typically an active-low signal). The exact relationship between the chip-select, data, and clock lines depends on how the clock polarity (CPOL) and clock phase (CPHA) are configured. The four modes are summarized in Figure 2.
LTC4332 supports up to 3 remote peripherals, each with their own CS line. Each peripheral’s SPI modes can be independently programmed to mode 0,1,2 or 3. Data is transparently transmitted from the controller to the peripheral, however a one word delay is introduced in the data from peripheral to controller. Refer to the One Word Latency – SPI Read Command section for more detail.
The CN0564 uses the LTC4331 and LTC4332 to extend I2C and SPI signals up to 1200m. Each link consists of a pair of devices, with the controller side configured in local mode (REMOTE pin tied low) and peripheral side device configured in remote mode (REMOTE pin tied high).
The LTC4332/LTC4331 encode the SPI/I2C signals from the controller into differential signals which are then transmitted through the twisted pair of cables. At the remote end of the cable, the differential signals are received by the remote LTC4332/LTC4331 and decoded back to SPI/I2C, which is then routed to the remote peripheral device. In normal operation, the remote peripheral device mirrors the events produced by the local controller.
Selectable Baud Rates
The LTC4332/LTC4331 can change its link baud rate which is the speed at which data propagates between the local and the remote link using a selectable Speed Index (shown in Table 1 & Table 2). This speed index is set by configuring the link and interface timing select pins, SPEED1 and SPEED2, which are both 3-State inputs.
Selectable baud rates over the cable allow balancing performance versus cable length depending on the application requirements. However, both sides of the link must be set to the same speed configuration.
|Speed Index||Effective I2C Link Rate (kHz)||Max Cable Length (m)|
|Speed Index||Max SCLK Frequency||Max Cable Length (m)|
Increased Cable Length Transmission
The LTC4332/LTC4331 utilize high speed differential transceivers to communicate over a link of up to 1200m in length. I2C/SPI signals are converted to differential signals for high speed, high quality signal transmission, noise immunity, as well as common mode rejection. For a given SPEED setting, cable length specifications given in Table 1 for LTC4331 and Table 2 for LTC4332 must be adhered to or the link will not operate. The values in the table were recorded using a Cat5E Ethernet cable in a lab environment. Note that the actual maximum cable length depends on type of cable and application environment.
Common Mode Voltage and ESD Robustness
The differential transceiver operates over an extended common mode range of ± 25V for SPI extenders and ± 15V for I2C extenders making it suitable for noisy environments or systems with ground potential differences (refer to Figure 1).
The interface pins (LTC4331 A & B pins, LTC4332 A,B,Y & Z pins) are fault protected to ±60V. The interface pins also feature exceptionally robust electrostatic discharge (ESD) protection to ±40kV HBM ESD (Human Body Model test) with respect to GND and VCC (with a 4.7μF capacitor to GND) without latch-up or damage, during all modes of operation, or while unpowered.
Both LTC4331/LTC4332 ESD also survive the International Electrotechnical Commission (IEC) ESD and EFT (Electrical Fast Transient) tests. The IEC ESD stress exceeds that of the HBM test in peak current, amplitude, and rise time, while the EFT test provides a prolonged repetitive stress. This level of protection ensures that the LTC4332/LTC4331 are robust under a wide range of real-world hazards.
One Word Latency — SPI Read Command
In the case of I2C communications, the LTC4331 (local) – LTC4331 (remote) link is transparent; the remote peripheral devices appear as local devices to a local controller.
However, in the case of the SPI extender solution, the LTC4332 (local) – LTC4332 (remote) incurs a one-word latency during read accesses only. Because the data sent from the SPI controller to the peripheral experiences the same delay as the controller-initiated interface clock (SCK), both will remain in sync across the entire data link.
In the opposite direction, the peripheral device sends MISO data to the controller only when the first clock edge reaches the peripheral device. This data will experience a second delay on its way back to the controller, so the MISO data will be out of sync by twice the cable’s propagation delay. Physically distant devices would need a dramatically reduced clock rate to accommodate the propagation delay within each bit width. To overcome this limitation, the LTC4332 introduces a shift register into the MISO signal path as shown in Figure 3.
As a result, SPI write requests to remote peripheral devices are software transparent, but SPI read requests to remote peripherals incur a one word latency, meaning the read command needs to be extended by one word. If not, the last word will be lost in the LTC4332 MISO shift register when the chip select is de-asserted. The WORD_LENGTH register (See the register map in the data sheet for LTC4332) indicative of the depth of the shift register in MISO signal path on LTC4332, dictates when a SPI controller will begin receiving valid data on the MISO line. For example, if the WORD_LENGTH is 8, the user would begin receiving valid MISO data 8 clock cycles after CS is asserted.
The LTC4331/ LTC4332 LINK pin indicates the state of the communication link, and is driven low to indicate that the remote I2C/SPI bus has joined the local I2C/SPI bus.
The LTC4331/ LTC4332 support interrupt signals, ALERT on pin on the LTC4331 and INT on the LTC4332. These signals are mirrored from the remote bus to the local bus. On the remote end, the interrupt pins are inputs that can be connected to the interrupt output of the connected I2C/SPI peripheral. On the local side, ALERT/INT operate as an open-drain output that can be connected to a shared local interrupt line. If enabled, the local LTC4331/LTC4332’s control interface uses the ALERT/INT pin to report link and fault events. The local side ALERT/INT output is the logical AND of the remote ALERT/INT and the internal endpoint interrupt signal.
The local side LTC4331/LTC4332 can also trigger a remote side reset by holding the ON pin low for a minimum of 180ms. If the link is disconnected, the remote LTC4331/LTC4332 is automatically reset after 180ms. A remote reset disables all remote side outputs until link communication is re-established.
LTC4331/LTC4332 Control Interface
To configure the control interface on the local side of the LTC4331/ LTC4332 link, a separate internal addressable peripheral is available. The internal interface on the local LTC4331 is assigned a unique I2C address by configuring the pins A1 and A2. The LTC4332 on the other hand, provides a separate chip select pin, SSC, that allows a user to communicate with the internal SPI addressable registers.
The LTC4331/LTC4332 control interface allows the speed configuration, link status, and interrupt / alert status to be read, as well as additional I2C/SPI specific options to be accessed. The LTC4331 can be configured to translate the I2C address to the remote peripheral, expanding the I2C address space and preventing address conflicts. The LTC4332 allows independent SPI mode configuration for each CS pin, as well as the word length (which determines the received data latency). Refer to the LTC4331 and LTC4332 datasheet for more information.
Increased component density in PCB designs leads to complex problems. To encode SPI or I2C, an additional microcontroller is normally required which increases both the solution cost and size, but by using the CN0564 there is no requirement for an additional microcontroller on the remote side. This allows for a smaller sensor solution that uses up less area on the PCB, reducing the overall cost of manufacturing and leaving more room for other components for additional features.
Expanding Sensor Interface Capabilities
Sensor interfaces for longer distance transmission have traditionally used analog signaling techniques, such as 0-10V or 4-20 mA. For example, in condition monitoring applications the integrated electronic piezoelectric (IEPE) sensor interface is the most common signaling standard used for vibration sensors. It supplies a constant current source to the vibration sensor, with the sensor output voltage read back on the same wire. This 2-wire system allows for simpler system design when transmitting AC signal content but provides no additional fault monitoring or configurability. The LTC4332/LTC4331, on the other hand, allow for flexible configuration, processing, and easy debugging during fault events directly on digital output sensors
Galvanic isolation is required in situations in which the potential difference between local and remote grounds exceeds the allowable ± 25V of the LTC4332 or ± 15V of the LTC4331. The I2C/SPI signals can be galvanically isolated from the local LTC4331/LTC4332 on EVAL-CN0564-ARDZ using digital isolators such as the ADUM141E or ADUM140E as shown in Figure 7. An ADUM5020 provides up to 100mA isolated power to the local LTC4331/LTC4332.
Circuit Evaluation & Test
The following section describes how the CN0564 was setup and tested. The EVAL-CN0564-ARDZ can be used with an Arduino or an Arduino compatible device to read acceleration data with EVAL-ADXL357Z for an easy evaluation of both its SPI (LTC4332) and I2C (LTC4331) extenders. The following section focuses on setting up the SPI extender (local and remote LTC4332) on the EVAL-CN0564-ARDZ.
For complete setup details, and for setup instructions on both the SPI and the I2C extender (local and remote LTC4331/LTC4332), please visit the EVAL-CN0564-ARDZ User Guide.
- PC with a USB port
- EVAL-CN0564-ARDZ Evaluation Board
- EVAL-ADXL357 Evaluation Board
- Arduino UNO Rev 3
- USB Type A to USB Type B cable
- Jumper wires
- 5V/3.3V Power supplies
- Download the Arduino sketch provided for evaluating either the SPI or the I2C extenders on the EVAL-CN0564-ARDZ Evaluation Board and program the Arduino using it.
- Plug in the EVAL-CN0564-ARDZ board into the Arduino Uno Rev 3
- Connect the LTC4332 (Remote side) on the EVAL-CN0564-ARDZ to the EVAL-ADXL357
- Connect the LTC4332 (Local side) to the LTC4332 (Remote side) using jumper wires in a twisted pair
- Make the jumper connections as follows:
- P10 jumper should be placed so the Pin 2 and 3 on P10 are connected on the EVAL-CN0564-ARDZ. This will select 5V power supply option.
- JP1 jumper should be placed in position D to connect the Slave /Chip Select pin on the local LTC4332 to the D10 pin on the Arduino Uno Rev 3.
- JP5 jumper should be placed in position A to connect the LINK pin on the local LTC4332 to the D6 on the Arduino Uno Rev 3.
- JP3 jumper should be placed in position B to connect the interrupt pin on the local LTC4332 to the D2 on the Arduino Uno Rev 3.
- By default, Speed index 8 is selected on the remote LTC4332. The Speed index on the local side should be the same as the remote side.
- P1 jumper should be placed in the position so its pin 2 and 3 are connected. Similarly, jumper P2 should also be placed in the position so its pin 2 and 3 are connected. This will select speed index 8 to match the speed index on the local side.
- P19 jumper should be placed so its pin 1 and 2 are connected. This connects the ON pin on the local LTC4332 to IOREF. This will enable the input.
Mount the EVAL-ADXL357Z and the remote LTC4332 on the EVALXLMOUNT1 and turn on the power supplies that power up the boards. You should now be able to see 3 LEDS flash on the EVAL-CN0564-ARDZ board (2 LEDS on the local, 1 on the remote side). See Figure 9 for the entire system block diagram. The X, Y and Z data read by the MEMS accelerometer (on the EVAL-ADXL357Z from the remote side) will be printed on the Arduino Serial Monitor. Exit the Arduino Serial Monitor and run the Python Real Time ADXL357 Data Plotter executable to see a real-time plot of the acceleration data like the graphs shown in Figure 10.
The X, Y and Z acceleration (g) data is stored in three separate files by the python script and can be found in the same location containing the executable file.
An FFT analysis,shown in Figure 11, can also be obtained to identify frequencies of interest using the data obtained for X , Y and Z. FFT analysis is often used to monitor the health of rotating parts. Predictive maintenance (PdM) is a key component of smart industry that involves monitoring equipment during operation to detect the early warning signs of potential failures. For more information on to how to analyze vibration data in Condition-Based Monitoring(CbM) systems, refer to this article.