We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2024-10-31
Package Version: 2.1.0.4
mikroSDK Library: 2.0.0.0
Category: ADC
Downloaded: 91 times
Not followed.
License: MIT license
ADC 24 Click is a compact add-on board for high-speed analog to digital conversion. This board features the AD7490, a 12-bit, 16-channel successive approximation ADC from Analog Devices, optimized for efficient power usage with a consumption of just 2.5mA from a 5V supply while achieving up to 1MSPS throughput rates. The board features 16 single-ended analog inputs with a configurable input range, supported by a channel sequencer for sequential channel conversion and multiple operational modes for flexible power management. This makes ADC 24 Click ideal for extensive system monitoring applications such as multichannel system monitoring, power line monitoring, data acquisition, instrumentation, and process control, serving various industrial and tech applications.
Do you want to subscribe in order to receive notifications regarding "ADC 24 Click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "ADC 24 Click" changes.
Do you want to report abuse regarding "ADC 24 Click".
DOWNLOAD LINK | RELATED COMPILER | CONTAINS |
---|---|---|
5578_adc_24_click.zip [540.91KB] | mikroC AI for ARM GCC for ARM Clang for ARM mikroC AI for PIC mikroC AI for PIC32 XC32 GCC for RISC-V Clang for RISC-V mikroC AI for AVR mikroC AI for dsPIC XC16 |
|
ADC 24 Click is a compact add-on board for high-speed analog to digital conversion. This board features the AD7490, a 12-bit, 16-channel successive approximation ADC from Analog Devices, optimized for efficient power usage with a consumption of just 2.5mA from a 5V supply while achieving up to 1MSPS throughput rates. The board features 16 single-ended analog inputs with a configurable input range, supported by a channel sequencer for sequential channel conversion and multiple operational modes for flexible power management. This makes ADC 24 Click ideal for extensive system monitoring applications such as multichannel system monitoring, power line monitoring, data acquisition, instrumentation, and process control, serving various industrial and tech applications.
We provide a library for the ADC 24 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.
This library contains API for ADC 24 Click driver.
adc24_cfg_setup
Config Object Initialization function.
void adc24_cfg_setup ( adc24_cfg_t *cfg );
adc24_init
Initialization function.
err_t adc24_init ( adc24_t *ctx, adc24_cfg_t *cfg );
adc24_get_voltage
This function reads the results of 12-bit ADC raw data and converts them to proportional voltage levels by using the SPI serial interface.
err_t adc24_get_voltage ( adc24_t *ctx, adc24_ctrl_t ctrl, uint8_t *in_pos, float *voltage );
adc24_get_adc_data
This function reads a conversion result and selected channel by using the SPI serial interface.
err_t adc24_get_adc_data ( adc24_t *ctx, adc24_ctrl_t ctrl, uint8_t *in_pos, uint16_t *adc_data );
This example demonstrates the use of the ADC 24 Click board by reading and writing data by using the SPI serial interface and reading results of AD conversion.
The demo application is composed of two sections :
Initialization of SPI module and log UART.
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
adc24_cfg_t adc24_cfg; /**< Click config object. */
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
adc24_cfg_setup( &adc24_cfg );
ADC24_MAP_MIKROBUS( adc24_cfg, MIKROBUS_1 );
if ( SPI_MASTER_ERROR == adc24_init( &adc24, &adc24_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
ctrl.ch_sel = ADC24_CH_SEL_IN_0;
ctrl.pm = ADC24_PM_NORMAL;
ctrl.seq_shadow = ADC24_SEQ_SHADOW_AN_INPUT;
ctrl.weak = ADC24_WEAK_DOUT_THREE_STATE;
ctrl.range = ADC24_RANGE_VREF_5V;
ctrl.coding = ADC24_CODING_BIN;
log_info( &logger, " Application Task " );
log_printf( &logger, "_____________\r\n" );
}
The demo application reads the voltage levels from all 15 analog input channels and displays the results. Results are being sent to the UART Terminal, where you can track their changes.
void application_task ( void )
{
uint8_t ch_pos = 0;
float voltage = 0;
for ( uint8_t n_cnt = ADC24_CH_SEL_IN_0; n_cnt <= ADC24_CH_SEL_IN_15; n_cnt++ )
{
ctrl.ch_sel = n_cnt;
if ( ADC24_OK == adc24_get_voltage( &adc24, ctrl, &ch_pos, &voltage ) )
{
log_printf( &logger, " IN%u : %.3f V\r\n", ( uint16_t ) ch_pos, voltage );
}
Delay_ms ( 100 );
}
log_printf( &logger, "_____________\r\n" );
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:
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.