TOP Contributors

  1. MIKROE (2751 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 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 (139050 times)
  2. FAT32 Library (71588 times)
  3. Network Ethernet Library (56988 times)
  4. USB Device Library (47326 times)
  5. Network WiFi Library (43005 times)
  6. FT800 Library (42295 times)
  7. GSM click (29754 times)
  8. mikroSDK (27873 times)
  9. PID Library (26858 times)
  10. microSD click (26129 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 Isolator 2 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.9

mikroSDK Library: 2.0.0.0

Category: I2C

Downloaded: 140 times

Not followed.

License: MIT license  

I2C Isolator 2 Click provides I2C lines and power isolation for slave devices. It carries the ADM3260 dual I2C isolator with an integrated DC-to-DC converter. I2C Isolator 2 Click is designed to run on either 3.3V or 5V power supply.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "I2C Isolator 2 Click" changes.

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

Do you want to report abuse regarding "I2C Isolator 2 Click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


I2C Isolator 2 Click

I2C Isolator 2 Click provides I2C lines and power isolation for slave devices. It carries the ADM3260 dual I2C isolator with an integrated DC-to-DC converter. I2C Isolator 2 Click is designed to run on either 3.3V or 5V power supply.

i2cisolator2_click.png

Click Product page


Click library

  • Author : MikroE Team
  • Date : May 2020.
  • Type : I2C type

Software Support

We provide a library for the I2CIsolator2 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for I2CIsolator2 Click driver.

Standard key functions :

  • i2cisolator2_cfg_setup Config Object Initialization function.

    void i2cisolator2_cfg_setup ( i2cisolator2_cfg_t *cfg ); 
  • i2cisolator2_init Initialization function.

    err_t i2cisolator2_init ( i2cisolator2_t *ctx, i2cisolator2_cfg_t *cfg );
  • i2cisolator2_enable_power This function sets PDIS pin state.

    void i2cisolator2_enable_power ( i2cisolator2_t *ctx, uint8_t state );

Example key functions :

  • i2cisolator2_write This function writes a desired data to I2C bus.

    err_t i2cisolator2_write ( i2cisolator2_t *ctx, uint8_t *data_in, uint16_t len );
  • i2cisolator2_read This function reads a desired number of data bytes from I2C bus.

    err_t i2cisolator2_read ( i2cisolator2_t *ctx, uint8_t *data_out, uint16_t len );
  • i2cisolator2_set_slave_address This function sets the slave address.

    err_t i2cisolator2_set_slave_address ( i2cisolator2_t *ctx, uint8_t slave_addr );

Examples Description

This example showcases how to initialize, configure and use the I2C Isolator 2 Click module. The Click provides I2C lines and power isolation for slave devices. In order for this example to work, you need the EEPROM 3 Click.

The demo application is composed of two sections :

Application Init

Initializes the driver and enables the power output.


void application_init ( void )
{
    log_cfg_t log_cfg;
    i2cisolator2_cfg_t cfg;

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    i2cisolator2_cfg_setup( &cfg );
    I2CISOLATOR2_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    i2cisolator2_init( &i2cisolator2, &cfg );

    i2cisolator2_enable_power( &i2cisolator2, I2CISOLATOR2_POWER_ENABLE );
    Delay_ms ( 100 );

    log_info( &logger, " Application Task " );
}

Application Task

Writes the desired message to EEPROM 3 Click board and reads it back every 2 seconds. All data is being displayed on the USB UART where you can track the program flow.


void application_task ( void )
{
    uint8_t read_buf[ 100 ] = { 0 };
    if ( I2CISOLATOR2_OK == eeprom3_write_page ( EEPROM3_MEMORY_ADDRESS, EEPROM3_DEMO_TEXT, 
                                                 strlen( EEPROM3_DEMO_TEXT ) ) )
    {
        log_printf( &logger, " Demo text message is written to EEPROM 3 Click!\r\n" );
    }
    Delay_ms ( 1000 );

    if ( I2CISOLATOR2_OK == eeprom3_read_page ( EEPROM3_MEMORY_ADDRESS, read_buf, 
                                                strlen( EEPROM3_DEMO_TEXT ) ) )
    {
        read_buf[ strlen( EEPROM3_DEMO_TEXT ) ] = 0;
        log_printf( &logger, " Read data: \"%s\"\r\n\n", read_buf );
    }
    Delay_ms ( 1000 );
}  

Note

Make sure to provide the VCC power supply on VCC pin and EEPROM 3 Click.

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.I2CIsolator2

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.


ALSO FROM THIS AUTHOR

ECG 3 Click

0

ECG 3 Click is a complete solution for ECG and HR application development, utilizing a specialized IC with a clinical-grade analog front-end (AFE). ECG 3 Click uses the MAX30003 IC, an ultra-low power, single-channel bio-sensor, which features a wide range of different options, making it an ideal solution for development of heart rate and ECG monitoring applications, fitness applications, for the ECG bio-authentication, and similar applications related to heart monitoring. ECG 3 Click is also equipped with the 3.5mm electrodes connector, making it ready to be used out of the box.

[Learn More]

4-20 mA T Click

0

This aplication changes the value of the output current

[Learn More]

Serializer Click

0

Serializer Click is a compact add-on board that contains a digital input translator/serializer. This board features the MAX31910, an eight-channel digital input serializer for high-channel density digital input modules in industrial and process automation from Analog Devices. The MAX31910 translates, conditions, and serializes the 24V digital output of sensors and switches to 5V CMOS-compatible signals required by the MCU. It provides the front-end interface circuit of a programmable logic controller (PLC) digital input module. It communicates with MCU via the SPI interface and comes in configuration with an installed digital isolator. This Click board™ is suited for various applications such as industrial, process, and building automation, digital input modules for PLCs, and more.

[Learn More]