Information
32.5 Initialization information
This section gives an example that provides some basic direction on how to initialize and
configure the ADC module. The user can configure the module for 16-bit, 12-bit, 10-bit,
or 8-bit single-ended resolution or 16-bit, 13-bit, 11-bit, or 9-bit differential resolution,
single or continuous conversion, and a polled or interrupt approach, among many other
options. Refer to Table 32-110, Table 32-111, and Table 32-112 for information used in
this example.
Note
Hexadecimal values are designated by a preceding 0x, binary
values designated by a preceding %, and decimal values have
no preceding character.
32.5.1 ADC module initialization example
32.5.1.1 Initialization sequence
Before the ADC module can be used to complete conversions, an initialization procedure
must be performed. A typical sequence is:
1. Calibrate the ADC by following the calibration instructions in Calibration function.
2. Update CFG to select the input clock source and the divide ratio used to generate
ADCK. This register is also used for selecting sample time and low-power
configuration.
3. Update SC2 to select the conversion trigger, hardware or software, and compare
function options, if enabled.
4. Update SC3 to select whether conversions will be continuous or completed only once
(ADCO) and whether to perform hardware averaging.
5. Update SC1:SC1n registers to select whether conversions will be single-ended or
differential and to enable or disable conversion complete interrupts. Also, select the
input channel which can be used to perform conversions.
Initialization information
K20 Sub-Family Reference Manual, Rev. 1.1, Dec 2012
756
Preliminary
Freescale Semiconductor, Inc.
General Business Information
