User manual
mikroC PRO for dsPIC
MikroElektronika
271
ADCx_Init_Advanced
Prototype
// dsPIC30F and PIC24FJ prototype
void ADC1_Init_Advanced(unsigned Reference);
// dsPIC33FJ and PIC24HJ prototype
void ADCx_Init_Advanced(unsigned ADCMode, unsigned Reference);
Description This routine congures the internal ADC module to work with user dened settings.
Parameters - ADCMode: resolution of the ADC module.
- Reference: voltage reference used in ADC process.
Returns Nothing.
Requires - MCU with built-in ADC module.
- ADC library routines require you to specify the module you want to use. To select the
desired ADC module, simply change the letter x in the routine prototype for a number
from 1 to 2.
Example
ADC1_Init_Advanced(_ADC_10bit, _ADC_INTERNAL_REF); // sets ADC
module in 12-bit resolution mode with internal reference used
Notes - Number of ADC modules per MCU differs from chip to chip. Please, read the appropriate
datasheet before utilizing this library.
- Not all MCUs support advanced conguration. Please, read the appropriate datasheet
before utilizing this library.
Description Predened library const
ADC mode:
10-bit resolution _ADC_10bit
12-bit resolution _ADC_12bit
Voltage reference
Internal voltage reference _ADC_INTERNAL_REF
External voltage reference _ADC_EXTERNAL_REF