isoadc6  2.1.0.0
Main Page

ISO ADC 6 click

PRVIH_PAR_RECENICA_SA_PRODUCT_PAGE_DA_ISPRATE_CELINU

[click Product page](CLICK_PRODUCT_PAGE_LINK)


Click library

  • Author : Nenad Filipovic
  • Date : Sep 2023.
  • Type : SPI type

Software Support

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

Standard key functions :

Example key functions :

Example Description

This example demonstrates the use of the ISO ADC 6 Click boardâ„¢ by reading and writing data by using SPI serial interface and reading results of AD conversion.

The demo application is composed of two sections :

Application Init

Initialization of SPI module and log UART. After driver initialization, the app executes a default configuration which enables channel 0, puts A0 on positive analog input and A1 on negative analog input, enables internal reference voltage (approximately 2.65V (AVDD = 3.3V)), and also enables bipolar operation mode and puts device on full power mode.

void application_init ( void )
{
log_cfg_t log_cfg;
isoadc6_cfg_t isoadc6_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
isoadc6_cfg_setup( &isoadc6_cfg );
ISOADC6_MAP_MIKROBUS( isoadc6_cfg, MIKROBUS_1 );
if ( SPI_MASTER_ERROR == isoadc6_init( &isoadc6, &isoadc6_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( ISOADC6_ERROR == isoadc6_default_cfg ( &isoadc6 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}

Application Task

The demo application reads the voltage levels from analog input (A0-A1) and displays the results. Results are being sent to the UART Terminal, where you can track their changes.

void application_task ( void )
{
float voltage = 0;
if ( ISOADC6_OK == isoadc6_get_voltage( &isoadc6, &voltage ) )
{
log_printf( &logger, " Voltage: %.3f [V]\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.ISOADC6

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.


ISOADC6_OK
@ ISOADC6_OK
Definition: isoadc6.h:487
isoadc6_t
ISO ADC 6 Click context object.
Definition: isoadc6.h:446
isoadc6_cfg_setup
void isoadc6_cfg_setup(isoadc6_cfg_t *cfg)
ISO ADC 6 configuration object setup function.
isoadc6_get_voltage
err_t isoadc6_get_voltage(isoadc6_t *ctx, float *voltage)
ISO ADC 6 get voltage level function.
application_task
void application_task(void)
Definition: main.c:70
isoadc6_get_adc_data
err_t isoadc6_get_adc_data(isoadc6_t *ctx, uint32_t *adc_data)
ISO ADC 6 get ADC data function.
isoadc6_cfg_t
ISO ADC 6 Click configuration object.
Definition: isoadc6.h:463
isoadc6_init
err_t isoadc6_init(isoadc6_t *ctx, isoadc6_cfg_t *cfg)
ISO ADC 6 initialization function.
isoadc6_set_adc_control
err_t isoadc6_set_adc_control(isoadc6_t *ctx, uint16_t adc_ctrl)
ISO ADC 6 set ADC control function.
ISOADC6_ERROR
@ ISOADC6_ERROR
Definition: isoadc6.h:488
ISOADC6_MAP_MIKROBUS
#define ISOADC6_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: isoadc6.h:432
application_init
void application_init(void)
Definition: main.c:34
isoadc6_default_cfg
err_t isoadc6_default_cfg(isoadc6_t *ctx)
ISO ADC 6 default configuration function.