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 (139068 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 9 click

Rating:

5

Author: MIKROE

Last Updated: 2020-05-19

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: ADC

Downloaded: 2951 times

Not followed.

License: MIT license  

ADC 9 Click is based on MCP3564 a 24-bit Delta-Sigma Analog-to-Digital Converter with programmable data rate of up to 153.6 ksps from Microchip. It offer integrated features, such as internal oscillator, temperature sensor and burnout sensor detection, in order to reduce system component count and total solution cost.

No Abuse Reported

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

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

Do you want to report abuse regarding "ADC 9 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
mikroBasic 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
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic 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 ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

ADC 9 Click

ADC 9 Click

Native view of the ADC 9 Click board.

View full image
ADC 9 Click

ADC 9 Click

Front and back view of the ADC 9 Click board.

View full image

Library Description

The library covers necessary functions that enables the usage of the ADC 9 click board. User can read and write data of variable lenght and read and calculate ADC values.

Key functions:

  • uint8_t adc9_write_fast_cmd ( uint8_t dev_adr, uint8_t cmd ); - Function is used to execute fast command.
  • uint8_t adc9_read_def_adc ( uint8_t dev_adr, int32_t *rd_data ); - Function is used to read ADC value when the default fata format is applied.
  • float adc9_volt_calc ( int32_t adc_val, uint16_t v_ref, uint8_t gain ); - Function is used to calculate voltage based on ADC values.

Examples description

The application is composed of three sections :

  • System Initialization - Initializes SPI module, LOG structure, sets CS and PWM pins as output and INT pin as input.
  • Application Initialization - Initalizes SPI driver, resets and starts the device, and makes an initial log.
  • Application Task - (code snippet) This is an example that shows the capabilities of the ADC 9 click by calculating voltage level based on ADC from channels 0(positive) and 1(negative), and logs the result.
void application_task ( )
{
    mikrobus_logWrite( "Setup... ", _LOG_LINE );
    adc9_meas_init( );
    mikrobus_logWrite( "Done! ", _LOG_LINE );
    
    while ( adc9_irq_pin_state( ) )
    {
    }
    adc9_read_def_adc ( ADC9_DEVICE_ADR, &adc_value );

    LongToStr( adc_value, log_txt );
    mikrobus_logWrite( "ADC Value : ", _LOG_TEXT );
    Ltrim( log_txt );
    mikrobus_logWrite( log_txt, _LOG_LINE );
    
    m_volts = adc9_volt_calc ( adc_value, v_ref, 1 );
    FloatToStr( m_volts, log_txt );
    mikrobus_logWrite( "Voltage in milivolts : ", _LOG_TEXT );
    Ltrim( log_txt );
    mikrobus_logWrite( log_txt, _LOG_TEXT );
    mikrobus_logWrite( "mV", _LOG_LINE );

    mikrobus_logWrite( "------------------------", _LOG_LINE );
    Delay_ms( 1000 );
}

  • void adc9_meas_init ( ); Function is used to easily apply desired settings.

The full application code, and ready to use projects can be found on our LibStock page.

Other mikroE Libraries used in the example:

  • SPI
  • UART
  • Conversions

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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.Library Description

The library covers necessary functions that enables the usage of the ADC 9 click board. User can read and write data of variable lenght and read and calculate ADC values.

Key functions:

  • uint8_t adc9_write_fast_cmd ( uint8_t dev_adr, uint8_t cmd ); - Function is used to execute fast command.
  • uint8_t adc9_read_def_adc ( uint8_t dev_adr, int32_t *rd_data ); - Function is used to read ADC value when the default fata format is applied.
  • float adc9_volt_calc ( int32_t adc_val, uint16_t v_ref, uint8_t gain ); - Function is used to calculate voltage based on ADC values.

Examples description

The application is composed of three sections :

  • System Initialization - Initializes SPI module, LOG structure, sets CS and PWM pins as output and INT pin as input.
  • Application Initialization - Initalizes SPI driver, resets and starts the device, and makes an initial log.
  • Application Task - (code snippet) This is an example that shows the capabilities of the ADC 9 click by calculating voltage level based on ADC from channels 0(positive) and 1(negative), and logs the result.
void application_task ( )
{
    mikrobus_logWrite( "Setup... ", _LOG_LINE );
    adc9_meas_init( );
    mikrobus_logWrite( "Done! ", _LOG_LINE );
    
    while ( adc9_irq_pin_state( ) )
    {
    }
    adc9_read_def_adc ( ADC9_DEVICE_ADR, &adc_value );

    LongToStr( adc_value, log_txt );
    mikrobus_logWrite( "ADC Value : ", _LOG_TEXT );
    Ltrim( log_txt );
    mikrobus_logWrite( log_txt, _LOG_LINE );
    
    m_volts = adc9_volt_calc ( adc_value, v_ref, 1 );
    FloatToStr( m_volts, log_txt );
    mikrobus_logWrite( "Voltage in milivolts : ", _LOG_TEXT );
    Ltrim( log_txt );
    mikrobus_logWrite( log_txt, _LOG_TEXT );
    mikrobus_logWrite( "mV", _LOG_LINE );

    mikrobus_logWrite( "------------------------", _LOG_LINE );
    Delay_ms( 1000 );
}

  • void adc9_meas_init ( ); Function is used to easily apply desired settings.

Other mikroE Libraries used in the example:

  • SPI
  • UART
  • Conversions

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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

Cap Touch 2 click

5

Cap Touch 2 click is a capacitive touch sensing click board, with the advanced touch/proximity sensor IC, based on the proprietary RightSense technology from Microchip. Cap Touch 2 click has six touch sensitive channels and six independent LED drivers with several operating modes, including touch sensor linking.

[Learn More]

8x8 G Click

0

8x8 G Click is a 64 LED matrix display Click board™, composed of SMD LEDs organized in 8 rows by 8 columns. It has a digital brightness control in 16 steps, it can control every LED in the display matrix independently, it blanks the display on power up to eliminate glitches and it requires a single resistor to control the current through all the LEDs at once, which simplifies the design. 8x8 G Click uses a fast SPI communication protocol, allowing fast display response and no lag.

[Learn More]

Stepper 4 click

0

Stepper 4 click carries a TB67S269FTG - a two-phase bipolar stepping motor driver using a PWM chopper, with a clock in decoder built in. Rating is 50 V/2.0 A. Microstepping resolution is externally manipulated, as well as output current scaling.

[Learn More]