TOP Contributors

  1. MIKROE (2650 codes)
  2. Alcides Ramos (350 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 (136550 times)
  2. FAT32 Library (69744 times)
  3. Network Ethernet Library (55848 times)
  4. USB Device Library (46186 times)
  5. Network WiFi Library (41806 times)
  6. FT800 Library (40999 times)
  7. GSM click (28927 times)
  8. PID Library (26385 times)
  9. mikroSDK (26288 times)
  10. microSD click (25301 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 3 click

Rating:

5

Author: MIKROE

Last Updated: 2020-09-16

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: I2C

Downloaded: 1518 times

Not followed.

License: MIT license  

I2C MUX 3 Click is a compact add-on board that contains eight bidirectional translating switches dedicated for applications with I2C slave address conflicts. This board features the TCA9548APWR, a low voltage 8-channel I2C bus switch with an active-low reset input from Texas Instruments.

No Abuse Reported

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

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

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

I2C MUX 3 Click

Native view of the I2C MUX 3 Click board.

View full image
I2C MUX 3 Click

I2C MUX 3 Click

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

View full image

Library Description

The library covers all the necessary functions that enables the usage of the I2C MUX 3 click board. User can set one of 8 channels by writing to devices control register and check it by reading, or use the function to set it directly. User can also use sequential read and write function to comunicate with the devices sonnected to the selected channel.

Key functions:

  • uint8_t n_bytes ); - Function is used to write a sequential data starting from the targeted 8-bit register address of the device connected to the desired channel of the I2C MUX 4 click board.
  • uint8_t n_bytes ) - Function is used to read a sequential data starting from the targeted 8-bit register address of the device connected to the desired channel of the I2C MUX 4 click board.
  • void i2cmux3_ch_sel ( uint8_t sel_ch ); - Function is used to select communication channel.

Examples description

The application is composed of three sections :

  • System Initialization - Initializes I2C module, LOG structure and sets RST pin as output.
  • Application Initialization - Initalizes I2C driver, preforms hardware reset and makes an initial log.
  • Application Task - This example shows the capabilities of the I2C MUX 3 click by reading device ID values from eight different click boards and displaying the readings via USART terminal. Some of the used click boards have the same I2C slave addresses, while others do not.
  • Application Note - Click boards used in this example : 6DOF IMU 12 click - https://www.mikroe.com/6dof-imu-12-click RTC 10 click - https://www.mikroe.com/rtc-10-click Surface Temp click - https://www.mikroe.com/surface-temp-click Spectrometer click - https://www.mikroe.com/spectrometer-click Compass 3 click - https://www.mikroe.com/compass-3-click Color 3 click - https://www.mikroe.com/color-3-click 6DOF IMU 11 click - https://www.mikroe.com/6dof-imu-11-click Heart Rate 4 click - https://www.mikroe.com/heart-rate-4-click
void application_task ( )
{
    mikrobus_logWrite( "-------------------------", _LOG_LINE );
    mikrobus_logWrite( "ID values by click board:", _LOG_LINE );
    mikrobus_logWrite( "-------------------------", _LOG_LINE );
    mikrobus_logWrite( "", _LOG_LINE );

    i2cmux3_ch_sel( 0 );
    i2cmux3_rd_slv ( 0x68, 0x00, &id_val, 1 );
    ByteToHex( id_val, log_txt );
    Ltrim( log_txt );
    mikrobus_logWrite( " 6DOF IMU 12  : 0x", _LOG_TEXT );
    mikrobus_logWrite( log_txt, _LOG_LINE );
    mikrobus_logWrite( "-------------------------", _LOG_LINE );
    Delay_ms( 100 );

    i2cmux3_ch_sel( 1 );
    i2cmux3_rd_slv ( 0x68, 0x0F, &id_val, 1 );
    ByteToHex( id_val, log_txt );
    Ltrim( log_txt );
    mikrobus_logWrite( " RTC 10       : 0x", _LOG_TEXT );
    mikrobus_logWrite( log_txt, _LOG_LINE );
    mikrobus_logWrite( "-------------------------", _LOG_LINE );
    Delay_ms( 100 );

    i2cmux3_ch_sel( 2 );
    i2cmux3_rd_slv ( 0x48, 0x0B, &id_val, 1 );
    ByteToHex( id_val, log_txt );
    Ltrim( log_txt );
    mikrobus_logWrite( " Surface Temp : 0x", _LOG_TEXT );
    mikrobus_logWrite( log_txt, _LOG_LINE );
    mikrobus_logWrite( "-------------------------", _LOG_LINE );
    Delay_ms( 100 );
    
    i2cmux3_ch_sel( 3 );
    i2cmux3_rd_slv ( 0x39, 0x92, &id_val, 1 );
    ByteToHex( id_val, log_txt );
    Ltrim( log_txt );
    mikrobus_logWrite( " Spectrometer : 0x", _LOG_TEXT );
    mikrobus_logWrite( log_txt, _LOG_LINE );
    mikrobus_logWrite( "-------------------------", _LOG_LINE );
    Delay_ms( 100 );
    
    i2cmux3_ch_sel( 4 );
    i2cmux3_rd_slv ( 0x30, 0x2F, &id_val, 1 );
    ByteToHex( id_val, log_txt );
    Ltrim( log_txt );
    mikrobus_logWrite( " Compass 3    : 0x", _LOG_TEXT );
    mikrobus_logWrite( log_txt, _LOG_LINE );
    mikrobus_logWrite( "-------------------------", _LOG_LINE );
    Delay_ms( 100 );
    
    i2cmux3_ch_sel( 5 );
    i2cmux3_rd_slv ( 0x29, 0x12, &id_val, 1 );
    ByteToHex( id_val, log_txt );
    Ltrim( log_txt );
    mikrobus_logWrite( " Color 3      : 0x", _LOG_TEXT );
    mikrobus_logWrite( log_txt, _LOG_LINE );
    mikrobus_logWrite( "-------------------------", _LOG_LINE );
    Delay_ms( 100 );
    
    i2cmux3_ch_sel( 6 );
    i2cmux3_rd_slv ( 0x0E, 0x00, &id_val, 1 );
    ByteToHex( id_val, log_txt );
    Ltrim( log_txt );
    mikrobus_logWrite( " 6DOF IMU 11  : 0x", _LOG_TEXT );
    mikrobus_logWrite( log_txt, _LOG_LINE );
    mikrobus_logWrite( "-------------------------", _LOG_LINE );
    Delay_ms( 100 );
    
    i2cmux3_ch_sel( 7 );
    i2cmux3_rd_slv ( 0x57, 0xFF, &id_val, 1 );
    ByteToHex( id_val, log_txt );
    Ltrim( log_txt );
    mikrobus_logWrite( " Heart Rate 4 : 0x", _LOG_TEXT );
    mikrobus_logWrite( log_txt, _LOG_LINE );
    mikrobus_logWrite( "-------------------------", _LOG_LINE );
    Delay_ms( 100 );

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

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

RS Transceiver click

0

RS Transceiver is a compact add-on board that offers an interface between the TTL level UART and RS-232/RS-422/RS-485 communication buses. This board features the XR34350, an RS-232/RS-422/RS-485 serial transceiver with internal termination and wide output swing from MaxLinear. Integrated cable termination and four configuration modes allow all three protocols to be used interchangeably over a single cable over the DE-9 connector. All transmitter outputs and receiver inputs feature robust ESD protection and HBM up to ±15kV.

[Learn More]

Ozone 3 click

0

Ozone 3 Click is a compact add-on board suitable for ozone concentration detection and monitoring. This board features the 110-407, a high-performance ultra-thin electrochemical gas sensor from SPEC Sensors supported by the LMP91000, a high-precision integrated analog front-end IC (AFE) ideal for this sensing application. It provides the reference voltage required by the sensor and offers a choice between the analog output from the AFE IC buffered with the low noise Op-Amp and digital output from the 12-bit SAR A/D converter. This Click board™ represents an ideal choice for health, environmental, industrial, and residential monitoring.

[Learn More]

Pressure 12 click

0

Pressure 12 click is a barometric gauge pressure measuring Click board™, equipped with the Amplified Basic Pressure sensor series (ABP), which features a ratiometric analog output, which is proportional to the applied pressure.

[Learn More]