How does it work?
I2C MUX 4 Click 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.
This 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.
I2C MUX 4 Click 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 labeled 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.
This 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
I2C MUX 4 Click 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
Feature
No ClickID
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 on I2C MUX 4 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 |
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 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 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.
Examples 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 boards to the I2C MUX 4 click. Channel 0 : 6DOF IMU 12 click [slave address: 0x0E; reg: 0x00; id val.: 0x24], Channel 1 : RTC 10 click [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 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 ", _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 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 ", _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 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.