TOP Contributors

  1. MIKROE (2654 codes)
  2. Alcides Ramos (352 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (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 (136744 times)
  2. FAT32 Library (69952 times)
  3. Network Ethernet Library (55942 times)
  4. USB Device Library (46267 times)
  5. Network WiFi Library (41887 times)
  6. FT800 Library (41173 times)
  7. GSM click (28985 times)
  8. PID Library (26413 times)
  9. mikroSDK (26362 times)
  10. microSD click (25376 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 2 click

Rating:

5

Author: MIKROE

Last Updated: 2020-05-06

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: I2C

Downloaded: 2350 times

Not followed.

License: MIT license  

I2C MUX 2 Click is a quad bidirectional translating I2C and SMBus switch with reset and interrupt functions, intended for applications with I2C slave address conflicts. It features a quad bidirectional translating switch controlled via the I2C bus, labeled as TCA9545A from Texas Instruments.

No Abuse Reported

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

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

Do you want to report abuse regarding "I2C MUX 2 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 2 Click

I2C MUX 2 Click

Native view of the I2C MUX 2 Click board.

View full image
I2C MUX 2 Click

I2C MUX 2 Click

Front and back view of the I2C MUX 2 Click board.

View full image

Library Description

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

Key functions:

  • void i2cmux2_hw_reset ( void ) - Hardware reset function
  • void i2cmux2_set_channel ( uint8_t channel, uint8_t ch_slave_address ) - Set channel function.
  • uint8_t i2cmux2_read_interrupt ( void ) - Read interrupt status 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 2 Click board. In this example, we read "Who am I" ( or "State" ) register of the connected click boards to the I2C MUX 2 click. Channel 0 : 6DOF IMU 11 click [slave address: 0x0E; reg: 0x00; id val.: 0x2D], Channel 1 : Altintude click [slave address: 0x60; reg: 0x0C; id val.: 0xC4], Channel 2 : 6DOF IMU 9 click [slave address: 0x69; reg: 0x75; id val.: 0xA9], Channel 3 : RTC 10 click [slave address: 0x68; reg: 0x0F; st val.: 0x88]. All data logs write on USB UART changes every 2 sec.
void application_task ( )
{
    mikrobus_logWrite( "  CH  |   ID   |  INT " ,_LOG_LINE );
    mikrobus_logWrite( "----------------------", _LOG_LINE );
    
    // SET CHANNEL 0: 6DOF IMU 11 click
    i2cmux2_set_channel( I2CMUX2_CMD_SET_CH_0, 0x0E );
    Delay_ms( 100 );
    i2cmux2_generic_read( 0x00, &rx_data, 1 );
    mikrobus_logWrite( "   0  |  0x", _LOG_TEXT );
    display_log( I2CMUX2_CMD_SET_CH_0 );
    
    // SET CHANNEL 1: Altitude click
    i2cmux2_set_channel( I2CMUX2_CMD_SET_CH_1, 0x60 );
    Delay_ms( 100 );
    i2cmux2_generic_read( 0x0C, &rx_data, 1 );
    mikrobus_logWrite( "   1  |  0x", _LOG_TEXT );
    display_log( I2CMUX2_CMD_SET_CH_1 );
    
    // SET CHANNEL 2: 6DOF IMU 9 click
    i2cmux2_set_channel( I2CMUX2_CMD_SET_CH_2, 0x69 );
    Delay_ms( 100 );
    i2cmux2_generic_read( 0x75, &rx_data, 1 );
    mikrobus_logWrite( "   2  |  0x", _LOG_TEXT );
    display_log( I2CMUX2_CMD_SET_CH_2 );

    // SET CHANNEL 3: RTC 10 click
    i2cmux2_set_channel( I2CMUX2_CMD_SET_CH_3, 0x68 );
    Delay_ms( 100 );
    i2cmux2_generic_read( 0x0F, &rx_data, 1 );
    mikrobus_logWrite( "   3  |  0x", _LOG_TEXT );
    display_log( I2CMUX2_CMD_SET_CH_3 );

    mikrobus_logWrite( "----------------------", _LOG_LINE );
    Delay_ms( 2000 );
}

Additional Functions :

  • void display_log ( uint8_t sel_ch ) - Display data logs.

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

UWB click

0

UWB Click is an Ultra-Wideband transceiver Click board™ that can be used in 2-way ranging or TDOA location systems to locate assets to a precision of 10 cm and supports data rates of up to 6.8 Mbps. This Click board™ features the DWM1000 module based on Decawave's DW1000 Ultra-Wideband (UWB) transceiver from Decawave Limited.

[Learn More]

Pressure click

0

This is a sample program which demonstrates the use of Pressure Click. Program uses Pressure module LPS331AP for measuring 260-1260 mbar of pressure. Pressure and temperature is then presented on the LCD 2 x 16 char bit.

[Learn More]

Microwave 4 click

0

Microwave 4 Click is a compact add-on board that utilizes the Doppler Shift Phenomenon to sense motion. This board features the PD-V12, a miniature high-frequency microwave transceiver from Ningbo Pdlux Electronic Technology. The transmitter on this transceiver works on a 24.1GHz frequency over the flat Plane antenna.

[Learn More]