I2C Extend Click Board
I2C Extend Click Board
Overview
The I2C Extend Click Board™ is a compact add-on board for applications that require extending the I2C communication bus over a long distance. This board features the LTC4331 - an I2C slave device extender over a rugged differential link, from Analog Devices. It is a point-to-point SMBus compatible I2C slave device extender, designed for operation in high noise industrial environments while supporting Up to 1MHz serial clock, ±40kV ESD protection on link pins, selectable link baud rates and many more. All these features make I2C Extend Click an excellent choice for various applications that require extending the I2C bus over a long distance, such as sensor installation, industrial control, lighting system control, sound system control, and more.
The I2C Extend Click Board™ is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click Board™ comes as a fully tested product, ready to be used on a system equipped with the mikroBUS™ socket.
How Does The I2C Extend Click Board™ Work?
The I2C Extend Click Board™ is based on the LTC4331, which is a point-to-point compatible I2C slave device extender designed for operation in high noise industrial environments. Using a ±60V fault protected differential transceiver, the LTC4331 can extend an I2C/SMBus bus, including remote interrupt function and a control signal, over a single twisted pair differential link. Thanks to selectable link baud rates, the I2C bus can be extended up to 1200m, depending on the link speed and external factors such as environmental noise level, humidity, cable quality, etc. Standard twisted-pair cables with RJ45 connectors can be used, the same as in the ethernet devices, etc.
Besides the I2C protocol extension, I2C Extend Click Board™ also supports local to remote control and interrupt functions. Local to remote control ensures that the values set on the local side CTRL pin propagate to the remote side CTRL pin over the differential link. Users can choose pin on the mikroBUS™ socket used for that purpose (CS or RST), using the onboard jumper named PIN SEL. Interrupt pin acts as an open-drain output in local mode and an input in remote mode. Basically, an interrupt signal on the INT pin in the I2C Extend Click is mirrored from the remote network to the local network using the differential link. On the remote side INT is an input pin that can be connected to remote I2C slave devices, while on the local side, it is operating as an open-drain output that can be connected to a shared local interrupt line.
Because of the dual functionality of the I2C Extend Click, the user needs to set the mode of operation of the Click board™. That is easily achieved using the onboard MODE switch, with two positions: local mode (LCL), where this Click board™ is in I2C slave mode and remote mode (RMT) where this Click board™ is in I2C master mode. Besides mode selection, I2C Extend Click can also link speed and I2C address selection jumpers onboard, named "SPEED SEL" and "ADDR SEL", respectively.
The I2C Extend Click Board™ has Link status (LINK) and ready status (RDY) LEDs, making troubleshooting as easy as possible. In remote mode, LINK LED is active when the device establishes link communication. When in local mode, LINK LED is active after the LTC4331's I2C interface has joined the I2C bus in addition to establishing link communication.The RDY LED is active after the device's I2C interface has joined the bus.
The I2C Extend Click Board™ is designed to operate with both 3.3V and 5V logic levels that can be selected via VCC SEL jumper. This allows for both 3.3V and 5V capable MCUs to use the I2C communication lines properly.
SPECIFICATIONS
Type | Interface |
Applications | Excellent choice for various applications that require extending the I2C bus over a long distance, such as sensor installation, industrial control, lighting system control, sound system control, and more. |
On-board modules | LTC4331 - an I2C slave device extender over rugged differential link, from Analog Devices |
Key Features | Designed for operation in high noise industrial environments while supporting Up to 1MHz serial clock, ±40kV ESD protection on link pins, selectable link baud rates and many more |
Interface | GPIO,I2C |
Compatibility | mikroBUS |
Click board size | L (57.15 x 25.4 mm) |
Input Voltage | 3.3V or 5V |
PINOUT DIAGRAM
This table shows how the pinout of the I2C Extend Click Board™ corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes | Pin | Pin | Notes | ||||
---|---|---|---|---|---|---|---|
NC | 1 | AN | PWM | 16 | NC | ||
Reset pin | RST | 2 | RST | INT | 15 | INT | Interrupt pin |
SPI Chip Select | CS | 3 | CS | RX | 14 | NC | |
NC | 4 | SCK | TX | 13 | NC | ||
NC | 5 | MISO | SCL | 12 | SCL | I2C Clock | |
NC | 6 | MOSI | SDA | 11 | SDA | I2C Data | |
Power Supply | 3.3V | 7 | 3.3V | 5V | 10 | 5V | Power Supply |
Ground | GND | 8 | GND | GND | 9 | GND | Ground |
ONBOARD SETTINGS AND INDICATORS
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | - | Power LED Indicator |
LD2 | RDY | - | Ready status LED Indicator |
LD3 | LINK | - | Link status LED Indicator |
JP1 | VCC SEL | Left | Power Supply Voltage Selection: left position 3v3, right position 5v |
JP2, JP3 | ADDR SEL | Left | Communication interface selection: left position 0, right position 1 |
JP6, JP7 | SPEED SEL | Left | Communication speed selection: left position 0, right position 1 |
SW1 | PIN SEL | - | Local to remote control pin selection |
I2C EXTEND CLICK ELECTRICAL SPECIFICATIONS
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3 | 3.3 | 5.5 | V |
Extension Range | - | - | 1200 | m |
Serial Clock Frequency | - | - | 1 | MHz |
Software Support
We provide a library for the I2C Extend Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library covers all the necessary functions to control the I2C Extend Click Board™. A library performs the communication with the LTC4331 I2C Slave Device Extender Over Rugged Differential Link via I2C interface.
Key Functions
void i2cextend_generic_write ( uint8_t reg, uint8_t tx_data )
- Generic write data function.uint8_t i2cextend_generic_read ( uint8_t reg )
- Generic read data function.uint8_t i2cextend_rmt_read ( uint8_t rmt_slave_addr, uint8_t reg )
- Generic read data in Remote Mode function.
Example Description
The application is composed of three sections :
- System Initialization - Initializes I2C, sets INT pin as input and RST and CS pin as outputs and begins to write log.
- Application Initialization - Initialization driver enables - I2C, check communication with device 6DOF IMU 11 Click connected to the I2C Extend Click ( Remote Mode ), set default configuration and start measurement.
- Application Task - (code snippet) This is an example which demonstrates the use of the I2C Extend Click Board™. In this example, we read Accel and Mag axis of the connected 6DOF IMU 11 Click boards to the I2C Extend Click ( Remote Mode ) which is connected by a LAN cable to the I2C Extend Click Board™ ( Local Mode ) placed in the mikroBUS 1. Results are being sent to the USART Terminal where you can track their changes. All data logs write on USB UART changes for every 2 sec.
void application_task ( ) { mikrobus_logWrite( " Accel | Mag ", _LOG_LINE ); mikrobus_logWrite( "------------------------", _LOG_LINE ); i2cextend_6dofimu11_get_axis( C6DOFIMU11_REG_ACCEL_XOUT_L ); mikrobus_logWrite( " X :", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_TEXT ); mikrobus_logWrite( " | ", _LOG_TEXT ); i2cextend_6dofimu11_get_axis( C6DOFIMU11_REG_MAG_XOUT_L ); mikrobus_logWrite( " X :", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); i2cextend_6dofimu11_get_axis( C6DOFIMU11_REG_ACCEL_YOUT_L ); mikrobus_logWrite( " Y :", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_TEXT ); mikrobus_logWrite( " | ", _LOG_TEXT ); i2cextend_6dofimu11_get_axis( C6DOFIMU11_REG_MAG_YOUT_L ); mikrobus_logWrite( " Y :", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); i2cextend_6dofimu11_get_axis( C6DOFIMU11_REG_ACCEL_ZOUT_L ); mikrobus_logWrite( " Z :", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_TEXT ); mikrobus_logWrite( " | ", _LOG_TEXT ); i2cextend_6dofimu11_get_axis( C6DOFIMU11_REG_MAG_ZOUT_L ); mikrobus_logWrite( " Z :", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); mikrobus_logWrite( "------------------------", _LOG_LINE ); Delay_ms( 1000 ); }
Additional Functions :
- void i2cextend_6dofimu11_get_axis ( uint8_t axis_out_reg )
- Read axis.
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C
- UART
- Conversions
Additional Notes and Information
Depending on the development board you are using, you may need USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
MIKROSDK
The I2C Extend Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
Software Support
We provide a library for the I2C Extend Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library covers all the necessary functions to control the I2C Extend Click Board™. A library performs the communication with the LTC4331 I2C Slave Device Extender Over Rugged Differential Link via I2C interface.
Key Functions
void i2cextend_generic_write ( uint8_t reg, uint8_t tx_data )
- Generic write data function.uint8_t i2cextend_generic_read ( uint8_t reg )
- Generic read data function.uint8_t i2cextend_rmt_read ( uint8_t rmt_slave_addr, uint8_t reg )
- Generic read data in Remote Mode function.
Example Description
The application is composed of three sections :
- System Initialization - Initializes I2C, sets INT pin as input and RST and CS pin as outputs and begins to write log.
- Application Initialization - Initialization driver enables - I2C, check communication with device 6DOF IMU 11 Click connected to the I2C Extend Click ( Remote Mode ), set default configuration and start measurement.
- Application Task - (code snippet) This is an example which demonstrates the use of the I2C Extend Click Board™. In this example, we read Accel and Mag axis of the connected 6DOF IMU 11 Click boards to the I2C Extend Click ( Remote Mode ) which is connected by a LAN cable to the I2C Extend Click Board™ ( Local Mode ) placed in the mikroBUS 1. Results are being sent to the USART Terminal where you can track their changes. All data logs write on USB UART changes for every 2 sec.
void application_task ( ) { mikrobus_logWrite( " Accel | Mag ", _LOG_LINE ); mikrobus_logWrite( "------------------------", _LOG_LINE ); i2cextend_6dofimu11_get_axis( C6DOFIMU11_REG_ACCEL_XOUT_L ); mikrobus_logWrite( " X :", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_TEXT ); mikrobus_logWrite( " | ", _LOG_TEXT ); i2cextend_6dofimu11_get_axis( C6DOFIMU11_REG_MAG_XOUT_L ); mikrobus_logWrite( " X :", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); i2cextend_6dofimu11_get_axis( C6DOFIMU11_REG_ACCEL_YOUT_L ); mikrobus_logWrite( " Y :", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_TEXT ); mikrobus_logWrite( " | ", _LOG_TEXT ); i2cextend_6dofimu11_get_axis( C6DOFIMU11_REG_MAG_YOUT_L ); mikrobus_logWrite( " Y :", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); i2cextend_6dofimu11_get_axis( C6DOFIMU11_REG_ACCEL_ZOUT_L ); mikrobus_logWrite( " Z :", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_TEXT ); mikrobus_logWrite( " | ", _LOG_TEXT ); i2cextend_6dofimu11_get_axis( C6DOFIMU11_REG_MAG_ZOUT_L ); mikrobus_logWrite( " Z :", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); mikrobus_logWrite( "------------------------", _LOG_LINE ); Delay_ms( 1000 ); }
Additional Functions :
- void i2cextend_6dofimu11_get_axis ( uint8_t axis_out_reg )
- Read axis.
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C
- UART
- Conversions
Additional Notes and Information
Depending on the development board you are using, you may need USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
MIKROSDK
The I2C Extend Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.