TOP Contributors

  1. MIKROE (2654 codes)
  2. Alcides Ramos (352 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 (136742 times)
  2. FAT32 Library (69952 times)
  3. Network Ethernet Library (55942 times)
  4. USB Device Library (46267 times)
  5. Network WiFi Library (41887 times)
  6. FT800 Library (41173 times)
  7. GSM click (28983 times)
  8. PID Library (26413 times)
  9. mikroSDK (26361 times)
  10. microSD click (25376 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 15 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.6

mikroSDK Library: 2.0.0.0

Category: ADC

Downloaded: 219 times

Not followed.

License: MIT license  

ADC 15 Click is a compact add-on board that contains a high-performance data converter. This board features the ADS131M02, a two-channel, simultaneously sampling, 24-bit, delta-sigma (ΔΣ), analog-to-digital converter from Texas Instruments. The ADC inputs can be independently configured via serial peripheral interface depending on the sensor input. A low noise, programmable gain amplifier (PGA) provides gains ranging from 1 to 128 to amplify low-level signals.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "ADC 15 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "ADC 15 click" changes.

Do you want to report abuse regarding "ADC 15 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


ADC 15 click

ADC 15 Click is a compact add-on board that contains a high-performance data converter. This board features the ADS131M02, a two-channel, simultaneously sampling, 24-bit, delta-sigma (ΔΣ), analog-to-digital converter from Texas Instruments. The ADC inputs can be independently configured via serial peripheral interface depending on the sensor input. A low noise, programmable gain amplifier (PGA) provides gains ranging from 1 to 128 to amplify low-level signals.

adc15_click.png

click Product page


Click library

  • Author : Luka Filipovic
  • Date : Sep 2021.
  • Type : SPI type

Software Support

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

Standard key functions :

  • adc15_cfg_setup Config Object Initialization function.

    void adc15_cfg_setup ( adc15_cfg_t *cfg );
  • adc15_init Initialization function.

    err_t adc15_init ( adc15_t *ctx, adc15_cfg_t *cfg );
  • adc15_default_cfg Click Default Configuration function.

    err_t adc15_default_cfg ( adc15_t *ctx );

Example key functions :

  • adc15_read_voltage Get voltage value.

    err_t adc15_read_voltage ( adc15_t *ctx, uint16_t *status, float *ch1_out, float *ch2_out );
  • adc15_set_gain Set gain for channel.

    err_t adc15_set_gain ( adc15_t *ctx, adc15_channel_t channel, adc15_gain_t gain );
  • adc15_set_word_len Set word len.

    err_t adc15_set_word_len ( adc15_t *ctx, adc15_word_t word_len );

Example Description

This example showcases ability of the click board to read adc data from 2 different channels. It's also configuratable to read data in different output rate, resolutions( word/data len ), and gain.

The demo application is composed of two sections :

Application Init

Initialization of communication modules (SPI, UART) and additional pins for control of the device. Sets default configuration, that sets gain of 1 for both channels(+/-1.2V range) and word/data length of 24bit. In the end reads device ID.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    adc15_cfg_t adc15_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.
    adc15_cfg_setup( &adc15_cfg );
    ADC15_MAP_MIKROBUS( adc15_cfg, MIKROBUS_1 );
    err_t init_flag  = adc15_init( &adc15, &adc15_cfg );
    if ( SPI_MASTER_ERROR == init_flag )
    {
        log_error( &logger, " Communication Init. " );
        log_info( &logger, " Please, run program again... " );
        for ( ; ; );
    } 

    if ( adc15_default_cfg ( &adc15 ) )
    {
        log_error( &logger, " Default configuration. " );
        for( ; ; );
    }

    uint16_t reg_val;
    adc15_reg_read( &adc15, ADC15_REG_ID, &reg_val );
    log_printf( &logger, " > ID: 0x%.4X\r\n", reg_val );

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

Application Task

Waits for data ready signal and reads voltage value of both channels, and logs read status and channel voltage level.


void application_task ( void )
{
    while ( adc15_data_ready( &adc15 ) );
    float channel1 = 0;
    float channel2 = 0;
    uint16_t status = 0;
    if ( !adc15_read_voltage( &adc15, &status, &channel1, &channel2 ) )
    {
        log_printf( &logger, " > Status: 0x%.4X\r\n", status );
        log_printf( &logger, " > V ch1: %f\r\n", channel1 );
        log_printf( &logger, " > V ch2: %f\r\n", channel2 );    
        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.ADC15

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

AudioAmp 4 click

0

AudioAmp 4 click is a low-power audio amplifier with a digital volume control. It is equipped with the LM4860, an audio amplifier IC capable of delivering up to 1W of continuous power to an 8 Ω load.

[Learn More]

Thermo click

0

Example for Thermo click board in mikroBUS form factor. It is a simple demonstration of how to read the temperature from a thermocouple. It uses MAX31855 chip for Thermocouple-to-Digital conversion. Displayed temperature is in degree Celsius.

[Learn More]

3 x Buck click

0

3xBuck click is a triple step-down (buck) converter Click board. It features three independent output terminals that can provide 1.8V, 3.3V, and 5V with the combined current output up to 3A.

[Learn More]