22.3.5.2 Configuring ADC Inputs in Scan Mode
In scan mode, the ADC can sample and convert up to 32 external channels on each conversion trigger. Internal channels are not avail-
able in scan mode. The ADC's scanner logic automatically changes the input mux settings between conversions, eliminating the need
for firmware intervention.
The ADC scanner logic is controlled by a set of 32 logical channels called SCANINPUTIDs. The 32 SCANINPUTIDs are arranged in
four groups of 8 channels each. Each channel group can point to a predefined series of 8 sequential channels on any of the available
APORTs. The ADCn_SCANINPUTSEL register is used to configure which group of physical APORT channels each of the SCANINPU-
TID channel groups map to. For example, selecting APORT1CH16TOCH23 in the INPUT7TO0SEL field selects APORT1CH16 for
SCANINPUTID0, APORT1CH17 for SCANINPUTID1, APORT1CH18 for SCANINPUTID2, and so on.
The four SCANINPUTID groups are fully independent and may be selected from any APORT in any combination. It is possible also to
repeat the same selection in multiple groups. For example, the user may select APORT2CH0TOCH7 for all four of the SCANINPUTID
groups.
In many cases, the user application will not require all 32 channels of the scanner to be converted. Each of the scanner channels may
be individually enabled according to the needs of the system. The ADCn_SCANMASK register is used to enable and disable individual
SCANINPUTIDs. The bits in the ADCnSCANMASK register correspond one-to-one with the SCANINPUTID channel numbers. During a
scan operation, the ADC scanner logic will convert only the enabled SCANINPUTIDs, in order from lowest to highest.
In single-ended mode, all conversions performed by the ADC will be relative to VSS. For any enabled SCANINPUTID, the selected
APORT channel will be connected to the ADC with the opposite ADC input terminal connected to VSS. Note that the channel groups
selected in ADCn_SCANINPUTSEL point to a block of 8 channels on an APORT, which includes both X and Y channels. Depending on
the channels enabled by ADCn_SCANMASK, the ADC may perform conversions on the X or the Y bus associated with that APORT.
Figure 22.6 ADC Single-ended Scan Mode Example on page 727
shows an example of a single-ended scan configuration. In this
example, ADCn_SCANINPUTSEL has been configured to place APORT1CH16TO23 in the first, third, and fourth channel groups.
APORT4CH8TO15 has been placed in the second channel group. ADCn_SCANMASK selects six of these channels for inclusion in the
scan. When an ADC scan is initiated with this configuration, the ADC begins at SCANINPUTID0 and converts each enabled channel in
turn. This scan configuration results in a set of six single-ended ADC conversions: PF0, PF3, PA5, PA5, PF7, and PF4.
SCANINPUTSEL
SCANMASK
APORT1CH16TO23
1
0
0
1
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
8
16
24
SCANINPUTID
7
15
23
31
APORT4CH8TO15
APORT1CH16TO23
APORT1CH16TO23
PF0
PF1
PF2
PF3
PF4
PF5
PF6
PF7
I/O Pin
P
A0
P
A1
P
A2
P
A3
P
A4
P
A5
none
none
PF0
PF1
PF2
PF3
PF4
PF5
PF6
PF7
PF0
PF1
PF2
PF3
PF4
PF5
PF6
PF7
APORT-Channel
1-16
1-23
1-22
1-21
1-20
1-17
1-18
1-19
1-16
1-23
1-22
1-21
1-20
1-17
1-18
1-19
1-16
1-23
1-22
1-21
1-20
1-17
1-18
1-19
4-8
4-15
4-14
4-13
4-12
4-9
4-10
4-1
1
Figure 22.6. ADC Single-ended Scan Mode Example
In differential mode, the default operation of the ADC scanner is to perform a differential measurement between the selected APORT
channel and the next channel on that APORT. For example, if the enabled SCANINPUTID points to APORT1CH6, the ADC will perform
a differential conversion between APORT1CH6 and APORT1CH7.
There are two exceptions to this rule, listed in order of precedence:
1. When converting SCANINPUTID15, the differential conversion will be performed between the channel selected by SCANINPU-
TID15 and the channel selected by SCANINPUTID8.
2. When APORTnCH31 is the selected input, the differential conversion will be performed between APORTnCH31 and APORTnCH0.
Figure 22.7 ADC Differential Scan Mode Example on page 728
shows an example of a differential scan configuration. In this example,
ADCn_SCANINPUTSEL has been configured to place APORT1CH16TO23 in the first, third, and fourth channel groups.
APORT4CH8TO15 has been placed in the second channel group. ADCn_SCANMASK selects three channels pairs for inclusion in the
scan. When an ADC scan is initiated with this configuration, the ADC begins at SCANINPUTID0 and converts each enabled channel in
turn. This scan configuration results in a set of three differential ADC conversions: PF0-PF1, PF2-PF3, and PA4-PA5.
EFM32JG1 Reference Manual
ADC - Analog to Digital Converter
silabs.com
| Smart. Connected. Energy-friendly.
Preliminary Rev. 0.6 | 727