March 2013 DocID023897 Rev 1 1/24
AN4195
Application note
STM32F30x ADC modes and application
Introduction
This application note presents an overview of the ADC peripherals in the STM32F30x
microcontroller families, and explains how to use the various modes and specific features of
the ADC. Its purpose is to help ADC users to understand the advanced modes offered in
STM32 microcontrollers, and to quick start development.
This document is divided into three sections:
Section 1: Comparison between ADC F1 family and F3 family describes a brief
comparison between the two ADCs of STM32 F1 and F3 family.
Section 2: Independent modes describes modes used with a single ADC.
Section 3: Dual modes describes modes that should be used with two ADCs (ADC1 and
ADC2, or ADC3 and ADC4 working jointly).
Each mode described in these sections is provided with a typical configuration procedure to
help understand how to use it.
Note: This application note does not describe the dual combined
modes.
Table 1. Applicable products
Type Part numbers
Microcontrollers STM32F30x
www.st.com
Contents
2/24 DocID023897 Rev 1
Contents
1 Comparison between ADC F1 family and F3 family . . . . . . . . . . . . . . . . 4
1.1 STM32 ADC F3 family main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.1 Using the ADC in regular conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.2 ADC channel input mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.3 Auto-Delay controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Difference between STM32ADC F1 and F3 family . . . . . . . . . . . . . . . . . . 5
2 Independent modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1 Regular conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.1 Single or multi-channel configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.2 Single or continuous conversion mode . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.3 How to use the ADC in regular conversion . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.4 Application examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2 Injected conversion mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2.1 Triggered injection mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.2 Auto-injection mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.3 Queue of context for injected conversion . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.4 Using the ADC in injected conversion . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2.5 Application examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3 Dual modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.1 Dual injected simultaneous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2 Dual regular simultaneous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.1 Using the EOC/EOS flags and interrupts . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.2 Using the DMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.3 Application example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.3 Dual interleaved mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.3.1 Using the EOC/EOS flags and interrupts . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3.2 Using the DMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3.3 Application example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.4 Dual alternate trigger mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.4.1 Application example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22