TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (392 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (123 codes)
  5. Bugz Bensce (97 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 (140544 times)
  2. FAT32 Library (73037 times)
  3. Network Ethernet Library (58043 times)
  4. USB Device Library (48215 times)
  5. Network WiFi Library (43826 times)
  6. FT800 Library (43295 times)
  7. GSM click (30359 times)
  8. mikroSDK (28990 times)
  9. PID Library (27116 times)
  10. microSD click (26722 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

AD-SWIO 3 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.5

mikroSDK Library: 2.0.0.0

Category: ADC-DAC

Downloaded: 111 times

Not followed.

License: MIT license  

AD-SWIO 3 Click is a compact add-on board representing a software configurable input/output solution for various purposes. This board features the AD74115H, a single-channel, software-configurable input and output with HART mode from Analog Devices. It provides many functionality for analog input, analog output, digital input, digital output, 2-wire, 3-wire, and 4-wire resistance temperature detector (RTD), and thermocouple measurement capability. The supply power and isolation part are managed by the ADP1034, a 3-channel isolated micropower management unit with seven digital isolators and programmable power control, also from Analog Devices.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "AD-SWIO 3 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "AD-SWIO 3 Click" changes.

Do you want to report abuse regarding "AD-SWIO 3 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


AD-SWIO 3 Click

AD-SWIO 3 Click is a compact add-on board representing a software configurable input/output solution for various purposes. This board features the AD74115H, a single-channel, software-configurable input and output with HART mode from Analog Devices. It provides many functionality for analog input, analog output, digital input, digital output, 2-wire, 3-wire, and 4-wire resistance temperature detector (RTD), and thermocouple measurement capability. The supply power and isolation part are managed by the ADP1034, a 3-channel isolated micropower management unit with seven digital isolators and programmable power control, also from Analog Devices.

adswio3_click.png

Click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Oct 2023.
  • Type : SPI type

Software Support

We provide a library for the AD-SWIO 3 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 AD-SWIO 3 Click driver.

Standard key functions :

  • adswio3_cfg_setup Config Object Initialization function.

    void adswio3_cfg_setup ( adswio3_cfg_t *cfg );
  • adswio3_init Initialization function.

    err_t adswio3_init ( adswio3_t *ctx, adswio3_cfg_t *cfg );
  • adswio3_default_cfg Click Default Configuration function.

    err_t adswio3_default_cfg ( adswio3_t *ctx );

Example key functions :

  • adswio3_get_voltage_input This function reads the raw ADC value and converts them to a proportional voltage level measured by the voltage between the I/OP and I/ON screw terminals.

    err_t adswio3_get_voltage_input ( adswio3_t *ctx, uint8_t adc_sel, float *voltage );
  • adswio3_get_diag_res This function is used to read the desired diagnostic conversion results.

    err_t adswio3_get_diag_res ( adswio3_t *ctx, uint8_t diag_sel, uint16_t *adc_diag_data );
  • adswio3_set_adc_cnv This function is used to control the ADC conversions that must be performed.

    err_t adswio3_set_adc_cnv ( adswio3_t *ctx, adswio3_adc_cnv_ctrl_t adc_cnv_ctrl );

Example Description

This library contains API for the AD-SWIO 3 Click driver for measurements of the analog output, analog input, digital input, resistance temperature detector (RTD), and thermocouple measurements.

The demo application is composed of two sections :

Application Init

Initialization of SPI and log UART. After driver initialization, the app executes a default configuration that enables and sets it to measure IOP/ION voltage input from 0V to 12V, with 4.8k SPS and enabled four diagnostics measurements (AVDD, VASS, VACC and LVIN).

void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    adswio3_cfg_t adswio3_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.
    adswio3_cfg_setup( &adswio3_cfg );
    ADSWIO3_MAP_MIKROBUS( adswio3_cfg, MIKROBUS_1 );
    if ( SPI_MASTER_ERROR == adswio3_init( &adswio3, &adswio3_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( ADSWIO3_ERROR == adswio3_default_cfg ( &adswio3 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }
    Delay_ms ( 100 );

    for ( uint8_t n_cnt = ADSWIO3_GPIO_CONFIG_SEL_A; n_cnt <= ADSWIO3_GPIO_CONFIG_SEL_D; n_cnt ++ )
    {
        if ( ADSWIO3_ERROR == adswio3_set_gpio_config( &adswio3, n_cnt, 
                                                              ADSWIO3_GPIO_CONFIG_GPO_DATA_HIGH, 
                                                              ADSWIO3_GPIO_CONFIG_GP_WK_PD_DIS, 
                                                              ADSWIO3_GPIO_CONFIG_MODE_OUT ) )
        {
            log_error( &logger, " Set GPIO configuration. " );
            for ( ; ; );
        }
        Delay_ms ( 100 );
    }

    float diag_vtg = 0;
    log_printf( &logger, "_________________________\r\n" );
    log_printf( &logger, " > Diagnostic Voltages <\r\n" );
    if ( ADSWIO3_OK == adswio3_get_diag_vtg( &adswio3, ADSWIO3_DIAG_RESULT_SEL_0, &diag_vtg ) )
    {
        log_printf( &logger, " AVDD: %.2f V\r\n", diag_vtg );
        Delay_ms ( 100 );
    }

    if ( ADSWIO3_OK == adswio3_get_diag_vtg( &adswio3, ADSWIO3_DIAG_RESULT_SEL_1, &diag_vtg ) )
    {
        log_printf( &logger, " VASS: %.2f V\r\n", diag_vtg );
        Delay_ms ( 100 );
    }

    if ( ADSWIO3_OK == adswio3_get_diag_vtg( &adswio3, ADSWIO3_DIAG_RESULT_SEL_2, &diag_vtg ) )
    {
        log_printf( &logger, " VACC: %.2f V\r\n", diag_vtg );
        Delay_ms ( 100 );
    }

    if ( ADSWIO3_OK == adswio3_get_diag_vtg( &adswio3, ADSWIO3_DIAG_RESULT_SEL_3, &diag_vtg ) )
    {
        log_printf( &logger, " LVIN: %.2f V\r\n", diag_vtg );
        Delay_ms ( 100 );
    }
    log_printf( &logger, "_________________________\r\n" );
    Delay_ms ( 1000 );
}

Application Task

This example demonstrates the use of the AD-SWIO 3 Click board. The demo application reads and displays the voltage level input, measured by the voltage between the I/OP and I/ON screw terminals and NTC thermistor temperature in degrees Celsius. Results are being sent to the UART Terminal, where you can track their changes.

void application_task ( void )
{
    float ntc_temp = 0, iop_ion_vtg = 0;
    if ( ADSWIO3_OK == adswio3_get_ntc_temp( &adswio3, ADSWIO3_DIAG_RESULT_SEL_3, &ntc_temp ) )
    {
        log_printf( &logger, " NTC Temperature: %.2f degC\r\n", ntc_temp );

        Delay_ms ( 100 );
    }

    if ( ADSWIO3_OK == adswio3_get_voltage_input( &adswio3, 0, &iop_ion_vtg ) )
    {
        log_printf( &logger, "IOP/ION Voltage: %.3f V\r\n", iop_ion_vtg );
        Delay_ms ( 100 );
    }
    log_printf( &logger, "_________________________\r\n" );
    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.ADSWIO3

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. UART terminal is available in all MikroElektronika compilers.


ALSO FROM THIS AUTHOR

NFC 5 Click

0

NFC 5 Click is a compact add-on board designed for advanced NFC applications. This board features the ST25R3918, a multipurpose NFC transceiver from STMicroelectronics. This Click board™ is built to cater to the growing needs of the Internet of Things (IoT) ecosystem, providing robust NFC reader functionalities, passive peer-to-peer communication, and card emulation modes with outstanding analog performance. Its notable features include exceptional read range with minimal power output, advanced noise reduction, and compatibility with ISO14443, ISO15693, and NFC Forum Tag types 1, 2, 4, and 5.

[Learn More]

Pedometer 3 click

6

Pedometer 3 click is a three-axis acceleration sensing Click board which utilizes the KX126-1063. An advanced tri-axis acceleration sensor, KX126-1063 includes the pedometer algorithm support.

[Learn More]

CapSense 2 Click

0

CapSense 2 Click is a compact add-on board that easily integrates projected capacitive touch into user's applications. This board features the CAP1114, a multi-channel capacitive touch sensor that takes human body capacitance as an input and directly provides the real-time sensor information via the I2C serial interface from Microchip. This board contains capacitive sensing elements, a 7-segment slider, two buttons, and four LED indicators that visually detect the activation on some of these parts. This Click board™ offers reliable and accurate sensing for any application that uses capacitive touch sensing functions.

[Learn More]