DocID025202 Rev 7
340/1080
RM0365
Analog-to-digital converters (ADC)
392
ongoing regular sequence and the associated delay phases are ignored.
There is the same behavior for regular sequences occurring on the slave ADC.
Regular simultaneous mode with independent injected
This mode is selected by programming bits DUAL[4:0] = 00110.
This mode is performed on a regular group of channels. The external trigger source comes
from the regular group multiplexer of the master ADC (selected by the EXTSEL[3:0] bits in
the ADCx_CFGR register). A simultaneous trigger is provided to the slave ADC.
In this mode, independent injected conversions are supported. An injection request (either
on master or on the slave) will abort the current simultaneous conversions, which are re-
started once the injected conversion is completed.
Note:
Do not convert the same channel on the two ADCs (no overlapping sampling times for the
two ADCs when converting the same channel).
In regular simultaneous mode, one must convert sequences with the same length or ensure
that the interval between triggers is longer than the longer conversion time of the 2
sequences. Otherwise, the ADC with the shortest sequence may restart while the ADC with
the longest sequence is completing the previous conversions.
Software is notified by interrupts when it can read the data:
•
At the end of each conversion event (EOC) on the master ADC, a master EOC interrupt
is generated (if EOCIE is enabled) and software can read the ADCx_DR of the master
ADC.
•
At the end of each conversion event (EOC) on the slave ADC, a slave EOC interrupt is
generated (if EOCIE is enabled) and software can read the ADCx_DR of the slave
ADC.
•
If the duration of the master regular sequence is equal to the duration of the slave one
(like in
), it is possible for the software to enable only one of the two EOC
interrupt (ex: master EOC) and read both converted data from the Common Data
register (ADCx_CDR).
It is also possible to read the regular data using the DMA. Two methods are possible:
•
Using two DMA channels (one for the master and one for the slave). In this case bits
MDMA[1:0] must be kept cleared.
–
Configure the DMA master ADC channel to read ADCx_DR from the master. DMA
requests are generated at each EOC event of the master ADC.
–
Configure the DMA slave ADC channel to read ADCx_DR from the slave. DMA
requests are generated at each EOC event of the slave ADC.
•
Using MDMA mode, which leaves one DMA channel free for other uses:
–
Configure MDMA[1:0]=0b10 or 0b11 (depending on resolution).
–
A single DMA channel is used (the one of the master). Configure the DMA master
ADC channel to read the common ADC register (ADCx_CDR)
–
A single DMA request is generated each time both master and slave EOC events
have occurred. At that time, the slave ADC converted data is available in the
upper half-word of the ADCx_CDR 32-bit register and the master ADC converted
data is available in the lower half-word of ADCx_CCR register.
–
both EOC flags are cleared when the DMA reads the ADCx_CCR register.