How does it work?
ADC 21 Click is based on the ADC1283, a high-performance eight-channel analog-to-digital converter from STMicroelectronics. The ADC1283 implements a successive approximation register (SAR) structure to convert analog signals into 12-bit pure binary digital outputs. The conversion circuit includes a fast settling time comparator to convey instruction into the register to store digital 0 or 1 and a redistribution DAC with logic control to have the ADC compare the track signal with a reference signal at each clock cycle.
ADC 21 Click communicates with MCU through a standard SPI interface and operates at clock rates up to 3.2MHz, for all configurations and acquiring conversion results. The AD conversion is carried out in two phases. The sampling phase conveys the input signal through the capacitance array for the first three clock cycles, and then, the evaluation phase performs the conversion into a digital 12-bit signal within 13 clock cycles. At each clock cycle of the evaluation phase, the hold signal is compared with a new value distributed by the DAC, and the result is stored in the 12-bit register, with MSB first. A complete conversion requires 16 clock cycles to generate a new 12-bit word on the SDO pin on the mikroBUS™ socket.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to use the communication lines properly. Additionally, there is a possibility for the ADC1283 analog power supply selection via jumper labeled AVCC SEL to supply the ADC1283 from an external power supply in the range from 2.7V to 5.5V or with mikroBUS™ power rails. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Specifications
Type
ADC
Applications
Can be used for the most demanding applications, from general-purpose remote data acquisition and instrumentation to industrial applications
On-board modules
ADC1283 – eight-channel analog-to-digital converter from STMicroelectronics
Key Features
Low power consumption, high accuracy, high-speed serial interface, high performance, selectable conversion rate, 12-bit SAR-based ADC, selectable analog power supply, and more
Interface
SPI
Feature
ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on ADC 21 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 |
JP1 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2 | AVCC SEL | Left | Analog Power Supply Selection VCC/VEXT: Left position VCC, Right position VEXT |
J1 | – | Populated | Analog Input Channels Header |
ADC 21 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Analog Power Supply Voltage | 2.7 | – | 5.5 | V |
Resolution | – | 12 | – | bits |
Data Rate | 50 | – | 200 | ksps |
Software Support
We provide a library for the ADC 21 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 ADC 21 Click driver.
Key functions
-
adc21_read_raw_adc
This function reads raw ADC value from the selected channel by using SPI serial interface. -
adc21_read_voltage
This function reads raw ADC value from the selected channel and converts it to proportional voltage level depending on the avcc selection.
Example Description
This example demonstrates the use of ADC 21 Click board™ by reading and displaying the voltage levels from 8 analog input channels.
void application_task ( void )
{
static uint8_t ch_num = ADC21_CHANNEL_0;
float ch_voltage;
if ( ADC21_OK == adc21_read_voltage ( &adc21, ch_num, ADC21_AVCC_3V3, &ch_voltage ) )
{
log_printf ( &logger, " CH%u voltage: %.2f Vrn", ( uint16_t ) ch_num, ch_voltage );
}
if ( ++ch_num > ADC21_CHANNEL_7 )
{
log_printf ( &logger, " ------------------------rnn" );
ch_num = ADC21_CHANNEL_0;
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.ADC21
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 Mikroe compilers.
mikroSDK
This Click board™ is supported with mikroSDK – Mikroe Software Development Kit, that needs to be downloaded from the LibStock and installed for the compiler you are using to ensure proper operation of mikroSDK compliant Click board™ demo applications.
For more information about mikroSDK, visit the official page.