AN3116 Application note



Similar documents
AN3332 Application note

AN2389 Application note

BD238. Low voltage PNP power transistor. Features. Applications. Description. Low saturation voltage PNP transistor

DDSL01. Secondary protection for DSL lines. Features. Description

AN2680 Application note

EVL185W-LEDTV. 185 W power supply with PFC and standby supply for LED TV based on the L6564, L6599A and Viper27L. Features.

AN3354 Application note

BD241A BD241C. NPN power transistors. Features. Applications. Description. NPN transistors. Audio, general purpose switching and amplifier transistors

AN3998 Application note

2STBN15D100. Low voltage NPN power Darlington transistor. Features. Application. Description

TN0023 Technical note

ST High voltage fast-switching NPN power transistor. Features. Applications. Description

AN4108 Application note

ULN2801A, ULN2802A, ULN2803A, ULN2804A

Single LNB supply and control IC DiSEqC 1.X compliant with EXTM based on the LNBH29 in a QFN16 (4x4) Description

LM337. Three-terminal adjustable negative voltage regulators. Features. Description

AN2824 Application note

AN2604 Application note

AN3353 Application note

AN3265 Application note

Description. Table 1. Device summary

AN3252 Application note

SPC5-FLASHER. Flash management tool for SPC56xx family. Description. Features

ULN2001, ULN2002 ULN2003, ULN2004

BD135 - BD136 BD139 - BD140

MC Low noise quad operational amplifier. Features. Description

Description. Table 1. Device summary. Order code Temperature range Package Packaging Marking

BZW50. Transil, transient voltage surge suppressor (TVS) Features. Description

Description. IO and RF AGC. ASIC controller and power management. Carrier recovery loop. GPIO switch matrix. Lock indicator and monitoring DVBS2 FEC

UM0985 User manual. Developing your STM32VLDISCOVERY application using the IAR Embedded Workbench software. Introduction

L78MxxAB L78MxxAC. Precision 500 ma regulators. Features. Description

AN4156 Application note

AN3110 Application note

ETP01-xx21. Protection for Ethernet lines. Features. Description. Applications. Benefits. Complies with the following standards

LM134-LM234-LM334. Three terminal adjustable current sources. Features. Description

Description. Table 1. Device summary. Order codes. TO-220 (single gauge) TO-220 (double gauge) D²PAK (tape and reel) TO-220FP

LM135-LM235-LM335. Precision temperature sensors. Features. Description

STEVAL-IEG001V2. Smart real-time vehicle tracking system. Features

DSL01-xxxSC5. Secondary protection for DSL lines. Features. Description. Applications. Benefits. Complies with the following standards

ESDLIN1524BJ. Transil, transient voltage surge suppressor diode for ESD protection. Features. Description SOD323

Order code Temperature range Package Packaging

EN: This Datasheet is presented by the m anufacturer. Please v isit our website for pricing and availability at ore.hu.

AN2866 Application note

ST19NP18-TPM-I2C. Trusted Platform Module (TPM) with I²C Interface. Features

L6234. Three phase motor driver. Features. Description

M24LRxx/CR95HF application software installation guide

AN4195 Application note

UM1613 User manual. 16-pin smartcard interface ST8034P demonstration board. Introduction

Table 1. Absolute maximum ratings (T amb = 25 C) Symbol Parameter Value Unit. ISO C = 330 pf, R = 330 Ω : Contact discharge Air discharge

AN2557 Application note

STTH2R06. High efficiency ultrafast diode. Features. Description

How To Write To An Eeprom Memory On A Flash Memory On An Iphone Or Ipro Memory On Microsoft Flash Memory (Eeprom) On A Microsoft Microsoft Powerbook (Ai) 2.2.2

AN3359 Application note

STP60NF06FP. N-channel 60V Ω - 30A TO-220FP STripFET II Power MOSFET. General features. Description. Internal schematic diagram.

STP60NF06. N-channel 60V Ω - 60A TO-220 STripFET II Power MOSFET. General features. Description. Internal schematic diagram.

UA741. General-purpose single operational amplifier. Features. Applications. Description. N DIP8 (plastic package)

UM1676 User manual. Getting started with.net Micro Framework on the STM32F429 Discovery kit. Introduction

Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension

AN3270 Application note

STTH1R04-Y. Automotive ultrafast recovery diode. Features. Description

AN3990 Application note

AN2760 Application note

AN3155 Application note

STN3NF06L. N-channel 60 V, 0.07 Ω, 4 A, SOT-223 STripFET II Power MOSFET. Features. Application. Description

P6KE. Transil, transient voltage surge suppressor (TVS) Features. Description. Complies with the following standards

AN4368 Application note

AN2703 Application note

UM1790 User manual. Getting started with STM32L053 discovery kit software development tools. Introduction

Description SO-8. series. Furthermore, in the 8-pin configuration Very low-dropout voltage (0.2 V typ.)

AN4128 Application note

UM1727 User manual. Getting started with STM32 Nucleo board software development tools. Introduction

SPC5-CRYP-LIB. SPC5 Software Cryptography Library. Description. Features. SHA-512 Random engine based on DRBG-AES-128

AN4646 Application note

TDA2004R W stereo amplifier for car radio. Features. Description

UM1680 User manual. Getting started with STM32F429 Discovery software development tools. Introduction

TDA W CAR RADIO AUDIO AMPLIFIER

Obsolete Product(s) - Obsolete Product(s)

STDP2690. Advanced DisplayPort to DisplayPort (dual mode) converter. Features. Applications

STP55NF06L STB55NF06L - STB55NF06L-1

AN2658 Application note

STCS A max constant current LED driver. Features. Applications. Description

STGB10NB37LZ STGP10NB37LZ

VN05N. High side smart power solid state relay PENTAWATT. Features. Description

Obsolete Product(s) - Obsolete Product(s)

STCS1A. 1.5 A max constant current LED driver. Features. Applications. Description

AN974 APPLICATION NOTE

AN235 Application note

STTH110. High voltage ultrafast rectifier. Description. Features

MC34063AB, MC34063AC, MC34063EB, MC34063EC

STLM20. Ultra-low current 2.4 V precision analog temperature sensor. Features. Applications

STP10NK80ZFP STP10NK80Z - STW10NK80Z

LM2901. Low-power quad voltage comparator. Features. Description

STB75NF75 STP75NF75 - STP75NF75FP

VN03. ISO high side smart power solid state relay PENTAWATT. Features. Description.

STCS2A. 2 A max constant current LED driver. Features. Applications. Description

VN5R003H-E. 3 mω reverse battery protection switch. Features. Description. Application

STDP2600. Advanced HDMI to DisplayPort (dual mode) converter. Features. Applications

AN820 APPLICATION NOTE INPUT/OUTPUT PROTECTION FOR AUTOMOTIVE COMPUTER

BTW N. 50 A 1200 V non insulated SCR thyristor. Description. Features. Applications

AN438 APPLICATION NOTE SAFETY PRECAUTIONS FOR DEVELOPMENT TOOL TRIAC + MICROCONTROLLER

Transcription:

Application note STM32 s ADC modes and their applications Introduction STM32 microcontrollers have one of the most advanced ADCs on the microcontroller market. You could imagine a multitude of applications based on the STM32 ADC features. Some ADC modes are provided to simplify measurements and give efficient results in applications such as motor control. This application note provides help for ADC users to understand some advanced modes offered in the STM32 microcontrollers, and to quick start development. Each of the described modes is provided with an example of application to better understand how to use them. Most modes come with a basic firmware to make it easier to understand the ADC configuration. This application note is divided into two sections: independent modes and dual modes. The first section describes modes used with a single ADC. The second section describes modes that should be used with two ADCs (ADC1 and ADC2 working jointly). This application note does not describe the ADC modes that result from the combination of other modes. March 2010 Doc ID 16840 Rev 1 1/18 www.st.com

Contents AN3116 Contents 1 Independent modes......................................... 5 1.1 Single-channel, single conversion mode.......................... 5 1.1.1 Description................................................ 5 1.1.2 Example of application....................................... 5 1.2 Multichannel (scan), single conversion mode...................... 5 1.2.1 Description................................................ 5 1.2.2 Example of application....................................... 6 1.3 Single-channel continuous conversion mode....................... 6 1.3.1 Description................................................ 6 1.3.2 Example of applications...................................... 7 1.4 Multichannel (scan) continuous conversion mode................... 7 1.4.1 Description................................................ 7 1.4.2 Example of application....................................... 7 1.5 Injected conversion mode..................................... 7 1.5.1 Description................................................ 7 1.5.2 Example of application....................................... 8 2 Dual modes................................................ 9 2.1 Dual regular simultaneous mode................................ 9 2.1.1 Description................................................ 9 2.1.2 Example of application....................................... 9 2.2 Dual fast interleaved mode.................................... 10 2.2.1 Description............................................... 10 2.2.2 Example of application...................................... 11 2.3 Dual slow interleaved mode................................... 11 2.3.1 Description............................................... 11 2.3.2 Example of application...................................... 12 2.4 Dual alternate trigger mode................................... 13 2.4.1 Description............................................... 13 2.4.2 Example of application...................................... 13 2.5 Dual combined regular/injected simultaneous mode................ 14 2.5.1 Description............................................... 14 2.5.2 Example of application...................................... 14 2/18 Doc ID 16840 Rev 1

Contents 2.6 Dual combined: injected simultaneous + interleaved mode........... 14 2.6.1 Description............................................... 14 2.6.2 Example of application...................................... 15 3 Conclusion................................................ 16 4 Revision history........................................... 17 Doc ID 16840 Rev 1 3/18

List of figures AN3116 List of figures Figure 1. Single-channel, single conversion mode....................................... 5 Figure 2. ADC sequencer converting 7 channels with different configured sampling times................................................................... 5 Figure 3. Multichannel, single conversion mode......................................... 6 Figure 4. Single-channel, continuous conversion mode................................... 6 Figure 5. Multichannel, continuous conversion mode..................................... 7 Figure 6. Injected conversion mode................................................... 8 Figure 7. Dual regular simultaneous mode............................................. 9 Figure 8. Simultaneous measurement of voltage and current.............................. 10 Figure 9. Dual fast interleaved mode................................................. 11 Figure 10. Dual slow interleaved mode................................................ 12 Figure 11. Dual alternate trigger mode................................................ 13 Figure 12. Dual combined regular/injected simultaneous mode............................. 14 Figure 13. Dual combined: injected simultaneous + interleaved mode........................ 15 Figure 14. UPS system............................................................ 15 4/18 Doc ID 16840 Rev 1

Independent modes 1 Independent modes 1.1 Single-channel, single conversion mode 1.1.1 Description Note: This is the simplest ADC mode. In this mode, the ADC performs the single conversion (single sample) of a single channel x (refer to Figure 1.) and stops after completion of the conversion. This application note is not delivered with a firmware example of this mode. Figure 1. Single-channel, single conversion mode 1.1.2 Example of application This mode can be used for the measurement of a voltage level to decide if the system can be started or not. Measure the voltage level of the battery before starting the system: if the battery has a low level, the low battery message appears. In this case, do not start the system. 1.2 Multichannel (scan), single conversion mode 1.2.1 Description This mode is used to convert some channels successively in independent mode. With the ADC sequencer, you can use this ADC mode to configure any sequence of up to 16 channels successively with different sampling times and in different orders. You can for example carry out the sequence shown in Figure 2. In this way, you do not have to stop the ADC during the conversion process in order to reconfigure the next channel with a different sampling time. This mode saves additional CPU load and heavy software development. Figure 2. ADC sequencer converting 7 channels with different configured sampling times Note: This application note is not delivered with a firmware example of this mode. Doc ID 16840 Rev 1 5/18

Independent modes AN3116 Figure 3. Multichannel, single conversion mode 1.2.2 Example of application This mode can be used when starting a system depends on some parameters like knowing the coordinates of the arm s tip in a manipulator arm system. In this case, you have to read the position of each articulation in the manipulator arm system at power-on to determine the coordinates of the arm s tip. This mode can also be used to make single measurements of multiple signal levels (voltage, pressure, temperature, etc.) to decide if the system can be started or not in order to protect the people and equipment. It can likewise be used to convert signals coming from strain gauges to determine the directions and values of the different strains and deformations of an object. 1.3 Single-channel continuous conversion mode 1.3.1 Description Note: The single-channel continuous conversion mode converts a single channel continuously and indefinitely in regular channel conversion. The continuous mode feature allows the ADC to work in the background. The ADC converts the channels continuously without any intervention from the CPU. Additionally, the DMA can be used in circular mode, thus reducing the CPU load. An example of firmware is provided with this application note: SingleChannelContinuous. The example uses two methods: DMA and interrupts. To select either method, simply comment or uncomment #define USE_DMA_Transfer in the main.c file. Figure 4. Single-channel, continuous conversion mode 6/18 Doc ID 16840 Rev 1

Independent modes 1.3.2 Example of applications This ADC mode can be implemented to monitor a battery voltage, the measurement and regulation of an oven temperature, etc. In the case of the oven temperature regulation, the temperature is read and compared to the temperature set by the user. When the oven temperature reaches the desired temperature, the heating resistor is powered off. 1.4 Multichannel (scan) continuous conversion mode 1.4.1 Description The multichannel, or scan, continuous mode can be used to convert some channels successively with the ADC in independent mode. With the sequencer, you can configure any sequence of up to 16 channels successively with different sampling times and different orders. This mode is similar to the multichannel single conversion mode except that it does not stop converting after the last channel of the sequence but it restarts the conversion sequence from the first channel and continues indefinitely. Figure 5. Multichannel, continuous conversion mode 1.4.2 Example of application This mode can be used to monitor multiple voltages and temperatures in a multiple battery charger. The voltage and temperature of each battery are read during the charging process. When the voltage or the temperature reaches the maximum level, the corresponding battery should be disconnected from the charger. 1.5 Injected conversion mode 1.5.1 Description Note: This mode is intended for use when conversion is triggered by an external event or by software. The injected group has priority over the regular channel group. It interrupts the conversion of the current channel in the regular channel group. An example of firmware is provided with this application note: Indep_InjectedGroup. Doc ID 16840 Rev 1 7/18

Independent modes AN3116 Figure 6. Injected conversion mode 1.5.2 Example of application This mode can be used to synchronize the conversion of channels to an event. It is interesting in motor control applications where transistor switching generates noise that impacts ADC measurements and results in wrong conversions. Using a timer, the injected conversion mode can thus be implemented to delay the ADC measurements to after the transistor switching. 8/18 Doc ID 16840 Rev 1

Dual modes 2 Dual modes Note: Dual modes are available in STM32 microcontrollers that feature two ADCs: ADC1 master and ADC2 slave. ADC1 and ADC2 triggers are synchronized internally for regular and injected channel conversion. ADC1 and ADC2 work together. In some devices, there are up to 3 ADCs: ADC1, ADC2 and ADC3. In this case ADC3 always works independently, and is not synchronized with the other ADCs. Do not sample the same channel on the two ADCs at the same time, this would introduce conversion errors. 2.1 Dual regular simultaneous mode 2.1.1 Description Note: The dual regular simultaneous ADC mode is used to perform two conversions simultaneously owing to the synchronization of ADC1 and ADC2. Each ADC converts a channel sequence (with scan enabled and the sequencer of each ADC configured) or converts a single channel (scan disabled). The conversion can be started with an external trigger or by software. In this mode, the conversion results of ADC1 and ADC2 are stored in ADC1 s data register (32-bit format). Figure 7 shows how ADC1 and ADC2 convert two sequences simultaneously. ADC1 converts a sequence of 16 channels successively: channel 15 to channel 0 and ADC2 converts a sequence of 16 channels successively: channel 0 to channel 15. This application note does not provide a firmware example. However the STM32 firmware library provides an example of this mode at the following path: \Project\STM32F10x_StdPeriph_Examples\ADC\RegSimul_DualMode. Figure 7. Dual regular simultaneous mode 2.1.2 Example of application The dual regular simultaneous mode can be used in applications where two signals should be sampled and converted at the same time. For example, to measure and plot the singlephase or three-phase instantaneous electrical power: p n (t) = u n (t) i n (t). Doc ID 16840 Rev 1 9/18

Dual modes AN3116 In this case, the voltage and current should be measured simultaneously and then the instantaneous power, which is the product of u n (t) and i n (t), should be computed. Figure 8 shows how to measure a power using the two ADCs in dual regular simultaneous mode. To measure a single-phase power, ADC1 and ADC2 are used with two channels (1 channel for the voltage and 1 channel for the current). To measure a three-phase power, ADC1 and ADC2 are used with 6 channels (3 channels for the voltage and 3 channels for the current). Figure 8. Simultaneous measurement of voltage and current 2.2 Dual fast interleaved mode 2.2.1 Description The dual fast interleaved ADC mode is intended for the conversion of one channel. ADC1 and ADC2 convert the selected channel alternately with a period of 7 ADC clock cycles. This means that the channel is converted every 7 clock cycles. Each ADC converts the channel every 14 ADC clock cycles. With a 14 MHz ADC clock, it is thus possible to reach 2 Msamples per second: 14 MHz/7 = 2 MHz (sampling frequency). The conversion can be started by external trigger or by software and the conversion results of ADC1 and ADC2 are stored into ADC1 data register (32-bit format). The maximum allowed sampling time is 7 ADC clock cycles to avoid the overlap between the ADC1 and ADC2 sampling phases in the event that they convert the same channel. This means that the only allowed sampling time is 1.5 cycles. Note: 1 It is highly recommended to use DMA instead of interrupts to avoid the loss of data. 2 An example of firmware is provided with this application note: Dual_FastInterleaved. 10/18 Doc ID 16840 Rev 1

Dual modes Figure 9. Dual fast interleaved mode 2.2.2 Example of application This mode is used to speed up the sampling rate of the ADC when 2 Msamples/second are needed with 1.5 cycle of sampling time. ADC1 and ADC2 convert the same channel alternately to reduce the conversion time. While ADC1 samples channel CHx, ADC2 converts the previous sample. For example if a signal to be converted has a maximum frequency of 800 khz, the sampling rate frequency should be higher than or equal to twice the frequency of the signal to be converted (in accordance with Shannon-Nyquist criteria). Since the maximum sampling rate is 1 Msample/second with one ADC, the criteria cannot be met. This is solved by using the dual fast interleaved ADC mode. In this way, the sampling rate frequency becomes 2 Msample/second since the two ADCs (ADC1 and ADC2) work alternately and sample the signal at equal periods (7 ADC cycles). With the dual fast interleaved ADC mode, 2 Msamples/second can be achieved with 1.5 cycles of sampling time. 2.3 Dual slow interleaved mode 2.3.1 Description The dual slow interleaved ADC mode is intended for the conversion of one channel. ADC1 and ADC2 convert the selected channel alternately with a period of 14 ADC clock cycles. The channel is thus converted every 14 clock cycles. Each ADC converts the channel every 28 ADC clock cycles. The conversion can be started by external trigger or by software and the conversion results of ADC1 and ADC2 are stored into ADC1 s data register (32-bit format). The maximum allowed sampling time is 14 ADC clock cycles to avoid any overlap with the next conversion. This means that the only allowed sampling times are 1.5, 7.5 and 13.5 cycles. Continuous conversion should not be used in this mode since the ADCs would continuously convert the selected regular channel automatically (the CONT bit should not be set in this mode). Note: 1 It is highly recommended to use DMA instead of interrupts to avoid the loss of data. 2 An example of firmware is provided with this application note: Dual_SlowInterleaved. Doc ID 16840 Rev 1 11/18

Dual modes AN3116 Figure 10. Dual slow interleaved mode 2.3.2 Example of application Let us assume that the signal to be converted has a maximum frequency (f in ) of 500 khz with an impedance R AIN = 10 k. The minimum sampling rate should be 1 Msamples/second (in accordance with Shannon-Nyquist criteria). With one ADC, the only configuration is f ADC = 14 MHZ and the sampling time T s = 1.5 cycles (T s = t s f ADC, refer to the datasheet of the STM32 product you are using for more details on the sampling time vs. the source impedance). In this case, the maximum allowed impedance of the source (R AIN max) is 1.2 k. The conversion will not be accurate since R AIN > R AINmax. Solution Use the ADC in dual slow interleaved mode. Each ADC sampling should be configured to have a minimum sampling rate of 500 ksamples/second with f ADC = 14 MHz. T TotalRate = T s + T conv = t TotalRate f ADC = f ADC ----------------, where: F srate T TotalRate is the total conversion time in ADC clock cycles. t TotalRate is the sum of the sampling time t s (t s = T s /f ADC ) and the conversion time t conv (t conv = T conv /f ADC ) T conv is a constant equal to 12.5 cycles T s is the sampling time given in ADC cycles, it is equal to: T s f ADC F srate = ---------------- 12.5 = --------------------- 14 10 12.5 = 15.5 cycles 3 500 10 6, where F srate is the sampling rate frequency. Since T s = 15.5 cycles is not available for the configuration (for more details about the different available T s values, refer to the 12-bit ADC characteristics section in the datasheet of the STM32 product you are using). The nearest available value is T s = 13.5. To know whether this value meets Shannon-Nyquist criteria, we need to calculate the sampling rate with T s = 13.5 and f ADC = 14 MHz: T TotalRate = 13.5 + 12.5 = 26 cycles F srate = f ADC /T TotalRate = 14.10 6 / 26 = 538 khz per ADC Since the conversion is made with two ADCs (ADC1 + ADC2) working alternately, the sampling rate frequency is: F srate = 538 2 = 1076 khz > 2 f in, and so the Shannon- Nyquist criteria is respected. 12/18 Doc ID 16840 Rev 1

Dual modes With T s = 13.5 cycles, the maximum allowed impedance of the source (R AIN ) is 19 k. Since the source has an impedance R AIN = 10 k < 19 k the impedance condition is respected. With a single ADC and with T s = 1.5 (corresponding to 1.2 k ), the impedance condition is not satisfied. By using two ADCs, we have thus extended the impedance margin from 1.2 k to 19 k. With the dual slow interleaved ADC mode, the 1 Msamples/second sampling rate is achieved with higher input impedances. 2.4 Dual alternate trigger mode 2.4.1 Description Note: Figure 11. The dual alternate trigger ADC mode can be used only on an injected channel group. In this mode, ADC1 and ADC2 alternately convert the injected channels on the same external trigger. When the first trigger occurs, all injected group channels in ADC1 are converted. When the second trigger happens, all injected group channels in ADC2 are converted and so on. The maximum number of injected channels in the group is 4 for each ADC. An example of firmware is provided with this application note: Dual_AlternateTrigger. Dual alternate trigger mode 2.4.2 Example of application The dual alternate trigger mode makes it possible to have sampling points as close as possible to each other (down to 1.5 ADC cycles). This is interesting for instance in motor control applications, where a single-shunt sensor is used for three-phase current reading. In some cases, the PWM duty cycle of the power stage has to be limited to maintain a minimum time slot for two consecutive conversions. If the sampling points are as close as possible, the PWM duty cycle is maximized, which increases the voltage applied to the motor. Doc ID 16840 Rev 1 13/18

Dual modes AN3116 2.5 Dual combined regular/injected simultaneous mode 2.5.1 Description Note: The dual combined regular/injected simultaneous ADC mode is a regular simultaneous mode that allows injection. The injected channels are also converted simultaneously. In this mode, you should convert sequences with the same length or ensure that the interval between triggers is longer than the longest 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. An example of firmware is provided with this application note: Dual_Combined_Reg_Inj_Sumultaneous. The example uses two methods: DMA and interrupts. To select either method, simply comment or uncomment #define USE_DMA_Transfer in the main.c file. Figure 12. Dual combined regular/injected simultaneous mode 2.5.2 Example of application The dual combined (regular/injected) simultaneous mode can be used to read 3-phase currents at definite times. This mode is interesting when you read the currents of two of the phases and you determine the current of the third phase by extrapolation since there is a relationship between the currents of the 3 phases. 2.6 Dual combined: injected simultaneous + interleaved mode 2.6.1 Description This mode is the combination of the dual interleaved mode (fast or slow) and the dual injected simultaneous mode. When the regular channel is triggered, the dual interleaved conversion starts: ADC2 makes the first conversion, then ADC1 converts the channel and so on. When the injected channel is triggered, it interrupts the interleaved channel conversion and the two ADCs (ADC1 and ADC2) start converting the group of injected channels. When the two ADCs finish the injected conversion, they resume the conversion of the channel configured in interleaved mode. 14/18 Doc ID 16840 Rev 1

Dual modes Note: This application note is not delivered with a firmware example of this mode. Figure 13. Dual combined: injected simultaneous + interleaved mode 2.6.2 Example of application You can use this dual combined mode in a UPS system (uninterruptible power supply). The battery voltage is monitored with the ADC watchdog converted in dual interleaved mode. The ADC also monitors the power consumed by the load by measuring the voltage and the current in dual injected simultaneous mode. Figure 14. UPS system Doc ID 16840 Rev 1 15/18

Conclusion AN3116 3 Conclusion This application note explains some ADC modes, and provides examples of applications to make it easier to understand the presented modes. Most examples come with firmware to simplify the ADC configuration and speed up development. With the provided firmware examples, you can modify the code a little to switch from one mode to another. The STM32 s ADC has several modes intended for advanced conversion processes so as to attain efficient conversion results in applications such as motor control. DMA is a major feature and its use is recommended when possible to avoid the loss of samples and release the CPU load. 16/18 Doc ID 16840 Rev 1

Revision history 4 Revision history Table 1. Document revision history Date Revision Changes 02-Mar-2010 1 Initial release. Doc ID 16840 Rev 1 17/18

Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST s terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein. UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER S OWN RISK. Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST. ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners. 2010 STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan - Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America www.st.com 18/18 Doc ID 16840 Rev 1