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 (137084 times)
  2. FAT32 Library (70228 times)
  3. Network Ethernet Library (56097 times)
  4. USB Device Library (46429 times)
  5. Network WiFi Library (42047 times)
  6. FT800 Library (41382 times)
  7. GSM click (29110 times)
  8. mikroSDK (26558 times)
  9. PID Library (26487 times)
  10. microSD click (25486 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 19 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.10

mikroSDK Library: 2.0.0.0

Category: ADC

Downloaded: 96 times

Not followed.

License: MIT license  

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.

No Abuse Reported

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

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

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

  • Information
  • Comments (0)

mikroSDK Library Blog


ADC 19 click

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.

adc19_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Mar 2022.
  • Type : SPI type

Software Support

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

Standard key functions :

  • adc19_cfg_setup Config Object Initialization function.

    void adc19_cfg_setup ( adc19_cfg_t *cfg );
  • adc19_init Initialization function.

    err_t adc19_init ( adc19_t *ctx, adc19_cfg_t *cfg );

Example key functions :

  • adc19_set_vref This function sets the voltage reference value that will be used for voltage calculation.

    void adc19_set_vref ( adc19_t *ctx, float vref );
  • adc19_set_input_channel This function sets the selected input channel active by modifying the control register.

    err_t adc19_set_input_channel ( adc19_t *ctx, uint8_t input_ch );
  • adc19_get_voltage This function reads the voltage from the previously selected channel by using SPI serial interface.

    err_t adc19_get_voltage ( adc19_t *ctx, float *voltage );

Example Description

This example demonstrates the use of ADC 19 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 logger and sets the ADC voltage reference.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    adc19_cfg_t adc19_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.
    adc19_cfg_setup( &adc19_cfg );
    ADC19_MAP_MIKROBUS( adc19_cfg, MIKROBUS_1 );
    if ( SPI_MASTER_ERROR == adc19_init( &adc19, &adc19_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    adc19_set_vref ( &adc19, ADC19_VREF_3V3 );

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

Application Task

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

void application_task ( void )
{
    float voltage;
    if ( ADC19_OK == adc19_set_input_channel ( &adc19, ADC19_INPUT_CHANNEL_1 ) )
    {
        if ( ADC19_OK == adc19_get_voltage ( &adc19, &voltage ) )
        {
            log_printf ( &logger, " IN1 : %.3f V \r\n", voltage );
        }
    }
    if ( ADC19_OK == adc19_set_input_channel ( &adc19, ADC19_INPUT_CHANNEL_2 ) )
    {
        if ( ADC19_OK == adc19_get_voltage ( &adc19, &voltage ) )
        {
            log_printf ( &logger, " IN2 : %.3f V \r\n\n", voltage );
        }
    }
    Delay_ms ( 500 );
}

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

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

Stepper 7 click

0

Stepper 7 click is a bipolar step motor driver. It features an H-bridge bipolar step motor driver, which supports full and half step control modes. Stepper 7 click also carries a port expander so that the communication can be done with a minimal number of pins, through the mikroBUS™ SPI bus.

[Learn More]

WiFi 11 click

5

WiFi 11 Click is a compact add-on board that contains a WiFi and Bluetooth module that has dual bands for WiFi communication. This board features the BW16, a single-chip low-power dual bands Wireless LAN (WLAN) and Bluetooth Low Energy SoC module from Shenzhen B&amp;amp;T Technologies Co., Ltd.

[Learn More]

OOK TX click

0

OOK TX click is a simple wireless transmitter that operates at the frequency of 433MHz (sub-GHz). This device allows realization of a simple, low-speed wireless ad-hoc communication network between a transmitter and compatible receiver, such as the OOK RX click.

[Learn More]