TOP Contributors

  1. MIKROE (2752 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (139067 times)
  2. FAT32 Library (71594 times)
  3. Network Ethernet Library (56989 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29777 times)
  8. mikroSDK (27874 times)
  9. PID Library (26858 times)
  10. microSD click (26129 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 9 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.18

mikroSDK Library: 2.0.0.0

Category: ADC

Downloaded: 306 times

Not followed.

License: MIT license  

ADC 9 Click is 8th channel analog to digital converter expansion board, for projects where you have demand for multi channel ADC conversion such as microcontrollers with small number or none analog inputs. This Click board is based on MCP3564 a 24-bit Delta-Sigma Analog-to-Digital Converter with programmable data rate of up to 153.6 ksps from Microchip.

No Abuse Reported

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

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

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

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


ADC 9 Click

ADC 9 Click is 8th channel analog to digital converter expansion board, for projects where you have demand for multi channel ADC conversion such as microcontrollers with small number or none analog inputs. This Click board is based on MCP3564 a 24-bit Delta-Sigma Analog-to-Digital Converter with programmable data rate of up to 153.6 ksps from Microchip.

adc9_click.png

Click Product page


Click library

  • Author : MikroE Team
  • Date : jun 2020.
  • Type : SPI type

Software Support

We provide a library for the Adc9 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 form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for Adc9 Click driver.

Standard key functions :

  • Config Object Initialization function.

    void adc9_cfg_setup ( adc9_cfg_t *cfg );

  • Initialization function.

    ADC9_RETVAL adc9_init ( adc9_t ctx, adc9_cfg_t cfg );

  • Click Default Configuration function.

    void adc9_default_cfg ( adc9_t ctx, adc9_rw_t rw );

Example key functions :

  • Function is used to check if an interrupt has occured.

    uint8_t adc9_irq_pin_state ( adc9_t *ctx );

  • Function is used to read ADC value when the default fata format is applied.

    uint8_t adc9_read_def_adc ( adc9_t ctx, adc9_rw_t rw, int32_t *rd_data );

  • Function is used to calculate voltage based on ADC values.

    float adc9_volt_calc ( adc9_t *ctx, int32_t adc_val, uint16_t v_ref, uint8_t gain );

Examples Description

This Click is 8th channel analog to digital converter expansion board, usefull for projects where we have demand for multi channel ADC conversion such as microcontrollers with small number or none analog inputs. It offers integrated features, such as internal oscillator, temperature sensor and burnout sensor detection, in order to reduce system component count and total solution cost.

The demo application is composed of two sections :

Application Init

Initalizes SPI driver, resets and starts the device, and makes an initial log.


void application_init ( void )
{
    log_cfg_t log_cfg;
    adc9_cfg_t cfg;

    /** 
     * 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.

    adc9_cfg_setup( &cfg );
    ADC9_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    uint8_t err_flag = adc9_init( &adc9, &cfg );
    if ( ADC9_INIT_ERROR == err_flag )
    {
        log_info( &logger, "---- Error Init ----" );
        for ( ; ; );
    }

    adc9_default_cfg( &adc9, &adc9_rw );

    Delay_ms ( 1000 );
}

Application Task

This is an example that shows the capabilities of the ADC 9 Click by calculating voltage level based on ADC from channels 0(positive) and 1(negative), and logs the result.


void application_task ( void )
{
    measurement_init( &adc9, &adc9_rw );

    while ( adc9_irq_pin_state( &adc9 ) );

    adc9_rw.reg = ADC9_DEVICE_ADR;
    adc9_read_def_adc ( &adc9, &adc9_rw, &adc_value );

    log_printf( &logger, "ADC Value : %ld\r\n" , adc_value );

    m_volts = adc9_volt_calc ( &adc9, adc_value, VREF, 1 );
    log_printf( &logger, "Voltage in milivolts : %.2f\r\n", m_volts );

    log_printf( &logger, "------------------------\r\n" );
    Delay_ms ( 1000 );
}

Note

Depending on the VOLT SEL jumper position on the Click board the user needs to set VREF macro value (mV) in the code.

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Adc9

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

SRAM 3 click

5

SRAM 3 Click is a 1Mb serial SRAM with a non-volatile SONOS storage element included with each memory cell, organized as 128k words of 8 bits each. This board features the ANV32AA1WDK66 a SRAM memory from Anvo-System Dresden.

[Learn More]

Analog Key Click

0

Analog Key Click is an analog keyboard on a Click board. It contains six tactile pushbuttons, used to select one of six different voltage levels. The idea behind this Click is very simple: six resistors form a voltage divider.

[Learn More]

Accel 15 Click

0

Accel 15 Click is a compact add-on board that contains a longevity acceleration sensor. This board features the BMA490L, a high-performance 16-bit digital triaxial acceleration sensor with extended availability of up to ten years from Bosch Sensortech. It allows selectable full-scale acceleration measurements in ranges of ±2g, ±4g, ±8g, and ±16g in three axes with a configurable host interface that supports both I2C and SPI serial communication and with intelligent on-chip motion-triggered interrupt features. Intelligent signal processing and evaluation in the accelerometer ASIC enables advanced gesture recognition for numerous industrial IoT applications where low power consumption is vital. This Click board™ is suitable for home appliances, power tools, and other industrial products whose lifetime is essential.

[Learn More]