TOP Contributors

  1. MIKROE (2752 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139064 times)
  2. FAT32 Library (71594 times)
  3. Network Ethernet Library (56989 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29777 times)
  8. mikroSDK (27874 times)
  9. PID Library (26858 times)
  10. microSD click (26129 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

ADC 4 click

Rating:

5

Author: MIKROE

Last Updated: 2018-01-18

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: ADC

Downloaded: 6521 times

Not followed.

License: MIT license  

ADC 4 click is an advanced analog to digital multi-channel converter, which can sample inputs from 16 single-ended channels or 8 differential input channel pairs.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "ADC 4 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "ADC 4 click" changes.

Do you want to report abuse regarding "ADC 4 click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

ADC 4 Click

ADC 4 Click

Native view of the ADC 4 Click board.

View full image
ADC 4 Click

ADC 4 Click

Front and back view of the ADC 4 Click board.

View full image

Library Description

Initializes and defines GPIO port driver and driver functions which are realized for communication via SPI bus and for calculating and converting analog signal to a digital one, according to the value of the referent voltage.

Key functions

uint8_t adc4_writeReg( const uint8_t regAddress, uint8_t *value );- This function writes data in the register determined by register address parameter of the function.

uint8_t adc4_readReg( const uint8_t regAddress, uint8_t *value );- This function reads data from the register determined by register address parameter of the function.

void adc4_reset(void);- This function reset ADC 4 click.

uint8_t adc4_getErrPin(void);- This function returns the value of INT (ERROR) pin which is controlled by ERR_DAT bit in the GPIOCON register.

void adc4_getConfig( const uint8_t regAddress, uint16_t *value );- This function writes the value of the configuration registers in storage determined by pointer value.

void adc4_setConfig( const uint8_t regAddress, uint16_t value );- This function writes a 16-bit value in the configuration registers determined by register address parameter.

uint32_t adc4_getData(void);- This function checks ready bit, is data ready or not, and returns 24-bit value from the data register.

uint16_t adc4_getVoltage(void);- This function returns 16-bit calculated value and AD converted voltage value.

Examples Description

The demo application is composed of three sections:

  • System Initialization - Initializes GPIO pins (CS, INT), SPI module for communication with ADC 4 click and UART for data logging.
  • Application Initialization - Initializes ADC 4 driver and sets up working mode.
  • Application Task - (code snippet) - Sequential read of voltage. Information about the current voltage is logged to UART. Operation is repeated each second. Settings are set to calculate and convert input voltage in the range from -2.5V to 2.5V.
void applicationTask()
{
    voltage = adc4_getVoltage();

    IntToStr( voltage, text );
    mikrobus_logWrite( "Current Voltage : ", _LOG_TEXT );
    mikrobus_logWrite( text, _LOG_TEXT );
    mikrobus_logWrite( " mV", _LOG_LINE );

    Delay_ms( 1000 );
}

Other MikroElektronika libraries used in the example:

  • Conversions
  • C_String
  • SPI
  • UART

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.

ALSO FROM THIS AUTHOR

Light mix-sens Click

0

Light mix-sens Click is carrying TMD37253, an advanced proximity measurement, color sense (RGBC+IR), and digital ambient light sensing (ALS) device. The TMD37253 slim module package has been designed to accommodate a “single hole” aperture approach that incorporates an IR LED and factory calibrated LED driver. The proximity detection feature provides object detection (e.g., mobile device screen to the user’s ear) by photodiode detection of reflected IR energy (sourced by the integrated LED). The ALS detection feature provides photopic light intensity data. The color photodiodes have UV and IR blocking filters and a dedicated data converters producing 16-bit data.

[Learn More]

LED Flash click

0

LED Flash click functions as a high power LED flash, and carries the CAT3224 flash LED driver. The click is designed to run on a 5V power supply. It communicates with the target microcontroller over the following pins on the mikroBUS line: AN, RST, PWM, and INT.

[Learn More]

6DOF IMU 3 click

5

The 6 DOF IMU 3 Click is a Click board equipped with the FXOS8700CQ 6-axis sensor with integrated linear accelerometer and magnetometer.

[Learn More]