TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 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 (137103 times)
  2. FAT32 Library (70236 times)
  3. Network Ethernet Library (56126 times)
  4. USB Device Library (46434 times)
  5. Network WiFi Library (42079 times)
  6. FT800 Library (41389 times)
  7. GSM click (29116 times)
  8. mikroSDK (26563 times)
  9. PID Library (26503 times)
  10. microSD click (25487 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: 230 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

Motion 2 click

5

Motion 2 Click is a based on EKMC1607112, PIR motion sensor from Panasonic Corporation that's used as human motion detector. Also it is featured with TLP241A photorelay from Toshiba that is used to provide a reinforced galvanic isolation for the external signals used to drive some external high power electronic equipment when motion is detected.

[Learn More]

Pressure 2 click

5

Pressure 2 click carries MS5803, a high resolution MEMS pressure sensor with an operating range from 0 to 14 bars. The module comprises a high linear pressure sensor and an ultra low power 24 bit ADC. Pressure 2 click communicates with the target board MCU either through mikroBUS SPI (CS, SCK, SDO, SDI) or I2C lines (SCL, SDA).

[Learn More]

DeviceDrive click

5

DeviceDrive Click is a complete Cloud-on-Module solution with Wi-Fi functionality and integrated PCB antenna.

[Learn More]