How does it work?
I2C MUX 5 Click is based on the LTC4306, a 4-channel, 2-wire bus multiplexer with bus buffers to provide capacitive isolation between the upstream and downstream buses from Analog Devices. Multiplexing allows address expansion as well as addressing one of the multiple identical devices, thus resolving address conflict issues. Through software control, the LTC4306 splits the I2C bus into four sub-branches and connects the upstream 2-wire bus to any desired combination of downstream buses. It’s compatible with I2C and SMBus standards, has a programmable disconnect from stuck bus function, and provides four alert inputs for fault reporting with two GPIO pins configurable as inputs, open-drain, or push-pull outputs.
I2C MUX 5 Click communicates with MCU using the standard I2C 2-Wire interface with a frequency up to 400kHz. It also has three address pins (A0, A1, and A2 that provides 27 specific addresses) programmed by the user to determine the value of the last three LSBs of the slave address selected by onboard SMD jumpers labeled as ADDR SEL, allowing selection of the slave address LSBs.
In addition to I2C communication, this Click board™ has several additional features such as Interface Enable, Fault Alert, and Connection Ready function. The Fault Alert pin, labeled as ALR and routed on the INT pin of the mikroBUS™ socket, is pulled low when a fault occurs to alert the MCU. This pin is pulled to low logic level when any of the four alert input pins are low or when the 2-wire bus is stuck low and visually displays its function with a red LED marked as ALERT.
The Enable pin, labeled as EN and routed on the CS pin of the mikroBUS™ socket, is used to enable or disable I2C communication to the LTC4306, and the Ready pin labeled as RDY, routed on the AN pin of the mikroBUS™ socket, is used as connection ready output. This pin is pulled down when none of the downstream channels is connected to the upstream bus and turns off when one or more downstream channels are connected to the upstream bus.
The LTC4306 optionally provides two general-purpose input/output pins (GPIOs) that can be configured as logic inputs, open-drain outputs, or push-pull outputs. These pins are also connected to the two green LEDs, LD3 and LD2, which light up when GP1 and GP2 pins, respectively, are low.
This Click board™ is designed to operate with both 3.3V and 5V logic voltage levels selected via the VCC SEL jumper. It allows for both 3.3V and 5V capable MCUs to use the I2C communication lines properly. However, the Click board™ comes equipped with a library that contains functions and an example code that can be used, as a reference, for further development.
Specifications
Type
I2C
Applications
Can be used for a wide range of applications from industrial to medical, communications, and automotive systems.
On-board modules
I2C MUX 5 Click is based on the LTC4306, a 4-channel, 2-wire bus multiplexer with bus buffers to provide capacitive isolation between the upstream and downstream buses from Analog Devices.
Key Features
Multiplexer with capacitance buffering, programmable disconnect from stuck bus, compatible with I2C and SMBus standards, several fault reporting pins, and more.
Interface
I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on I2C MUX 5 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
LD2 | ALERT | – | Alert LED Indicator |
LD3-LD4 | LD3-LD4 | – | Configurable LED Indicator |
JP1 | VCC SEL | Left | Logic Level Voltage Selection 3.3V/5V: Left position 3.3V, Right position 5V |
JP2-JP4 | ADDR SEL | Left | I2C Address Selection: Left position 0, Right position 1 |
J1-J4 | CH1-CH4 | Populated | Output I2C Channel Pins |
J5 | – | Populated | Configurable GPIO Pins |
I2C MUX 5 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 2.2 | – | 5.5 | V |
Maximum Supply Current | – | – | 8 | mA |
2-Wire Bus Frequency Range | 0 | – | 400 | kHz |
Operating Temperature Range | 0 | – | 70 | °C |
Software Support
We provide a library for the I2C MUX 5 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on mikroE github account.
Library Description
This library contains API for I2C MUX 5 Click driver.
Key functions:
void i2cmux5_cfg_setup ( i2cmux5_cfg_t *cfg );
– Config Object Initialization function.I2CMUX5_RETVAL i2cmux5_init ( i2cmux5_t *ctx, i2cmux5_cfg_t *cfg );
– Initialization function.void i2cmux5_default_cfg ( i2cmux5_t *ctx );
– Click Default Configuration function.
Examples description
This app reads “Who am I” and “Status” register of the connected Click Boards™ to the I2C MUX 5 Click.
void application_task ( void ) { rx_data = i2cmux5_channel_read_byte( &i2cmux5, I2CMUX5_CH_1, I2CMUX5_SET_6DOF_IMU_9_ADDR, 0x75 ); Delay_ms( 1000 ); log_printf( &logger, " CH-1 6DOF IMU 9 click : 0x%X rn", ( uint16_t )rx_data ); rx_data = i2cmux5_channel_read_byte( &i2cmux5, I2CMUX5_CH_2, I2CMUX5_SET_6DOF_IMU_11_ADDR, 0x00 ); Delay_ms( 1000 ); log_printf( &logger, " CH-2 6DOF IMU 11 click : 0x%X rn", ( uint16_t )rx_data ); rx_data = i2cmux5_channel_read_byte( &i2cmux5, I2CMUX5_CH_3, I2CMUX5_SET_RTC_10_ADDR, 0x0F ); Delay_ms( 1000 ); log_printf( &logger, " CH-3 RTC 10 click : 0x%X rn", ( uint16_t )rx_data ); rx_data = i2cmux5_channel_read_byte( &i2cmux5, I2CMUX5_CH_4, I2CMUX5_SET_ACCEL_10_ADDR, 0x0F ); Delay_ms( 1000 ); log_printf( &logger, " CH-4 Accel 10 click : 0x%X rn", ( uint16_t )rx_data ); log_printf( &logger, "-------------------------------rn" ); i2cmux5_hw_reset( &i2cmux5 ); Delay_ms( 2000 ); }
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on mikroE github account.
Other mikroE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.I2cMux5
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click 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
This 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.
For more information about mikroSDK, visit the official page.