TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (91 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 (139266 times)
  2. FAT32 Library (71755 times)
  3. Network Ethernet Library (57128 times)
  4. USB Device Library (47432 times)
  5. Network WiFi Library (43092 times)
  6. FT800 Library (42408 times)
  7. GSM click (29835 times)
  8. mikroSDK (28101 times)
  9. PID Library (26886 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

DAQ Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.13

mikroSDK Library: 2.0.0.0

Category: ADC

Downloaded: 250 times

Not followed.

License: MIT license  

DAQ Click is a compact add-on board representing a data acquisition solution. This board features the ADAQ7768-1, a 24-bit precision data acquisition (DAQ) μModule system that encapsulates signal conditioning, conversion, and processing blocks into one SiP from Analog Devices. It supports a fully differential input signal with a maximum voltage range of ±12V with an excellent common-mode rejection ratio (CMRR). The input signal is fully buffered with a low input bias current, enabling the ADAQ7768-1 to interface to sensors with high output impedance directly.

No Abuse Reported

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

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

Do you want to report abuse regarding "DAQ Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


DAQ Click

DAQ Click is a compact add-on board representing a data acquisition solution. This board features the ADAQ7768-1, a 24-bit precision data acquisition (DAQ) μModule system that encapsulates signal conditioning, conversion, and processing blocks into one SiP from Analog Devices. It supports a fully differential input signal with a maximum voltage range of ±12V with an excellent common-mode rejection ratio (CMRR). The input signal is fully buffered with a low input bias current, enabling the ADAQ7768-1 to interface to sensors with high output impedance directly.

daq_click.png

Click Product page


Click library

  • Author : Luka Filipovic
  • Date : Jun 2021.
  • Type : SPI type

Software Support

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

Standard key functions :

  • daq_cfg_setup Config Object Initialization function.

    void daq_cfg_setup ( daq_cfg_t *cfg );
  • daq_init Initialization function.

    err_t daq_init ( daq_t *ctx, daq_cfg_t *cfg );
  • daq_default_cfg Click Default Configuration function.

    err_t daq_default_cfg ( daq_t *ctx );

Example key functions :

  • daq_set_gain Set gain range.

    err_t daq_set_gain ( daq_t *ctx, daq_gain gain );
  • daq_read_data Reading adc data.

    err_t daq_read_data ( daq_t *ctx, int32_t *adc_data );
  • daq_calculate_voltage Convert data from raw ADC to voltage.

    void daq_calculate_voltage ( daq_t *ctx, int32_t adc_data, float *voltage );

Example Description

This example showcases ability of the device to read ADC data and calculate voltage for set configuration.

The demo application is composed of two sections :

Application Init

Initialization of communication modules (SPI, UART) and additional pins for controling device. Resets device and then configures default configuration and sets read range by setting gain to +-12V. In the end reads vendor and device ID to confirm communication.


void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    daq_cfg_t daq_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.
    daq_cfg_setup( &daq_cfg );
    DAQ_MAP_MIKROBUS( daq_cfg, MIKROBUS_1 );
    err_t init_flag  = daq_init( &daq, &daq_cfg );
    if ( SPI_MASTER_ERROR == init_flag ) 
    {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }

    if ( daq_default_cfg ( &daq ) ) 
    {
        log_error( &logger, " Default configuration. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }

    uint8_t id = 0;
    daq_generic_read( &daq, DAQ_REG_VENDOR_H, &id, 1 );
    log_printf( &logger, " > Vendor: \t0x%.2X", ( uint16_t )id );
    daq_generic_read( &daq, DAQ_REG_VENDOR_L, &id, 1 );
    log_printf( &logger, "%.2X\r\n", ( uint16_t )id );
    daq_generic_read( &daq, DAQ_REG_PRODUCT_ID_H, &id, 1 );
    log_printf( &logger, " > ID: \t\t0x%.2X", ( uint16_t )id );
    daq_generic_read( &daq, DAQ_REG_PRODUCT_ID_L, &id, 1 );
    log_printf( &logger, "%.2X\r\n", ( uint16_t )id );
    Delay_ms ( 1000 );

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

Application Task

Reads ADC data and calculates voltage from it, every 0.3 seconds.


void application_task ( void ) 
{
    int32_t adc_data = 0;
    float voltage = 0.0;
    daq_read_data( &daq, &adc_data );
    daq_calculate_voltage( &daq, adc_data, &voltage );

    log_printf( &logger, " > Data: %ld\r\n", adc_data );
    log_printf( &logger, " > Voltage: %.2f\r\n", voltage );
    log_printf( &logger, "***********************************\r\n" );
    Delay_ms ( 300 );  
}

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

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

MCP2003B Click

0

MCP2003B Click is a compact add-on board with a physical interface to automotive and industrial LIN systems compliant with the LIN Bus Specification Revision 2.2, SAE J2602, and ISO 17987. This board features the MCP2003B, a LIN transceiver from Microchip. The LIN, which stands for a Local Interconnect Network, is used in conjunction with the CAN interface for communication between the components inside of vehicles. The MCP2003B is a bi-directional half-duplex LIN transceiver that supports baud rates up to 20Kbaud with a LIN-compatible output driver. According to the standard on which this LIN transceiver works, connecting up to 15 peripheral devices to a single controller device is possible.

[Learn More]

Pressure 10 Click

0

Pressure 10 Click features a digital interface barometric pressure sensor, based on piezoresistive bridge, labeled as HSPPAD042A, from ALPS Electric. It can use both SPI and I2C communication protocols, allowing it to be interfaced with a broad range of MCUs. Besides the pressure readings, this Click board™ also offers very accurate temperature reading, which is required for the pressure readings compensation and can be used in a wide range of battery-powered and portable applications thanks to its very low power consumption.

[Learn More]

Expand 9 Click

0

Expand 9 Click is a compact add-on board that contains a multi-port I/O expander. This board features the SX1509QB, the world’s lowest voltage level shifting GPIO expander from Semtech Corporation. The SX1509QB comes in a 16-channel configuration and allows easy serial expansion of I/O through a standard I2C serial interface. It also has a built-in level shifting feature making it highly flexible in power supply systems where communication between incompatible I/O voltages is required, an integrated LED driver for enhanced lighting, and a keypad scanning engine to implement keypad applications up to 8x8 matrix.

[Learn More]