TOP Contributors

  1. MIKROE (2662 codes)
  2. Alcides Ramos (357 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 (137032 times)
  2. FAT32 Library (70162 times)
  3. Network Ethernet Library (56033 times)
  4. USB Device Library (46355 times)
  5. Network WiFi Library (41970 times)
  6. FT800 Library (41299 times)
  7. GSM click (29079 times)
  8. mikroSDK (26518 times)
  9. PID Library (26452 times)
  10. microSD click (25448 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 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.11

mikroSDK Library: 2.0.0.0

Category: ADC-DAC

Downloaded: 84 times

Not followed.

License: MIT license  

AD-SWIO Click is a quad-channel software configurable input/output solution based on AD74412R. The AD74412R is a quad-channel software configurable input/output integrated circuit for building and process control applications.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "AD SWIO click" changes.

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

Do you want to report abuse regarding "AD SWIO click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


AD SWIO click

AD-SWIO Click is a quad-channel software configurable input/output solution based on AD74412R. The AD74412R is a quad-channel software configurable input/output integrated circuit for building and process control applications.

adswio_click.png

click Product page


Click library

  • Author : MikroE Team
  • Date : jun 2020.
  • Type : SPI type

Software Support

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

Standard key functions :

  • Config Object Initialization function.

    void adswio_cfg_setup ( adswio_cfg_t *cfg );

  • Initialization function.

    ADSWIO_RETVAL adswio_init ( adswio_t ctx, adswio_cfg_t cfg );

  • Click Default Configuration function.

    void adswio_default_cfg ( adswio_t *ctx );

Example key functions :

  • This function checks the status of the ready pin.

    uint8_t adswio_status_pin_ready ( adswio_t *ctx );

  • This function allows user to get the converted results of the selected channel.

    adswio_err_t adswio_get_conv_results ( adswio_t ctx, uint8_t channel, uint16_t data_out );

Examples Description

This click provides a fully integrated single chip solution for input and output operation. The AD-SWIO Click contains four 13-bit DACs, one per chanal, and 16-bit Σ-∆ ADC. These options give a lot of flexibility in choosing functionality for analog output, analog input, digital input, resistance temperature detector (RTD), and thermocouple measurements integrated into a single chip solution with a serial peripheral interface (SPI)

The demo application is composed of two sections :

Application Init

Performs a hardware reset of the click board and executes a default configuration that enables channel A and sets it to measure voltage input in the range from 0V to 10V, with 4800 SPS.


void application_init ( void )
{
    log_cfg_t log_cfg;
    adswio_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.

    adswio_cfg_setup( &cfg );
    ADSWIO_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    adswio_init( &adswio, &cfg );
    Delay_ms ( 100 );

    adswio_default_cfg( &adswio );
    Delay_ms ( 1000 );

    adswio_rdy  = DUMMY;
    adswio_ch_a = DUMMY;
    adswio_res  = DUMMY;
    adswio_err  = ADSWIO_ERR_STATUS_OK;

    log_printf( &logger, " AD-SWIO click initialization done \r\n");
    log_printf( &logger, "************************************\r\n");
}

Application Task

Waits for the data ready and then reads the results of ADC conversion from channel A and if response is ok, then prints the results on the uart console.


void application_task ( void )
{
    uint16_t timeout = 0;
    do
    {
        Delay_1ms( );
        timeout++;
        adswio_rdy = adswio_status_pin_ready( &adswio );
        if ( timeout > 3000 ) 
        {
            timeout = 0;
            log_printf( &logger, " Reinitializing...");
            adswio_default_cfg( &adswio );
            log_printf( &logger, "Done\r\n");
        }
    }
    while ( adswio_rdy != 0 );

    adswio_err = adswio_get_conv_results( &adswio, ADSWIO_SETUP_CONV_EN_CHA, &adswio_ch_a );

    if ( adswio_err == ADSWIO_ERR_STATUS_OK )
    {
        adswio_res = adswio_ch_a;
        adswio_res /= ADSWIO_RANGE_RESOLUTION;
        adswio_res *= ADSWIO_RANGE_VOLT_MV;
        adswio_ch_a = adswio_res;

        log_printf( &logger, " Voltage from channel A: %d mV\r\n", adswio_ch_a );

        log_printf( &logger, "-----------------------------------\r\n\r\n" );
        Delay_ms ( 200 );
    }
}  

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.AdSwio

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

Boost 7 click

0

Boost 7 Click is a compact add-on board that steps up the voltage from its input (supply) to its output (load). This board features the BD8316GWL, a dual DC/DC converter from Rohm Semiconductor. Each converter inside the BD8316GWL is designed with up to 200mA current limit generating well-regulated positive and negative outputs of ±3.3V or ±5V, making the BD8316GWL ideal for various applications. In addition to the possibility of working with both mikroBUS™ power rails, it also provides the opportunity of using an external power supply with a very low voltage of 2.5V.

[Learn More]

AnyNet 3G-EA click

0

AnyNet 3G-EA Click is a cellular to AWS gateway device, which provides developers with the complete solution for various IoT applications, by using the AWS IoT and Cloud Storage services for the data storage, analyzing and processing. AnyNet click board™ provides a secure connection with the AWS over the air (OTA), by utilizing the Quectel UG95-EA 3G module, offering worldwide UMTS/HSPA and GSM/GPRS/EDGE coverage Eseye ES4623 embedded SIM card, that can work with more than 235 cellular operators from all over the world. An Eseye embedded sim card can work with more than 235 cellular operators from all over the world. The AnyNet 3G click can be used as an AWS IoT button with almost no configuration.

[Learn More]

Thermo 7 click - Cloud demo

5

- The example contains all the necessary initializations and settings for a G2C click on a successful connection by Click Cloud. - Thermo 7 click reads ambient temperature and the temperature value is sent to the cloud by reference THERMO7_T every 1500ms.

[Learn More]