I2C Extend 2 Click Board
I2C Extend 2 Click Board
The I2C Extend 2 Click Board™ is a compact add-on board suitable for I2C communication bus extension. This board features the PCA9615, a 2-channel multipoint differential I2C bus buffer with hot-swap logic from NXP Semiconductors. The PCA9615 converts the two default I2C signals into four differential signals, two for SCL and two for SDA. The differential signals allow the I2C signals to reach distances of up to 3m while maintaining their signal integrity sent over an Ethernet cable through the onboard RJ-45 connector. This Click Board™ is suitable for various applications that require extending the I2C bus over a long distance, such as commercial lighting and industrial control, control of power supplies in a high noise environment, and more.
The I2C Extend 2 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.
Software Support
We provide a library for the I2C Extend 2 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 I2C Extend 2 Click board™. Library performs a standard I2C interface communication.
Key Functions
void i2cextend2_rmt_write ( uint8_t rmt_slave_addr, uint8_t reg, uint8_t tx_data )
- Generic write data to the remote device function.uint8_t i2cextend2_rmt_read ( uint8_t rmt_slave_addr, uint8_t reg )
- Generic read data from the remote device function.void i2cextend2_enable ( uint8_t en_extend )
- Enable extend function.
Example Description
The application is composed of three sections :
- System Initialization - Initializes I2C, set 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 2 Click, set default configuration and start measurement.
- Application Task - (code snippet) This is an example which demonstrates the use of I2C Extend 2 Click board™. In this example, we read Accel and Mag axis of the connected 6DOF IMU 11 Click board™ to the I2C Extend 2 Click which is connected by a LAN cable to I2C Extend 2 Click 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 ); i2cextend2_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 ); i2cextend2_6dofimu11_get_axis( C6DOFIMU11_REG_MAG_XOUT_L ); mikrobus_logWrite( " X :", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); i2cextend2_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 ); i2cextend2_6dofimu11_get_axis( C6DOFIMU11_REG_MAG_YOUT_L ); mikrobus_logWrite( " Y :", _LOG_TEXT ); IntToStr( axis, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); i2cextend2_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 ); i2cextend2_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 ); }
void i2cextend2_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 2 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.
I2C Extend 2 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.