How to use expansion board based on the stsafe-a110 secure element (14 pages)
Summary of Contents for ST STM32
Page 1
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.
AN3116 Independent modes Independent modes Single-channel, single conversion mode 1.1.1 Description 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.
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.
AN3116 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.
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.
AN3116 Dual modes Dual modes 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.
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 (t) and i (t), should be computed. Figure 8 shows how to measure a power using the two ADCs in dual regular simultaneous mode.
AN3116 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.
= 1.5 cycles (T × f , 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 max) is 1.2 k.
AN3116 Dual modes With T = 13.5 cycles, the maximum allowed impedance of the source (R ) is 19 k. Since the source has an impedance R = 10 k < 19 k the impedance condition is respected. With a single ADC and with T = 1.5 (corresponding to 1.2 k), the impedance condition is not satisfied.
Dual modes AN3116 Dual combined regular/injected simultaneous mode 2.5.1 Description 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.
AN3116 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.
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.
AN3116 Revision history Revision history Table 1. Document revision history Date Revision Changes 02-Mar-2010 Initial release. Doc ID 16840 Rev 1 17/18...
Page 18
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.
Need help?
Do you have a question about the STM32 and is the answer not in the manual?
Questions and answers