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 (139248 times)
  2. FAT32 Library (71743 times)
  3. Network Ethernet Library (57115 times)
  4. USB Device Library (47428 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42403 times)
  7. GSM click (29835 times)
  8. mikroSDK (28073 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

ADC 15 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.9

mikroSDK Library: 2.0.0.0

Category: ADC

Downloaded: 314 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

LED Driver 17 Click

0

LED Driver 17 Click is a compact add-on board that offers a simple solution for controlling multiple LEDs, making it an ideal choice for various applications. This board features the LTR3755, a highly efficient DC/DC controller from Analog Devices that operates as a constant-current source. It can easily drive high current LEDs and features onboard low-side external N-channel power MOSFETs driven from an internal regulated supply. The LED Driver 17 Click is capable of stable operation over a wide supply range and offers several LED protection features, including overvoltage and overcurrent protection. Additionally, the frequency adjust pin allows users to program the switching frequency from 100kHz to 1MHz, optimizing efficiency and performance.

[Learn More]

RS Transceiver Click

0

RS Transceiver is a compact add-on board that offers an interface between the TTL level UART and RS-232/RS-422/RS-485 communication buses. This board features the XR34350, an RS-232/RS-422/RS-485 serial transceiver with internal termination and wide output swing from MaxLinear. Integrated cable termination and four configuration modes allow all three protocols to be used interchangeably over a single cable over the DE-9 connector. All transmitter outputs and receiver inputs feature robust ESD protection and HBM up to ±15kV.

[Learn More]

TempHum 3 Click

0

Temp&Hum 3 Click is a smart environmental temperature and humidity sensor Click board™, packed with features which allow easy and simple integration into any design that requires accurate and reliable humidity and temperature measurements

[Learn More]