Expand the possibilities of your I2C-enabled projects with ease, thanks to our bus extension solution, designed to simplify the integration of remote sensors, displays, and control devices
A
A
Hardware Overview
How does it work?
I2C Extend 2 Click is based on the PCA9615, a Fast-Mode Plus (FM+) I2C bus buffer that extends the single-ended I2C bus through electrically noisy environments from NXP Semiconductor. It consists of two single-ended to differential driver channels for the SCL (Serial Clock) and SDA (Serial Data). Differential transmission lines between identical I2C bus buffers remove electrical noise and common-mode offsets when signals pass between different voltage domains, such as high-energy power supplies and electric motors. Those signals can reach up to 3m or longer at lower clock speeds while maintaining signal integrity sent over an Ethernet cable (a twisted-pair transmission line cable) through the onboard RJ-45 connector. The PCA9615 converts the default I2C signals into four differential signals, two for SCL and two for SDA. The signal direction is
determined by the I2C protocol, which means it does not require a direction signal, as these bus buffers automatically set signal flow direction. Additional circuitry allows the PCA9615 to be used for ‘hot-swap’ applications, where systems are always ON but require insertion or removal of modules or cards without disrupting existing signals. Because the supply voltages on the I2C bus side may differ from the external I2C bus side, there are two power supply pins and common ground. The first is a standard I2C bus-side power supply selected via the VCC SEL jumper, and the other represents the majority supply for circuitry determined by the VDD SEL jumper. I2C Extend 2 Click communicates with MCU using the standard I2C interface with a frequency of up to 100kHz in the Standard 400kHz in the Fast Mode and up to 1MHz in the Fast Mode Plus. The user must be
cautious not to overload the driver's current rating of 3mA for Standard and Fast Modes and 30mA for Fast Mode Plus (FM+). Also, this Click board™ has an Enable pin, routed on the CS pin of the mikroBUS™ socket labeled as EN, used to turn off the bus buffer, and is useful for fault finding, Power-Up sequencing, or re-configuration of a bus system by isolating sections not needed at all times. This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.
Features overview
Development board
Fusion for TIVA v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports a wide range of microcontrollers, such as different 32-bit ARM® Cortex®-M based MCUs from Texas Instruments, regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer over a WiFi network. The development board is well organized and designed so that the end-user has all the necessary elements, such as switches, buttons, indicators, connectors, and others, in one place. Thanks to innovative manufacturing technology, Fusion for TIVA v8 provides a fluid and immersive working experience, allowing access
anywhere and under any circumstances at any time. Each part of the Fusion for TIVA v8 development board contains the components necessary for the most efficient operation of the same board. An advanced integrated CODEGRIP programmer/debugger module offers many valuable programming/debugging options, including support for JTAG, SWD, and SWO Trace (Single Wire Output)), and seamless integration with the Mikroe software environment. Besides, it also includes a clean and regulated power supply module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via the USB Type-C (USB-C) connector.
Communication options such as USB-UART, USB HOST/DEVICE, CAN (on the MCU card, if supported), and Ethernet is also included. In addition, it also has the well-established mikroBUS™ standard, a standardized socket for the MCU card (SiBRAIN standard), and two display options for the TFT board line of products and character-based LCD. Fusion for TIVA v8 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU

Type
8th Generation
Architecture
ARM Cortex-M4
MCU Memory (KB)
512
Silicon Vendor
Texas Instruments
Pin count
212
RAM (Bytes)
262144
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic

Step by step
Project assembly
Track your results in real time
Application Output
1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support
Library Description
This library contains API for I2C Extend 2 Click driver.
Key functions:
i2cextend2_rmt_write
- Generic write data in Remote Mode functioni2cextend2_rmt_read
- Generic read data in Remote Mode functioni2cextend2_enable
- Enable extend function
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* @file main.c
* @brief I2CExtend2 Click example
*
* # Description
* This is an example which demonstrates the use of I2C Extend 2 Click board.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initialization driver enables - I2C,
* check communication with device 6DOF IMU 11 Click
* connected to the I2C Extend 2 Click ( Remote Mode ),
* set default configuration and start measurement.
*
* ## Application Task
* In this example, we read Accel and Mag axis of the connected
* 6DOF IMU 11 Click boards to the I2C Extend 2 Click ( Remote Mode )
* which is connected by a LAN cable to I2C Extend 2 Click ( Local Mode ).
* 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.
*
* @author Stefan Ilic
*
*/
#include "board.h"
#include "log.h"
#include "i2cextend2.h"
static i2cextend2_t i2cextend2;
static log_t logger;
int16_t axis;
void i2cextend2_6dofimu11_get_axis ( i2cextend2_t *ctx, uint8_t axis_out_reg )
{
uint16_t rx_val = 0;
rx_val = i2cextend2_rmt_read( ctx, axis_out_reg + 1 );
rx_val <<= 8;
rx_val |= i2cextend2_rmt_read( ctx, axis_out_reg );
axis = ( int16_t ) rx_val;
}
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
i2cextend2_cfg_t i2cextend2_cfg; /**< Click config object. */
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
i2cextend2_cfg_setup( &i2cextend2_cfg );
I2CEXTEND2_MAP_MIKROBUS( i2cextend2_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == i2cextend2_init( &i2cextend2, &i2cextend2_cfg ) )
{
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
i2cextend2_enable( &i2cextend2, I2CEXTEND2_EXTEND_ENABLE );
if ( C6DOFIMU11_WHO_AM_I_WIA_ID == i2cextend2_rmt_read( &i2cextend2, C6DOFIMU11_REG_WHO_AM_I ) )
{
log_printf( &logger, " SUCCESS \r\n" );
log_printf( &logger, "------------------------\r\n" );
}
else
{
log_printf( &logger, " ERROR \r\n" );
log_printf( &logger, " Reset the device \r\n" );
log_printf( &logger, "------------------------\r\n" );
for ( ; ; );
}
i2cextend2_rmt_write ( &i2cextend2, C6DOFIMU11_REG_CNTL2, C6DOFIMU11_CNTL2_TEMP_EN_STANDBY_MODE |
C6DOFIMU11_CNTL2_MAG_EN_STANDBY_MODE |
C6DOFIMU11_CNTL2_ACCEL_EN_STANDBY_MODE );
i2cextend2_rmt_write ( &i2cextend2, C6DOFIMU11_REG_INC3, C6DOFIMU11_INC3_IEL2_FIFO_TRIG |
C6DOFIMU11_INC3_IEL1_FIFO_TRIG );
i2cextend2_rmt_write ( &i2cextend2, C6DOFIMU11_REG_CNTL2, C6DOFIMU11_CNTL2_GSEL_8G |
C6DOFIMU11_CNTL2_RES_MAX2 |
C6DOFIMU11_CNTL2_MAG_EN_OPERATING_MODE |
C6DOFIMU11_CNTL2_ACCEL_EN_OPERATING_MODE );
Delay_ms ( 100 );
log_info( &logger, " Application Task " );
log_printf( &logger, "------------------------\r\n" );
}
void application_task ( void )
{
log_printf( &logger, "\t Accel \t|\t Mag \r\n" );
log_printf( &logger, "------------------------------------------------\r\n" );
i2cextend2_6dofimu11_get_axis( &i2cextend2, C6DOFIMU11_REG_ACCEL_XOUT_L );
log_printf( &logger, "\t Accel X: %d\t|", axis );
i2cextend2_6dofimu11_get_axis( &i2cextend2, C6DOFIMU11_REG_MAG_XOUT_L );
log_printf( &logger, "\t Mag X: %d\r\n", axis );
i2cextend2_6dofimu11_get_axis( &i2cextend2, C6DOFIMU11_REG_ACCEL_YOUT_L );
log_printf( &logger, "\t Accel Y: %d\t|", axis );
i2cextend2_6dofimu11_get_axis( &i2cextend2, C6DOFIMU11_REG_MAG_YOUT_L );
log_printf( &logger, "\t Mag Y: %d\r\n", axis );
i2cextend2_6dofimu11_get_axis( &i2cextend2, C6DOFIMU11_REG_ACCEL_ZOUT_L );
log_printf( &logger, "\t Accel Z: %d\t|", axis );
i2cextend2_6dofimu11_get_axis( &i2cextend2, C6DOFIMU11_REG_MAG_ZOUT_L );
log_printf( &logger, "\t Mag Z: %d\r\n", axis );
log_printf( &logger, "------------------------------------------------\r\n" );
Delay_ms ( 1000 );
}
int main ( void )
{
/* Do not remove this line or clock might not be set correctly. */
#ifdef PREINIT_SUPPORTED
preinit();
#endif
application_init( );
for ( ; ; )
{
application_task( );
}
return 0;
}
// ------------------------------------------------------------------------ END
/*!
* @file main.c
* @brief I2CExtend2 Click example
*
* # Description
* This is an example which demonstrates the use of I2C Extend 2 Click board.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initialization driver enables - I2C,
* check communication with device 6DOF IMU 11 Click
* connected to the I2C Extend 2 Click ( Remote Mode ),
* set default configuration and start measurement.
*
* ## Application Task
* In this example, we read Accel and Mag axis of the connected
* 6DOF IMU 11 Click boards to the I2C Extend 2 Click ( Remote Mode )
* which is connected by a LAN cable to I2C Extend 2 Click ( Local Mode ).
* 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.
*
* @author Stefan Ilic
*
*/
#include "board.h"
#include "log.h"
#include "i2cextend2.h"
static i2cextend2_t i2cextend2;
static log_t logger;
int16_t axis;
void i2cextend2_6dofimu11_get_axis ( i2cextend2_t *ctx, uint8_t axis_out_reg )
{
uint16_t rx_val = 0;
rx_val = i2cextend2_rmt_read( ctx, axis_out_reg + 1 );
rx_val <<= 8;
rx_val |= i2cextend2_rmt_read( ctx, axis_out_reg );
axis = ( int16_t ) rx_val;
}
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
i2cextend2_cfg_t i2cextend2_cfg; /**< Click config object. */
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
i2cextend2_cfg_setup( &i2cextend2_cfg );
I2CEXTEND2_MAP_MIKROBUS( i2cextend2_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == i2cextend2_init( &i2cextend2, &i2cextend2_cfg ) )
{
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
i2cextend2_enable( &i2cextend2, I2CEXTEND2_EXTEND_ENABLE );
if ( C6DOFIMU11_WHO_AM_I_WIA_ID == i2cextend2_rmt_read( &i2cextend2, C6DOFIMU11_REG_WHO_AM_I ) )
{
log_printf( &logger, " SUCCESS \r\n" );
log_printf( &logger, "------------------------\r\n" );
}
else
{
log_printf( &logger, " ERROR \r\n" );
log_printf( &logger, " Reset the device \r\n" );
log_printf( &logger, "------------------------\r\n" );
for ( ; ; );
}
i2cextend2_rmt_write ( &i2cextend2, C6DOFIMU11_REG_CNTL2, C6DOFIMU11_CNTL2_TEMP_EN_STANDBY_MODE |
C6DOFIMU11_CNTL2_MAG_EN_STANDBY_MODE |
C6DOFIMU11_CNTL2_ACCEL_EN_STANDBY_MODE );
i2cextend2_rmt_write ( &i2cextend2, C6DOFIMU11_REG_INC3, C6DOFIMU11_INC3_IEL2_FIFO_TRIG |
C6DOFIMU11_INC3_IEL1_FIFO_TRIG );
i2cextend2_rmt_write ( &i2cextend2, C6DOFIMU11_REG_CNTL2, C6DOFIMU11_CNTL2_GSEL_8G |
C6DOFIMU11_CNTL2_RES_MAX2 |
C6DOFIMU11_CNTL2_MAG_EN_OPERATING_MODE |
C6DOFIMU11_CNTL2_ACCEL_EN_OPERATING_MODE );
Delay_ms ( 100 );
log_info( &logger, " Application Task " );
log_printf( &logger, "------------------------\r\n" );
}
void application_task ( void )
{
log_printf( &logger, "\t Accel \t|\t Mag \r\n" );
log_printf( &logger, "------------------------------------------------\r\n" );
i2cextend2_6dofimu11_get_axis( &i2cextend2, C6DOFIMU11_REG_ACCEL_XOUT_L );
log_printf( &logger, "\t Accel X: %d\t|", axis );
i2cextend2_6dofimu11_get_axis( &i2cextend2, C6DOFIMU11_REG_MAG_XOUT_L );
log_printf( &logger, "\t Mag X: %d\r\n", axis );
i2cextend2_6dofimu11_get_axis( &i2cextend2, C6DOFIMU11_REG_ACCEL_YOUT_L );
log_printf( &logger, "\t Accel Y: %d\t|", axis );
i2cextend2_6dofimu11_get_axis( &i2cextend2, C6DOFIMU11_REG_MAG_YOUT_L );
log_printf( &logger, "\t Mag Y: %d\r\n", axis );
i2cextend2_6dofimu11_get_axis( &i2cextend2, C6DOFIMU11_REG_ACCEL_ZOUT_L );
log_printf( &logger, "\t Accel Z: %d\t|", axis );
i2cextend2_6dofimu11_get_axis( &i2cextend2, C6DOFIMU11_REG_MAG_ZOUT_L );
log_printf( &logger, "\t Mag Z: %d\r\n", axis );
log_printf( &logger, "------------------------------------------------\r\n" );
Delay_ms ( 1000 );
}
int main ( void )
{
/* Do not remove this line or clock might not be set correctly. */
#ifdef PREINIT_SUPPORTED
preinit();
#endif
application_init( );
for ( ; ; )
{
application_task( );
}
return 0;
}
// ------------------------------------------------------------------------ END