TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 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 (139250 times)
  2. FAT32 Library (71746 times)
  3. Network Ethernet Library (57118 times)
  4. USB Device Library (47429 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42403 times)
  7. GSM click (29835 times)
  8. mikroSDK (28074 times)
  9. PID Library (26885 times)
  10. microSD click (26198 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

SPI Isolator 2 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.12

mikroSDK Library: 2.0.0.0

Category: SPI

Downloaded: 188 times

Not followed.

License: MIT license  

SPI Isolator 2 Click is a compact add-on board that contains a digital isolator optimized for a serial peripheral interface. This board features the ISO7741, a high-performance quad-channel digital isolator with a double capacitive silicon dioxide insulation barrier capable of galvanic isolation up to 5000Vrms from Texas Instruments. The ISO7741 provides high electromagnetic immunity and low emissions at low power consumption while isolating digital I/Os. It has three forward and one reverse-direction channel with enable pins that can be used to put the respective outputs in Hi-Z state. This Click board™ provides a simple, compact solution for isolated SPI data communication.

No Abuse Reported

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

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

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

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


SPI Isolator 2 Click

SPI Isolator 2 Click is a compact add-on board that contains a digital isolator optimized for a serial peripheral interface. This board features the ISO7741, a high-performance quad-channel digital isolator with a double capacitive silicon dioxide insulation barrier capable of galvanic isolation up to 5000Vrms from Texas Instruments. The ISO7741 provides high electromagnetic immunity and low emissions at low power consumption while isolating digital I/Os. It has three forward and one reverse-direction channel with enable pins that can be used to put the respective outputs in Hi-Z state. This Click board™ provides a simple, compact solution for isolated SPI data communication.

spiisolator2_click.png

Click Product page


Click library

  • Author : Jelena Milosavljevic
  • Date : Jul 2021.
  • Type : SPI type

Software Support

We provide a library for the SPIIsolator2 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for SPIIsolator2 Click driver.

Standard key functions :

  • spiisolator2_cfg_setup Config Object Initialization function.

    void spiisolator2_cfg_setup ( spiisolator2_cfg_t *cfg );
  • spiisolator2_init Initialization function.

    err_t spiisolator2_init ( spiisolator2_t *ctx, spiisolator2_cfg_t *cfg );

Example key functions :

  • spiisolator2_output_enable The function enable or disable output ( isolation ) of the ISO7741DWR High-Speed, Robust-EMC Reinforced and Basic Quad-Channel Digital Isolators on SPI Isolator 2 Click board.

    void spiisolator2_output_enable( spiisolator2_t *ctx, uint8_t en_out );
  • spiisolator2_set_cmd The function sends the desired command to the ISO7741DWR High-Speed, Robust-EMC Reinforced and Basic Quad-Channel Digital Isolators on SPI Isolator 2 Click board.

    void spiisolator2_set_cmd ( spiisolator2_t *ctx, uint8_t cmd );
  • spiisolator2_write_byte The function writes the byte of data to the targeted 8-bit register address of the ISO7741DWR High-Speed, Robust-EMC Reinforcedand Basic Quad-Channel Digital Isolators on SPI Isolator 2 Click board.

    void spiisolator2_write_byte ( spiisolator2_t *ctx, uint8_t reg, uint8_t tx_data );

Example Description

This is an example that demonstrates the use of the SPI Isolator 2 Click board. This board uses the ISO7741 which provides high electromagnetic immunity and low emissions at low power consumption while isolating digital I/Os. In this example, we write and then read data from the connected EEPROM 5 Click to the SPI Isolator 2 click board.

The demo application is composed of two sections :

Application Init

Initializes SPI, set RST and CS pin as outputs, begins to write log, set write/read memory address, enable output.


void application_init ( void ) 
{
    log_cfg_t log_cfg;                         /**< Logger config object. */
    spiisolator2_cfg_t spiisolator2_cfg;       /**< Click config object. */

    /** 
     * 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.
    spiisolator2_cfg_setup( &spiisolator2_cfg );
    SPIISOLATOR2_MAP_MIKROBUS( spiisolator2_cfg, MIKROBUS_1 );
    if ( SPI_MASTER_ERROR == spiisolator2_init( &spiisolator2, &spiisolator2_cfg ) ) 
    {        
        log_error( &logger, " Application Init Error. \r\n" );
        log_info( &logger, " Please, run program again... \r\n" );
        for ( ; ; );
    }
    Delay_ms ( 100 );

    spiisolator2_output_enable( &spiisolator2, SPIISOLATOR2_OUT_ENABLE );
    log_info( &logger, " Application Task " );
    Delay_ms ( 100 );
}

Application Task

Enables write to EEPROM, then writes the specified text message, and reads it back. All data is being displayed on the USB UART where you can track the program flow.


void application_task ( void ) 
{
    spiisolator2_set_cmd( &spiisolator2, SPIISOLATOR2_EEPROM5_CMD_WREN );
    Delay_ms ( 10 );

    spiisolator2_multi_write( &spiisolator2, 
                              ( ( uint32_t ) SPIISOLATOR2_EEPROM5_CMD_WRITE << 24 ) | memory_address, 4, demo_data, 7 );
    log_printf( &logger," Write data : %s\r\n", demo_data );
    log_printf( &logger, "- - - - - - - - - - -\r\n" );
    Delay_ms ( 100 );

    spiisolator2_multi_read( &spiisolator2, 
                             ( ( uint32_t ) SPIISOLATOR2_EEPROM5_CMD_READ << 24 ) | memory_address, 4, read_data, 7 );
    Delay_ms ( 1000 );

    log_printf( &logger, " Read data  : %s\r\n", read_data );
    log_printf( &logger, "---------------------\r\n" );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.SPIIsolator2

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

eINK 2.13 inch display

0

eINK click is an adapter Click boardâ„¢, used to interface a compatible eINK display with the host MCU.

[Learn More]

Speed Sense Click

0

Speed Sense Click is a compact add-on board that allows you to measure the speed and rotation of a spinning object. This board features the A17501, a dual output differential speed and direction sensor from Allegro Microsystems. It has a high-speed switching bandwidth of up to 40kHz for two different signals. The sensor has two independent output channels with options for high-resolution XOR speed, pulse, and direction protocol.

[Learn More]

VCP Monitor 2 Click

0

VCP Monitor 2 Click is a three-channel, high-side current and bus voltage monitor with alert indication function ensuring the intended application works within desired operating conditions. Featured chip INA3221-Q1, by Texas Instruments, monitors both shunt voltage drops and bus supply voltages, in addition to having programmable conversion times and averaging modes for these signals.

[Learn More]