I2C MUX 4 Click Board
I2C MUX 4 Click Board
The I2C MUX 4 Click Board™ is a compact add-on board that contains a dual bidirectional translating switch dedicated for applications with I2C slave address conflicts. This board features the TCA9543APWR, a low voltage 2-channel I2C bus switch with interrupt logic from Texas Instruments. The master SCL/SDA signals are directed to two downstream pairs, or channels, where either individual SCL/SDA channel or both channels can be selected by setting the programmable control register. It has two interrupts and a Reset input which allows the TCA9543A to recover from a situation where one of the downstream I2C buses is stuck in a low state. This Click Board™ is suitable to work with I2C interfaces for applications such as fault isolation, address conflict, level translation, or broadcast communication.
The I2C MUX 4 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 MUX 4 Click Board™ Work?
The I2C MUX 4 Click Board™ is based on the TCA9543APWR, a 2-channel, bidirectional translating I2C switch from Texas Instruments. The master SCL/SDA signal pair is directed to two channels of slave devices SC0/SD0 - SC1/SD1 where either individual channel or both channels can be selected determined by the programmable control register. The TCA9543APWR supports interrupt signals for the Master to detect an interrupt that can result from any of the slave devices connected to the interrupt pins on the output I2C channel header. It features I2C control using a single 8-bit control register in which bits 1 and 0 control the enabling and disabling of the two switch channels of I2C data flow, it supports a reset function, hot insertion, and has all switch channels deselected during Power-Up.
The I2C MUX 4 Click Board™ includes a low dropout linear regulator AP7331 from Diodes Incorporated to provide the 2.45V supply voltage for the TCA9543APWR. When the TCA9543APWR is turned on for the first time or anytime the device needs to be reset by cycling the power supply, which means that the Power-On reset requirements must be followed to ensure the I2C bus logic is initialized properly. The TCA9543APWR can also be reset to its default conditions by using the Power-On reset feature in the event of a glitch or data corruption.
The I2C MUX 4 Click Board™ communicates with MCU using the standard I2C 2-Wire interface that supports Standard-Mode (100 kHz) and Fast-Mode (400 kHz) operation. The TCA9543APWR generates a programmable interrupt signal routed on the INT pin of the mikroBUS™ used for the Master to detect an interrupt which can result from any of the slave devices connected to the output I2C channel pins. It also has two address pins that allow the choice of the least significant bit (LSB) of its I2C slave address which can be done by using the SMD jumper labelled as ADDR SEL, and a Reset function routed on the RST pin of the mikroBUS™ socket used to recover the TCA9543APWR from a bus-fault condition.
The I2C MUX 4 Click Board™ is designed to be operated with both 3.3V and 5V logic voltage 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 | I2C |
Applications | Can be used with I2C interfaces for applications such as fault isolation, address conflict, level translation, or broadcast communication. |
On-board modules | The I2C MUX 4 Click Board™ is based on the TCA9543APWR, a 2-channel, bidirectional translating I2C switch from Texas Instruments. |
Key Features | 1-of-2 bidirectional translating switches, low Stand-By current, support hot insertion, deselected channels during Power-Up, and more. |
Interface | I2C |
Compatibility | mikroBUS |
Click board size | S (28.6 x 25.4 mm) |
Input Voltage | 3.3V or 5V |
PINOUT DIAGRAM
This table shows how the pinout of the I2C MUX 4 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 | RST | 2 | RST | INT | 15 | INT | Interrupt |
NC | 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 |
JP1 | VCC SEL | Left | Power Supply Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2-JP3 | ADDR SEL | Left | Communication Interface Selection: Left position 0, Right position 1 |
J1 | - | - | Output I2C Channel Pins |
I2C MUX 4 CLICK ELECTRICAL SPECIFICATIONS
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | -0.5 | - | 7 | V |
Maximum Output Current | - | - | ±20 | mA |
Maximum Frequency | - | - | 400 | kHz |
Maximum Power Dissipation | - | - | 400 | mW |
Operating Temperature Range | -40 | - | +85 | °C |
Software Support
We provide a library for the I2C MUX 4 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 MUX 4 Click Board™. A library performs the communication with the TCA9543A Low Voltage 2-Channel I2C Bus Switch via I2C interface.
Key Functions
void i2cmux4_power_on ( uint8_t enable )
- Power On function.void i2cmux4_set_channel ( uint8_t sel_ch, uint8_t ch_slave_addr )
- Set channel function.uint8_t i2cmux4_check_int ( void )
- Check interrupt function.
Example Description
The application is composed of three sections :
- System Initialization - Initializes I2C, set RST pin as output, INT pin as input and start to write log.
- Application Initialization - Initialization driver enables - I2C, executes call power On and hardware reset, also write log.
- Application Task - (code snippet) This is an example that demonstrates the use of the I2C MUX 4 Click board™. In this example, we read "Who am I" ( or "State" ) register of the connected Click Board™ boards to the I2C MUX 4 Click Board™. Channel 0 : 6DOF IMU 12 Click Board™ [slave address: 0x0E; reg: 0x00; id val.: 0x24], Channel 1 : RTC 10 Click Board™ [slave address: 0x68; reg: 0x0F; st val.: 0x88]. All data logs write on USB UART changes approximately every 2 sec.
void application_task ( ) { // CH 0 - 6DOF IMU 12 Click Board™ i2cmux4_set_channel( I2CMUX4_SEL_CH_0, 0x68 ); Delay_ms( 100 ); i2cmux4_rmt_read_bytes( 0x00, &rx_data, 1 ); Delay_ms( 100 ); ByteToHex( rx_data, log_text ); mikrobus_logWrite( " 6DOF IMU 12 Click Board™ ", _LOG_LINE ); mikrobus_logWrite( "- - - - - - - - - - - -", _LOG_LINE ); mikrobus_logWrite( " ID = 0x", _LOG_TEXT ); mikrobus_logWrite( log_text, _LOG_LINE ); mikrobus_logWrite( "-----------------------", _LOG_LINE ); Delay_ms( 1000 ); // CH 1 - RTC 10 Click Board™ i2cmux4_set_channel( I2CMUX4_SEL_CH_1, 0x68 ); Delay_ms( 100 ); i2cmux4_rmt_read_bytes( 0x0F, &rx_data, 1 ); Delay_ms( 100 ); ByteToHex( rx_data, log_text ); mikrobus_logWrite( " RTC 10 Click Board™ ", _LOG_LINE ); mikrobus_logWrite( "- - - - - - - - - - - -", _LOG_LINE ); mikrobus_logWrite( " ID = 0x", _LOG_TEXT ); mikrobus_logWrite( log_text, _LOG_LINE ); mikrobus_logWrite( "-----------------------", _LOG_LINE ); Delay_ms( 1000 ); }
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 MUX 4 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 MUX 4 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 MUX 4 Click Board™. A library performs the communication with the TCA9543A Low Voltage 2-Channel I2C Bus Switch via I2C interface.
Key Functions
void i2cmux4_power_on ( uint8_t enable )
- Power On function.void i2cmux4_set_channel ( uint8_t sel_ch, uint8_t ch_slave_addr )
- Set channel function.uint8_t i2cmux4_check_int ( void )
- Check interrupt function.
Example Description
The application is composed of three sections :
- System Initialization - Initializes I2C, set RST pin as output, INT pin as input and start to write log.
- Application Initialization - Initialization driver enables - I2C, executes call power On and hardware reset, also write log.
- Application Task - (code snippet) This is an example that demonstrates the use of the I2C MUX 4 Click board™. In this example, we read "Who am I" ( or "State" ) register of the connected Click Board™ boards to the I2C MUX 4 Click Board™. Channel 0 : 6DOF IMU 12 Click Board™ [slave address: 0x0E; reg: 0x00; id val.: 0x24], Channel 1 : RTC 10 Click Board™ [slave address: 0x68; reg: 0x0F; st val.: 0x88]. All data logs write on USB UART changes approximately every 2 sec.
void application_task ( ) { // CH 0 - 6DOF IMU 12 Click Board™ i2cmux4_set_channel( I2CMUX4_SEL_CH_0, 0x68 ); Delay_ms( 100 ); i2cmux4_rmt_read_bytes( 0x00, &rx_data, 1 ); Delay_ms( 100 ); ByteToHex( rx_data, log_text ); mikrobus_logWrite( " 6DOF IMU 12 Click Board™ ", _LOG_LINE ); mikrobus_logWrite( "- - - - - - - - - - - -", _LOG_LINE ); mikrobus_logWrite( " ID = 0x", _LOG_TEXT ); mikrobus_logWrite( log_text, _LOG_LINE ); mikrobus_logWrite( "-----------------------", _LOG_LINE ); Delay_ms( 1000 ); // CH 1 - RTC 10 Click Board™ i2cmux4_set_channel( I2CMUX4_SEL_CH_1, 0x68 ); Delay_ms( 100 ); i2cmux4_rmt_read_bytes( 0x0F, &rx_data, 1 ); Delay_ms( 100 ); ByteToHex( rx_data, log_text ); mikrobus_logWrite( " RTC 10 Click Board™ ", _LOG_LINE ); mikrobus_logWrite( "- - - - - - - - - - - -", _LOG_LINE ); mikrobus_logWrite( " ID = 0x", _LOG_TEXT ); mikrobus_logWrite( log_text, _LOG_LINE ); mikrobus_logWrite( "-----------------------", _LOG_LINE ); Delay_ms( 1000 ); }
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 MUX 4 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 MUX 4 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.