
EM358x
Rev. 0.4
223
To prepare the DMA channel for operation, reset it by writing the ADC_DMARST bit in the ADC_DMACFG
register, then start the DMA in either linear or auto wrap mode by setting the ADC_DMALOAD bit in the
ADC_DMACFG register. The ADC_DMAAUTOWRAP bit in the ADC_DMACFG register selects the DMA mode: 0
for linear mode, 1 for auto wrap mode.
In linear mode the DMA writes to the buffer until the number of samples given by ADC_DMASIZE has been
output. The DMA then stops and sets the INT_ADCULDFULL bit in the INT_ADCFLAG register. If another
ADC conversion completes before the DMA is reset or the ADC is disabled, the INT_ADCOVF bit in the
INT_ADCFLAG register is set.
In auto wrap mode the DMA writes to the buffer until it reaches the end, then resets its pointer to the start of
the buffer and continues writing samples. The DMA transfers continue until the ADC is disabled or the DMA is
reset.
When the DMA fills the lower and upper halves of the buffer, it sets the INT_ADCULDHALF and
INT_ADCULDFULL bits, respectively, in the INT_ADCFLAG register. The current location to which the DMA is
writing can also be determined by reading the ADC_DMACUR register.
11.1.5 ADC Configuration Register
The ADC configuration register (ADC_CFG) sets up most of the ADC operating parameters.
11.1.5.1 Input
The analog input of the ADC can be chosen from various sources. The analog input is configured with the
ADC_MUXP and ADC_MUXN bits within the ADC_CFG register. Table 11-2 shows the possible input selections.
Table 11-2. ADC Inputs
ADC_MUXn
1
Analog source at ADC
GPIO pin
Purpose
0
ADC0
PB5
1
ADC1
PB6
2
ADC2
PB7
3
ADC3
PC1
4
ADC4
PA4
5
ADC5
PA5
6
No connection
7
No connection
8
GND
Internal connection
Calibration
9
VREF/2
Internal connection
Calibration
10
VREF
Internal connection
Calibration
11
VDD_PADSA/2
Internal connection
Supply monitoring and calibration
12
No connection
13
No connection
14
No connection
15
No connection
1
Denotes bits ADC_MUXP or ADC_MUXN in register ADC_CFG.
Содержание EMBER EM358 series
Страница 2: ...EM358x 2 Rev 0 4 ...
Страница 7: ...EM358x Rev 0 4 7 ...