TOP Contributors

  1. MIKROE (2693 codes)
  2. Alcides Ramos (362 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (137951 times)
  2. FAT32 Library (70759 times)
  3. Network Ethernet Library (56445 times)
  4. USB Device Library (46827 times)
  5. Network WiFi Library (42587 times)
  6. FT800 Library (41785 times)
  7. GSM click (29468 times)
  8. mikroSDK (27020 times)
  9. PID Library (26661 times)
  10. microSD click (25797 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

I2C MUX click

Rating:

5

Author: MIKROE

Last Updated: 2020-03-27

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: I2C

Downloaded: 2453 times

Not followed.

License: MIT license  

I2C MUX Click is an quad bidirectional translating I2C and SMBus switch with reset function, intended for applications with I2C slave address conflicts (multiple, identical temp sensors). It features a quad bidirectional translating switch controlled via the I2C bus, labeled as TCA9546A from Texas Instruments.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "I2C MUX click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "I2C MUX click" changes.

Do you want to report abuse regarding "I2C MUX click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

I2C MUX Click

I2C MUX Click

Native view of the I2C MUX Click board.

View full image
I2C MUX Click

I2C MUX Click

Front and back view of the I2C MUX Click board.

View full image

Library Description

The library covers all the necessary functions to control I2C MUX click board.

Key functions:

  • void i2cmux_hw_reset ( void ) - Hardware reset function.
  • void i2cmux_set_channel ( uint8_t channel, uint8_t ch_slave_address ) - Set channel function.
  • void i2cmux_generic_read ( uint8_t reg, uint8_t *p_rx_data, uint8_t n_bytes ) - Generic read data function.

Examples description

The application is composed of three sections :

  • System Initialization - Initializes I2C, set RST pin as output and start to write log.
  • Application Initialization - Initialization driver enables - I2C, executes call hardware reset, also write log.
  • Application Task - (code snippet) This is an example that demonstrates the use of the I2C MUX Click board. In this example, we read "Who am I" register of the connected click boards to the UART MUX click. Channel 0 : 6DOF IMU 9 click [ slave address: 0x69; reg: 0x75; id val.: 0xA9 ], Channel 1 : RTC 10 click [ slave address: 0x68; reg: 0x0F; id val.: 0x88 ], Channel 2 : Altintude click [ slave address: 0x60; reg: 0x0C; id val.: 0xC4 ], Channel 3 : Temp & Hum click [ slave address: 0x5F; reg: 0x0F; id val.: 0xBC ]. All data logs write on USB UART changes every 2 sec.
void application_task ( )
{
    // SET CHANNEL 0: 6DOF IMU 9 click
    i2cmux_set_channel( I2CMUX_CMD_SET_CH_0, 0x69 );
    Delay_ms( 100 );
    
    i2cmux_generic_read( 0x75, &rx_data, 1 );
    mikrobus_logWrite( " CH-0 : ID = 0x", _LOG_TEXT );
    display_log( );

    // SET CHANNEL 1: RTC 10 click
    i2cmux_set_channel( I2CMUX_CMD_SET_CH_1, 0x68 );
    Delay_ms( 100 );
    
    i2cmux_generic_read( 0x0F, &rx_data, 1 );
    mikrobus_logWrite( " CH-1 : ST = 0x", _LOG_TEXT );
    display_log( );
    
    // SET CHANNEL 2: Altitude click
    i2cmux_set_channel( I2CMUX_CMD_SET_CH_2, 0x60 );
    Delay_ms( 100 );
    
    i2cmux_generic_read( 0x0C, &rx_data, 1 );
    mikrobus_logWrite( " CH-2 : ID = 0x", _LOG_TEXT );
    display_log( );
    
    // SET CHANNEL 3: Temp & Hum click
    i2cmux_set_channel( I2CMUX_CMD_SET_CH_3, 0x5F );
    Delay_ms( 100 );
    
    i2cmux_generic_read( 0x0F, &rx_data, 1 );
    mikrobus_logWrite( " CH-3 : ID = 0x", _LOG_TEXT );
    display_log( );
    
    mikrobus_logWrite( "------------------", _LOG_LINE );
    Delay_ms( 2000 );
}


  • void display_log ( void ) - Display log function.

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 clickUSB 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.

ALSO FROM THIS AUTHOR

Load Cell 5 click

0

Load Cell 5 Click is a compact add-on board that represents a weigh scale solution. This board features the AD7780, a pin-programmable, low power, 24-bit sigma-delta ΣΔ ADC from Analog Devices. It interfaces directly to the load cell, where the low-level signal from the load cell is amplified by the AD7780’s internal low noise programmable gain amplifier programmed to operate with a gain of 128 or 1. It also has a power-down mode allowing the user to switch off the power to the bridge sensor and power-down the AD7780 when not converting, increasing the product battery life. This Click board™ has many features that make it a perfect solution for safety-critical and weight measurement applications.

[Learn More]

Proximity 17 click

0

Proximity 17 Click is a compact add-on board that contains a close-range proximity sensing solution. This board features the TMD2635, a miniature proximity sensor module from ams AG. The TMD2635 features advanced proximity measurement in a tiny and thin optical land grid array module that incorporates a 940nm infrared vertical-cavity surface-emitting laser (IR VCSEL) factory calibrated for IR proximity response. It also offers advanced crosstalk noise cancellation through a wide range of offset adjustments through a digital fast-mode I2C interface to compensate for unwanted IR energy reflection at the sensor. This Click board™ is suitable for consumer and industrial applications.

[Learn More]

Interrupts on PIC32MX460F512L

0

This example demonstrates how to setup:
- External INT2 interrupt on PORTE.9 pin
- UART RX event interrupt

[Learn More]