User manual

242
mikoPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
ADCx_Init_Advanced
Prototype
// dsPIC30F and PIC24FJ prototype
procedure ADC1_Init_Advanced(Reference : word);
// dsPIC33FJ and PIC24HJ prototype
procedure ADCx_Init_Advanced(ADCMode : word; Reference : word);
Description This routine congures the internal ADC module to work with user dened 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 conguration. Please, read the appropriate datasheet before utilizing
this library.
Description Predened 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