TOP Contributors

  1. MIKROE (2779 codes)
  2. Alcides Ramos (376 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 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 (139558 times)
  2. FAT32 Library (72028 times)
  3. Network Ethernet Library (57254 times)
  4. USB Device Library (47606 times)
  5. Network WiFi Library (43219 times)
  6. FT800 Library (42549 times)
  7. GSM click (29930 times)
  8. mikroSDK (28291 times)
  9. PID Library (26930 times)
  10. microSD click (26308 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

ADC 26 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-12-18

Package Version: 2.1.0.1

mikroSDK Library: 2.0.0.0

Category: ADC

Downloaded: 4 times

Not followed.

License: MIT license  

ADC 26 Click is a compact add-on board for precise analog-to-digital signal conversion. This board features the ADS1015L, a low-power 12-bit ADC with an I2C-compatible interface from Texas Instruments. The ADS1015L features a ΔΣ ADC core with an internal voltage reference, programmable gain amplifier (PGA), and digital comparator, capable of measuring differential signals with a flexible input range from ±0.256V to ±6.144V at up to 3300 samples per second (SPS). It supports single-shot and continuous-conversion modes, offering both energy efficiency and real-time performance.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "ADC 26 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "ADC 26 Click" changes.

Do you want to report abuse regarding "ADC 26 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


ADC 26 Click

ADC 26 Click is a compact add-on board for precise analog-to-digital signal conversion. This board features the ADS1015L, a low-power 12-bit ADC with an I2C-compatible interface from Texas Instruments. The ADS1015L features a ΔΣ ADC core with an internal voltage reference, programmable gain amplifier (PGA), and digital comparator, capable of measuring differential signals with a flexible input range from ±0.256V to ±6.144V at up to 3300 samples per second (SPS). It supports single-shot and continuous-conversion modes, offering both energy efficiency and real-time performance.

adc26_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Sep 2024.
  • Type : I2C type

Software Support

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

Standard key functions :

  • adc26_cfg_setup Config Object Initialization function.

    void adc26_cfg_setup ( adc26_cfg_t *cfg );
  • adc26_init Initialization function.

    err_t adc26_init ( adc26_t *ctx, adc26_cfg_t *cfg );
  • adc26_default_cfg Click Default Configuration function.

    err_t adc26_default_cfg ( adc26_t *ctx );

Example key functions :

  • adc26_start_conversion This function starts a single-shot conversion for the selected MUX channel and gain level (full-scale range).

    err_t adc26_start_conversion ( adc26_t *ctx, uint8_t mux, uint8_t pga );
  • adc26_get_alert_pin This function returns the ALERT (data ready) pin logic state.

    uint8_t adc26_get_alert_pin ( adc26_t *ctx );
  • adc26_read_voltage This function reads the RAW ADC measurement and converts it to a voltage level.

    err_t adc26_read_voltage ( adc26_t *ctx, float *voltage );

Example Description

This example demonstrates the use of ADC 26 Click board by reading and displaying the voltage levels from IN0-IN1 differential and IN2-IN3 single-ended analog input channels.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the Click default configuration.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    adc26_cfg_t adc26_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.
    adc26_cfg_setup( &adc26_cfg );
    ADC26_MAP_MIKROBUS( adc26_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == adc26_init( &adc26, &adc26_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( ADC26_ERROR == adc26_default_cfg ( &adc26 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

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

Application Task

Reads the voltage levels from IN0-IN1 differential (+/- 2.048V) and IN2-IN3 single-ended (+/- 4.096V) analog input channels and displays the results on the USB UART once per second approximately.

void application_task ( void )
{
    float voltage = 0;
    if ( ADC26_OK == adc26_start_conversion ( &adc26, ADC26_MUX_P_AIN0_N_AIN1, ADC26_PGA_2_048V ) )
    {
        while ( adc26_get_alert_pin ( &adc26 ) ); // Waits for a data ready indication

        if ( ADC26_OK == adc26_read_voltage ( &adc26, &voltage ) )
        {
            log_printf ( &logger, " Voltage between IN0[P] and IN1[N]: %.3f V\r\n", voltage );
        }
    }
    if ( ADC26_OK == adc26_start_conversion ( &adc26, ADC26_MUX_P_AIN2_N_GND, ADC26_PGA_4_096V ) )
    {
        while ( adc26_get_alert_pin ( &adc26 ) ); // Waits for a data ready indication

        if ( ADC26_OK == adc26_read_voltage ( &adc26, &voltage ) )
        {
            log_printf ( &logger, " Voltage between IN2 and GND: %.3f V\r\n", voltage );
        }
    }
    if ( ADC26_OK == adc26_start_conversion ( &adc26, ADC26_MUX_P_AIN3_N_GND, ADC26_PGA_4_096V ) )
    {
        while ( adc26_get_alert_pin ( &adc26 ) ); // Waits for a data ready indication

        if ( ADC26_OK == adc26_read_voltage ( &adc26, &voltage ) )
        {
            log_printf ( &logger, " Voltage between IN3 and GND: %.3f V\r\n\n", voltage );
        }
    }
    Delay_ms ( 1000 );
}

Note

Do not apply more than VCC + 0.3 V to the analog inputs of the device.

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

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

Headphone AMP 3 Click

0

Headphone AMP 3 Click is a compact add-on board that contains a stereo headphone amplifier. This board features the INA1620, a high-fidelity audio operational amplifier with integrated thin-film resistors and EMI filters from Texas Instruments. Over its dual amplifiers, it achieves a very low noise density and drives a 32Ω load at 150mW of output power.

[Learn More]

Thermostat 3 Click

0

Thermostat 3 Click is a general-purpose thermostat Click board™ designed to be used with any temperature sensor based on the MAX31855 sensor design.

[Learn More]

DAC 8 Click

0

DAC 8 Click is a compact add-on board that contains a fully-featured, general-purpose voltage-output digital-to-analog converter.

[Learn More]