ADAC 2 Click Board
ADAC 2 Click Board
Key Features:
- High accuracy, flexibility, software-configurable for voltage and current mode, high resolution, RTD and thermocouple measurements, SPI interface, additional GPIOs, protection features, and more
- Based on the MAX22000 - industrial-grade, software-configurable analogue input/output solution from Analog Devices
- Can be used for industrial applications such as programmable logic controllers (PLCs), programmable automation controllers (PACs), and process control applications
- mikroBUS: SPI Interface
The ADAC 2 Click Board™ is a compact add-on board providing the ADC/DAC combo solution. This board features the MAX22000, a 24-bit ADC, an 18-bit DAC, and an analogue front-end (AFE) from Analog Devices. It allows users to create a software-configurable (SPI interface) input/output that supports all standard industrial analogue interfaces: -10V to +10V analogue input or output, -20mA to +20mA analogue input or output, as well as an RTD or thermocouple input for temperature measurement. This Click board™ is designed to support industrial applications such as programmable logic controllers (PLCs), programmable automation controllers (PACs), and process control applications that require configurable analogue I/O.
The ADAC 2 Click Board™ is supported by a mikroSDK-compliant library, which includes functions that simplify software development. This Click board™ comes as a thoroughly tested product, ready to be used on a system equipped with the mikroBUS™ socket.
Software Support
We provide a library for the ADAC 2 Click and a demo application (example), developed using MikroE compilers. The demo can run on all the main MikroE development boards.
The package can be downloaded/installed directly from NECTO Studio The package Manager(recommended), downloaded from our LibStock™ or found on the MikroE Github account.
Library Description
This library contains API for ADAC 2 Click driver.
Key functions
-
adac2_set_active_ain_channel
This function sets the active analogue input channel. -
adac2_read_voltage
This function reads RAW ADC value of the previous conversion and converts it to voltage. -
adac2_write_dac
This function sets the analogue output by writing to the AO_DATA_WR register.
Example Description
This example demonstrates the use of the ADAC 2 Click Board™ by setting the DAC output (CIO) and reading the ADC results from a single-ended channel (AI4) and from a differential channel (AI5+, AI6-) as well as toggling all GPIO pins.
void application_task ( void )
{
float voltage;
if ( ADAC2_OK == adac2_set_active_ain_channel ( &adac2, ADAC2_CH_AI4_SINGLE_ENDED ) )
{
adac2_start_conversion ( &adac2, ADAC2_DATA_RATE_450_SPS );
// Waits for the availability of the conversion result
while ( adac2_get_rdy_pin ( &adac2 ) );
adac2_stop_conversion ( &adac2 );
if ( ADAC2_OK == adac2_read_voltage ( &adac2, ADAC2_FULL_SCALE_RANGE_12p5V, &voltage ) )
{
log_printf ( &logger, " Channel AI4 single-ended: %.2f Vrn", voltage );
}
}
if ( ADAC2_OK == adac2_set_active_ain_channel ( &adac2, ADAC2_CH_AI5_AI6_DIFFERENTIAL_25V ) )
{
adac2_start_conversion ( &adac2, ADAC2_DATA_RATE_450_SPS );
// Waits for the availability of the conversion result
while ( adac2_get_rdy_pin ( &adac2 ) );
adac2_stop_conversion ( &adac2 );
if ( ADAC2_OK == adac2_read_voltage ( &adac2, ADAC2_FULL_SCALE_RANGE_25V, &voltage ) )
{
log_printf ( &logger, " Channel AI5-AI6 differential: %.2f Vrn", voltage );
}
}
static int32_t dac = ADAC2_DAC_MIN_VALUE;
if ( ADAC2_OK == adac2_write_dac ( &adac2, dac ) )
{
log_printf ( &logger, " DAC: %ldrn", dac );
dac += 5000;
if ( dac > ADAC2_DAC_MAX_VALUE )
{
dac = ADAC2_DAC_MIN_VALUE;
}
}
uint32_t gpio_data;
if ( ADAC2_OK == adac2_read_register ( &adac2, ADAC2_REG_GEN_GPIO_CTRL, &gpio_data ) )
{
gpio_data ^= ADAC2_GPIO_ALL_MASK;
if ( ADAC2_OK == adac2_write_register ( &adac2, ADAC2_REG_GEN_GPIO_CTRL, gpio_data ) )
{
log_printf ( &logger, " GPIO: 0x%.2Xrnn", ( uint16_t ) ( gpio_data & ADAC2_GPIO_ALL_MASK ) );
}
}
Delay_ms ( 1000 );
}
The complete application code and ready-to-use projects can be installed directly from NECTO Studio, The package Manager(recommended), downloaded from our LibStock™ or found on the MikroE Github account.
Other MikroE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.ADAC2
Additional Notes and Information
Depending on the development board you are using, you may need USB UART Click Board™, 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 MikroE compilers.
MIKROSDK
The ADAC 2 Click Board™ is supported with mikroSDK - MikroE Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
ADAC 2 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.