Mikroelektronika MIKROE-442 Datenbogen
244
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
ADCx_Init_Advanced
Prototype
‘ dsPIC30F and PIC24FJ prototype
sub procedure ADC1_Init_Advanced(dim Reference as word)
‘ dsPIC33FJ and PIC24HJprototype
sub procedureADCx_Init_Advanced(dim ADCMode as word, dim Reference as
word)
Description This routine configures the internal ADC module to work with user defined settings.
Parameters -
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 configuration. Please, read the appropriate datasheet before utilizing
this library.
Description
Predefined 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