adc6  2.0.0.0
Main Page

ADC 6 click

ADC 6 click is an advanced 24bit multichannel analog to digital converter (ADC), with 8 fully differential or 15 single ended/pseudo differential sampling inputs, and very flexible routing capabilities. The click board� has two 2x10 pin headers, used both to configure the device and connect the input channels.

click Product page


Click library

  • Author : MikroE Team
  • Date : Dec 2019.
  • Type : SPI type

Software Support

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

Standard key functions :

  • Config Object Initialization function.

    void adc6_cfg_setup ( adc6_cfg_t *cfg );

  • Initialization function.

    ADC6_RETVAL adc6_init ( adc6_t *ctx, adc6_cfg_t *cfg );

Example key functions :

Examples Description

This example collects data from the sensor, calculates the voltage to a digital value and then logs it.

The demo application is composed of two sections :

Application Init

Initializes driver and sets configuration witch enables apointed channel.

void application_init ( void )
{
log_cfg_t log_cfg;
// Logger initialization.
log_cfg.level = LOG_LEVEL_DEBUG;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
adc6_cfg_setup( &cfg );
ADC6_MAP_MIKROBUS( cfg, MIKROBUS_1 );
adc6_init( &adc6, &cfg );
adc6_default_cfg( &adc6 );
}

Application Task

Gets 24-bit converted data in single read mode and logs data on terminal every 500 ms.

void application_task ( void )
{
uint32_t adc_value = 0;
log_printf( &logger, "The ADC value is: %lu\r\n", adc_value );
Delay_ms( 500 );
}

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

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.


adc6_init
ADC6_RETVAL adc6_init(adc6_t *ctx, adc6_cfg_t *cfg)
Initialization function.
adc6_default_cfg
void adc6_default_cfg(adc6_t *ctx)
Click Default Configuration function.
application_task
void application_task(void)
Definition: main.c:67
ADC6_MAP_MIKROBUS
#define ADC6_MAP_MIKROBUS(cfg, mikrobus)
Definition: adc6.h:53
adc6_get_adc_data
uint32_t adc6_get_adc_data(adc6_t *ctx, const uint8_t mode)
Get data function.
adc6_cfg_setup
void adc6_cfg_setup(adc6_cfg_t *cfg)
Config Object Initialization function.
adc6_cfg_t
Click configuration structure definition.
Definition: adc6.h:389
application_init
void application_init(void)
Definition: main.c:46
ADC6_SINGLE_GET_DATA_MODE
#define ADC6_SINGLE_GET_DATA_MODE
Definition: adc6.h:358