Initialization Information; Adc Module Initialization Example - NXP Semiconductors MKL27Z128VFM4 Reference Manual

Table of Contents

Advertisement

23.6 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. For
information used in this example, refer to
Hexadecimal values are designated by a preceding 0x, binary
values designated by a preceding %, and decimal values have
no preceding character.

23.6.1 ADC module initialization example

23.6.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
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.
Freescale Semiconductor, Inc.
Table
Note
KL27 Sub-Family Reference Manual , Rev. 5, 01/2016
Chapter 23 Analog-to-Digital Converter (ADC)
23-8,
Table
23-9, and
Calibration
Table
23-10.
function.
381

Advertisement

Table of Contents
loading

Table of Contents