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: 2018-02-27
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: ADC
Downloaded: 5917 times
Not followed.
License: MIT license
ADC 6 click is an advanced 24bit multichannel analog to digital converter (ADC), with 8 fully differential or 15 single ended/pseudo differential sampling inputs, and very flexible routing capabilities.
Do you want to subscribe in order to receive notifications regarding "ADC 6 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "ADC 6 click" changes.
Do you want to report abuse regarding "ADC 6 click".
Library Description
Initializes and defines SPI bus driver and driver functions witch offer a choice to convert analog input voltage to 24-bit digital output value. Functions also offer a choice to choose witch channels we want use for positive and negative analog input by writting in configurations registers. Functions can read converted data in two modes, single read, where we must be sure that converting is done, or continuous read mode, where we only continuously read converted data without writting anything on SPI, not even an data register address. Library also defines commands witch help us to configure registers. Check documentation for more details.
Key functions :
void adc6_writeReg( const uint8_t register_address, const uint32_t transfer_data ) - Function writes data to determined register.
uint32_t adc6_readReg( const uint8_t register_address ) - Function reads data from determined register.
uint32_t adc6_continuousReadData( void ) - Function continuously reads data from Data register without writting anything on SPI.
uint32_t adc6_getADCData( const uint8_t mode ) - Function gets data from Data register in two possible modes. In single read mode first checks ready bit, and when conversion is done (data is ready) reads data from register. In continuous read mode only reads data without writting anything on SPI bus.
Examples Description
The application is composed of three sections :
void applicationTask() { adc_value = adc6_getADCData( _ADC6_SINGLE_GET_DATA_MODE ); LongWordToStr( adc_value, text ); if ( tmp ) { mikrobus_logWrite( "** The ADC value is: **", _LOG_LINE ); tmp = 0; } mikrobus_logWrite( text, _LOG_LINE ); Delay_ms( 500 ); }
Other mikroE Libraries used in the example:
Additional notes and information
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.