Microchip® Advanced Software Framework

adc_configure.h File Reference

ADC configuration prototype definitions.

Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.

Macros

#define ADC_CALIBRATION_IN_VOLTAGE   1550
 
#define ADC_CALIBRATION_REF_VOLTAGE   1650
 

Functions

void adc_correction_start (void)
 ADC Offset and Gain mode configuration. More...
 
void adc_correction_stop (void)
 ADC Offset and Gain mode configuration. More...
 
void configure_adc (void)
 [setup] [configure_adc] More...
 
void configure_adc_averaging (void)
 ADC Averaging mode configuration. More...
 
void configure_adc_differential (void)
 ADC Differential mode configuration. More...
 
void configure_adc_sampling (void)
 ADC Oversampling mode configuration. More...
 
void configure_adc_window_monitor (void)
 ADC Window Monitoring mode configuration. More...
 

#define ADC_CALIBRATION_IN_VOLTAGE   1550

Referenced by adc_correction_start().

#define ADC_CALIBRATION_REF_VOLTAGE   1650

Referenced by adc_correction_start().

void adc_correction_start ( void  )

ADC Offset and Gain mode configuration.

This function starts the ADC correction using offset calibration and gain calibration

GLCK for ADC -> GCLK_GENERATOR_1 (8MHz) CLK_ADC -> 512 KHz REFERENCE -> 1/2 VDDANA (1.65V) POSITIVE INPUT -> PA02 NEGATIVE INPUT -> GND

References ADC_CALIBRATION_IN_VOLTAGE, ADC_CALIBRATION_REF_VOLTAGE, adc_enable(), adc_get_config_defaults(), adc_init(), adc_instance, adc_start_read_result(), correction_measures_done, and printf.

Referenced by adc_calibration().

void adc_correction_stop ( void  )

ADC Offset and Gain mode configuration.

This function disable the ADC correction for offset calibration and gain calibration

References adc_enable(), adc_get_config_defaults(), adc_init(), adc_instance, and correction_measures_done.

Referenced by adc_calibration().

void configure_adc ( void  )

[setup] [configure_adc]

[job_complete_callback]

[module_inst]

[setup]

[setup] [configure_adc]

[setup]

[setup] [configure_adc]

This function configures ADC as normal mode with below Settings

GLCK for ADC -> GCLK_GENERATOR_1 (8MHz) CLK_ADC -> 512 KHz REFERENCE -> 1/2 VDDANA (1.65V) POSITIVE INPUT -> PA02 NEGATIVE INPUT -> GND

[setup_adc_config]

[setup_adc_config]

[setup_adc_config_defaults]

[setup_adc_config_defaults]

[setup_adc_config_extra]

[setup_adc_config_extra]

[setup_adc_set_config]

[setup_adc_set_config]

[setup_adc_enable]

[setup_adc_enable]

[setup_config]

[setup_config] [setup_config_defaults]

[setup_config_defaults]

[setup_set_config]

[setup_set_config]

[setup_enable]

[setup_enable]

[setup_config]

[setup_config] [setup_config_defaults]

[setup_config_defaults]

[setup_modify_conf]

[setup_modify_conf]

[setup_set_config]

[setup_set_config]

[setup_enable]

[setup_enable]

References adc_enable(), adc_get_config_defaults(), adc_init(), adc_instance, and GCLK_GENERATOR_1.

Referenced by adc_calibration(), adc_oversampling(), and main().

void configure_adc_averaging ( void  )

ADC Averaging mode configuration.

This function configures ADC as Averaging mode with below Settings

GLCK for ADC -> GCLK_GENERATOR_1 (8MHz) CLK_ADC -> 512 KHz REFERENCE -> 1/2 VDDANA (1.65V) POSITIVE INPUT -> PA02 NEGATIVE INPUT -> GND SAMPLES -> 1024 RESULT_DIV -> 16

References adc_enable(), adc_get_config_defaults(), adc_init(), adc_instance, and GCLK_GENERATOR_1.

Referenced by adc_hardware_averaging().

void configure_adc_differential ( void  )

ADC Differential mode configuration.

This function configures ADC as differential mode with below Settings

GLCK for ADC -> GCLK_GENERATOR_1 (8MHz) CLK_ADC -> 512 KHz REFERENCE -> 1/2 VDDANA (1.65V) POSITIVE INPUT -> PA02 NEGATIVE INPUT -> PA04

References adc_enable(), adc_get_config_defaults(), adc_init(), adc_instance, and GCLK_GENERATOR_1.

Referenced by adc_differential().

void configure_adc_sampling ( void  )

ADC Oversampling mode configuration.

This function configures ADC as Oversampling mode with below Settings

GLCK for ADC -> GCLK_GENERATOR_1 (8MHz) CLK_ADC -> 512 KHz REFERENCE -> 1/2 VDDANA (1.65V) RESOLUTION -> 16 bit POSITIVE INPUT -> PA02 NEGATIVE INPUT -> GND

References adc_enable(), adc_get_config_defaults(), adc_init(), adc_instance, and GCLK_GENERATOR_1.

Referenced by adc_oversampling().

void configure_adc_window_monitor ( void  )

ADC Window Monitoring mode configuration.

This function configures ADC as Window Monitoring mode with below Settings

GLCK for ADC -> GCLK_GENERATOR_1 (8MHz) CLK_ADC -> 512 KHz REFERENCE -> 1/2 VDDANA (1.65V) POSITIVE INPUT -> PA02 NEGATIVE INPUT -> GND Threshold low level -> 0.75V Monitor mode -> Above lower threshold

References adc_enable(), adc_get_config_defaults(), adc_init(), adc_instance, and GCLK_GENERATOR_1.

Referenced by adc_window_monitor().