How does it work?
ADAC 2 Click is based on the MAX22000, an industrial-grade, software-configurable analog input/output solution from Analog Devices. It provides a high-performance 18-bit DAC in the transmit path and a 24-bit delta-sigma ADC in the receive path. The transmit path (analog output) and the receive path (analog inputs) are entirely independent; thus, they can be programmed for different configurations and modes of operation. Thanks to its outstanding performance and features, this board is designed to support various industrial applications such as programmable logic controllers (PLCs), programmable automation controllers (PACs), and process control applications that require configurable analog I/O.
This Click board™ communicates with an MCU through a standard SPI interface for all configuration and management information with a maximum frequency of 20MHz. The MAX22000 provides multiple voltages and current ranges for its inputs and outputs to maintain the best accuracy. It sets the linear range at 105% of the nominal range and the full scale at 125% of the nominal range. For example, for a ±10V nominal range, the MAX22000 provides a linear range of ±10.5V and a full-scale range of ±12.5V. Other ranges can be achieved by configuring the appropriate registers.
The MAX22000 also offers one output marked as CIO, configured as voltage or current output, alongside three analog inputs (AI4, AI5, and AI6) configurable as voltage or current inputs. Besides their use as general-purpose analog inputs, the AI5 and AI6 pins can also be configured as a differential programmable gain amplifier (PGA) for either low-voltage or high-voltage inputs to support RTD and thermocouple measurements. A high-performance filter allows the ADC to provide 50Hz/60Hz normal mode rejection at selected ADC data rates.
Current measurement using the AI5 and AI6 pins relies on an external precision resistor to perform the current-to-voltage conversion. A GPIO pin on the additional GPIO header can control an external analog switch to connect or disconnect the current sense resistor electronically for current measurements that do not use a differential sensor.
In addition, several mikroBUS™ pins are used. An active-low reset signal routed on the RST pin of the mikroBUS™ socket activates a hardware reset of the system (all registers go to their power-on default states, analog output goes high impedance, analog inputs power down, and ADC conversion stops) while the INT pin on the mikroBUS™ socket represents a standard interrupt feature providing a user with feedback information. It also has an additional data-ready interrupt marked as RDY and routed on the AN pin of the mikroBUS™ socket, used to signal when a new ADC conversion result is available in the data register.
This Click board™ can only be operated with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Specifications
Type
ADC-DAC
Applications
Can be used for industrial applications such as programmable logic controllers (PLCs), programmable automation controllers (PACs), and process control applications
On-board modules
MAX22000 – industrial-grade, software-configurable analog input/output solution from Analog Devices
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
Interface
SPI
Feature
ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on ADAC 2 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
J1 | – | Populated | Analog Input Connection Header |
J2 | – | Populated | GPIO Connection Header |
ADAC 2 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Operating Voltage Range | ±5 | – | ±24 | V |
Input Resolution | – | 24 | – | bits |
Output Resolution | – | 18 | – | bits |
Output Voltage Range | – | ±12.5 | – | V |
Output Current Range | – | ±25 | – | mA |
Software Support
We provide a library for the ADAC 2 Click as well as a demo application (example), developed using Mikroe compilers. The demo can run on all the main Mikroe development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on 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 analog input channel. -
adac2_read_voltage
This function reads RAW ADC value of previous conversion and converts it to voltage. -
adac2_write_dac
This function sets the analog output by writing to the AO_DATA_WR register.
Example Description
This example demonstrates the use of 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 full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.ADAC2
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 connect to your PC, if no UART to USB interface is available on your development board. A UART terminal is available in all Mikroe compilers.
mikroSDK
This 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.
For more information about mikroSDK, visit the official page.