TOP Contributors

  1. MIKROE (2642 codes)
  2. Alcides Ramos (348 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 (136229 times)
  2. FAT32 Library (69498 times)
  3. Network Ethernet Library (55712 times)
  4. USB Device Library (45997 times)
  5. Network WiFi Library (41640 times)
  6. FT800 Library (40804 times)
  7. GSM click (28789 times)
  8. PID Library (26333 times)
  9. mikroSDK (26061 times)
  10. microSD click (25148 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 16 click

Rating:

0

Author: MIKROE

Last Updated: 2024-01-31

Package Version: 2.1.0.8

mikroSDK Library: 2.0.0.0

Category: ADC

Downloaded: 90 times

Not followed.

License: MIT license  

ADC 16 Click is a compact add-on board that contains a high-performance data converter. This board features the ADS7142-Q1, a low-power two-channel 12-bit analog-to-digital converter from Texas Instruments. This I2C configurable 140kSPS successive approximation register (SAR) analog-to-digital converter (ADC) can autonomously monitor signals while maximizing system power, reliability, and performance. It implements event-triggered interrupts per channel using a digital window comparator with programmable high and low thresholds, hysteresis, and event counter.

No Abuse Reported

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

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

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

  • Information
  • Comments (0)

mikroSDK Library Blog


ADC 16 click

ADC 16 Click is a compact add-on board that contains a high-performance data converter. This board features the ADS7142-Q1, a low-power two-channel 12-bit analog-to-digital converter from Texas Instruments. This I2C configurable 140kSPS successive approximation register (SAR) analog-to-digital converter (ADC) can autonomously monitor signals while maximizing system power, reliability, and performance. It implements event-triggered interrupts per channel using a digital window comparator with programmable high and low thresholds, hysteresis, and event counter.

adc16_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Feb 2022.
  • Type : I2C type

Software Support

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

Standard key functions :

  • adc16_cfg_setup Config Object Initialization function.

    void adc16_cfg_setup ( adc16_cfg_t *cfg );
  • adc16_init Initialization function.

    err_t adc16_init ( adc16_t *ctx, adc16_cfg_t *cfg );
  • adc16_default_cfg Click Default Configuration function.

    err_t adc16_default_cfg ( adc16_t *ctx );

Example key functions :

  • adc16_single_register_write This function writes a single data to the selected register.

    err_t adc16_single_register_write ( adc16_t *ctx, uint8_t reg, uint8_t data_in );
  • adc16_single_register_read This function reads a single data from the selected register.

    err_t adc16_single_register_read ( adc16_t *ctx, uint8_t reg, uint8_t *data_out );
  • adc16_get_voltage This function reads the voltage from two analog input single-ended channels.

    err_t adc16_get_voltage ( adc16_t *ctx, float *ain0_voltage, float *ain1_voltage );

Example Description

This example demonstrates the use of ADC 16 click board by reading the voltage from the two analog input channels.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the click default configuration which sets the two analog input channels to single-ended mode.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    adc16_cfg_t adc16_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.
    adc16_cfg_setup( &adc16_cfg );
    ADC16_MAP_MIKROBUS( adc16_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == adc16_init( &adc16, &adc16_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( ADC16_ERROR == adc16_default_cfg ( &adc16 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

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

Application Task

Reads and displays the voltage from the two analog input channels on the USB UART approximately every 100ms.

void application_task ( void )
{
    float ain0_voltage, ain1_voltage;
    if ( ADC16_OK == adc16_get_voltage ( &adc16, &ain0_voltage, &ain1_voltage ) )
    {
        log_printf ( &logger, " AIN0 voltage: %.3f V \r\n", ain0_voltage );
        log_printf ( &logger, " AIN1 voltage: %.3f V \r\n\n", ain1_voltage );
        Delay_ms ( 100 );
    }
}

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

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

Flash 2 click

7

Flash 2 click is a mikroBUS add-on board for adding more Flash Memory to your target board microcontroller. It carries Microchip’s SST26VF064B flash-memory module with 64 Mbits capacity. It’s a highly reliable module with a specified minimum of 100,000 read and write cycles and with over 100 years of Data Retention.

[Learn More]

PLL click

0

PLL click is a frequency multiplier which uses the Phase-Locked Loop (PLL) techniques to provide a high-frequency clock output from a cheap, standard fundamental mode crystal oscillator.

[Learn More]

ADC 19 click

0

ADC 19 Click is a compact add-on board that contains a high-performance data converter. This board features the ADC122S101, a low-power two-channel CMOS 12-bit analog-to-digital converter from Texas Instruments. This SPI configurable analog-to-digital converter (ADC) is fully specified over a sample rate range of 500ksps to 1Msps, offering high reliability and performance. The converter is based on a successive-approximation register architecture with an internal track-and-hold circuit configurable to accept one or two input signals at its input channels.

[Learn More]