TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (387 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (120 codes)
  5. Bugz Bensce (97 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 (140168 times)
  2. FAT32 Library (72622 times)
  3. Network Ethernet Library (57643 times)
  4. USB Device Library (47957 times)
  5. Network WiFi Library (43553 times)
  6. FT800 Library (42942 times)
  7. GSM click (30140 times)
  8. mikroSDK (28670 times)
  9. PID Library (27057 times)
  10. microSD click (26552 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 10 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.11

mikroSDK Library: 2.0.0.0

Category: ADC

Downloaded: 235 times

Not followed.

License: MIT license  

ADC 10 Click is a compact add-on board that contains a high-performance data converter. This board features the ADS122U04, a 24-bit precision ΔΣ analog-to-digital converter with UART compatible interface from Texas Instruments.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "ADC 10 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "ADC 10 Click" changes.

Do you want to report abuse regarding "ADC 10 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


ADC 10 Click

ADC 10 Click is a compact add-on board that contains a high-performance data converter. This board features the ADS122U04, a 24-bit precision ΔΣ analog-to-digital converter with UART compatible interface from Texas Instruments.

adc10-click.png

Click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Dec 2020.
  • Type : UART type

Software Support

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

Standard key functions :

  • adc10_cfg_setup Config Object Initialization function.

    void adc10_cfg_setup ( adc10_cfg_t *cfg );
  • adc10_init Initialization function.

    err_t adc10_init ( adc10_t *ctx, adc10_cfg_t *cfg );
  • adc10_default_cfg Click Default Configuration function.

    void adc10_default_cfg ( adc10_t *ctx );

Example key functions :

  • adc10_start_sync ADC 10 Start the synchronization function.

    void adc10_start_sync ( adc10_t *ctx );
  • adc10_get_ch_output ADC 10 Get the channel output function.

    int32_t adc10_get_ch_output ( adc10_t *ctx, uint8_t sel_ch );
  • adc10_calc_voltage ADC 10 Calculate the voltage function.

    float adc10_calc_voltage ( adc10_t *ctx, int32_t adc_data, float vref, uint8_t gain );

Examples Description

This is an example that demonstrates the use of the ADC 10 Click board.

The demo application is composed of two sections :

Application Init

Initialization driver enables - UART, select analog input channel 0, perform a hardware and software reset and set the default device configuration, also, write a log.


void application_init ( void ) {
    log_cfg_t log_cfg;      /**< Logger config object. */
    adc10_cfg_t adc10_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_printf( &logger, "\r\n-------------------------\r\n" );
    log_info( &logger, " Application Init " );

    // Click initialization.

    adc10_cfg_setup( &adc10_cfg );
    ADC10_MAP_MIKROBUS( adc10_cfg, MIKROBUS_1 );
    err_t init_flag  = adc10_init( &adc10, &adc10_cfg );
    if ( init_flag == UART_ERROR ) {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }

    select_ch = ADC10_ANALOG_INPUT_CH_3;

    // Hardware reset.

    adc10_hw_reset( &adc10 );
    Delay_ms ( 100 );

    // Software reset.

    adc10_reset( &adc10 );
    Delay_ms ( 1000 );

    // Click default configuration.

    adc10_default_cfg ( &adc10 );
    log_info( &logger, " Application Task " );
    Delay_ms ( 100 );
}

Application Task

In this example, we monitor and display 24-bits of data ( from 0 to 8388607 ) of ADC and voltage ( from 0 mV to 2048 mV ) on the selected channel ( CH-0, CH-1, CH-2 or CH-3 ). Results are being sent to the Usart Terminal where you can track their changes. All data logs write on USB uart changes approximately for every 1 sec.


void application_task ( void ) {   
    adc10_start_sync( &adc10 );
    Delay_ms ( 1 );

    while ( adc10_check_drdy( &adc10 ) == ADC10_NEW_DATA_NOT_READY );

    out_data = adc10_get_ch_output( &adc10, select_ch );
    log_printf( &logger, "-------------------------\r\n" );
    log_printf( &logger, "  ADC CH-%u : %.0f\r\n", ( uint16_t ) select_ch, ( float ) out_data );

    voltage = adc10_calc_voltage( &adc10, out_data, ADC10_VREF_INTERNAL, ADC10_GAIN_1 );
    log_printf( &logger, "  Voltage  : %.2f mV\r\n", voltage );
    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.Adc10

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

MCP2518FD click

5

MCP2518FD Click is a compact add-on board representing a complete CAN solution used as a control node in a CAN network. This board features the MCP2518FD, an external CAN FD controller with an SPI interface, and a high-speed CAN transceiver, the ATA6563, both from Microchip. The ATA6563, a low-level physical layer IC (PHY), provides a physical connection with the CAN bus itself, while the CAN controller MCP2518FD represents an interface between the MCU and the PHY. It features three operating modes with dedicated fail-safe features, remote wake-up via CAN, and ideally passive behavior when powered off on the CAN bus. This Click boardâ„¢ is suitable for developing a wide range of automotive diagnostic applications, even on MCUs that do not natively support CAN interface.

[Learn More]

FT click

5

FT Click is a compact smart transceiver add-on board that helps you add a Free Topology (FT) interface to any host board with the mikroBUS socket.

[Learn More]

Fan 2 Click

0

Fan 2 Click carries the MAX31760 precision fan-speed controller. It can measure temperature and adjust the fan speed to keep the temperature at the same level. Fan 2 Click can also control two fans at the same time.

[Learn More]