AN4990 Application Note - STMicroelectronics

3y ago
53 Views
2 Downloads
1.61 MB
56 Pages
Last View : 9d ago
Last Download : 3m ago
Upload by : Kairi Hasson
Transcription

AN4990Application noteGetting started with sigma-delta digital interfaceon applicable STM32 microcontrollersIntroductionThe DFSDM (digital filter for sigma-delta modulators) is an innovative embedded peripheralavailable in a selection of STM32 microcontrollers (see Table 1: Applicable products), and isof particular interest for applications that process external analog signals.Although the DFSDM is a pure digital peripheral, it is designed to support a wide range ofexternal analog front ends. By keeping the analog front-end part (sigma-delta modulator)outside of the microcontroller, the user has total flexibility to select the analog propertiesaccording to the application requirements (analog range, noise, sampling speed).The raw converted digital data from the sigma-delta modulator is then processed by theDFSDM peripheral (digital filtering). The DFSDM configuration is flexible enough to supporta wide range of converted data properties: output data width, output data rate, outputfrequency range.From an application point of view, the DFSDM with its external analog front-end behaveslike an ADC converter. Additional functions typical of an ADC are also available within theDFSDM such as analog watchdog, extremes detector and offset correction.Reference:[TUTORIAL]In this document, [TUTORIAL] refers to a DFSDM simulator available in theform of a Microsoft Excel workbook, that can be downloaded fromwww.st.com, using home page search engine with keyword“DFSDM tutorial”.Table 1. Applicable productsTypeApplicableperimeterSeries, lines, referencesComplete Series STM32L4 Series, STM32L4 Series, STM32H7 SeriesComplete LineMarch 2018STM32F412 line, STM32F413/423 lineMicrocontrollers STM32F76xxxSTM32F765BG, STM32F765BI, STM32F765IG, STM32F765II,STM32F765NG, STM32F765NI, STM32F765VG,STM32F765VI, STM32F765ZG, STM32F765ZI,STM32F767BG, STM32F767BI, STM32F767IG, STM32F767II,STM32F767NG, STM32F767NI, STM32F767VG,STM32F767VI, STM32F767ZG, STM32F767ZI, STM32F768AI,STM32F769AG, STM32F769AI, STM32F769BG,STM32F769BI, STM32F769IG, STM32F769II, STM32F769NG,STM32F769NI, STM32F769SLSTM32F77xxxSTM32F777BI, STM32F777II, STM32F777NI, STM32F777VI,STM32F777ZI, STM32F778AI, STM32F779AI, STM32F779BI,STM32F779II, STM32F779NIAN4990 Rev 11/56www.st.com1

ContentsAN4990Contents12Overview of A/D conversion principle using DFSDM . . . . . . . . . . . . . . 61.1Fundamental concept of A/D conversion using DFSDM . . . . . . . . . . . . . . 61.2Sigma-delta modulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.3Digital filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Sigma-delta modulation principle (external analogfront-end functioning, simulations) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.1Principle of sigma-delta modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.2Advantages of sigma-delta modulation . . . . . . . . . . . . . . . . . . . . . . . . . . .112.32.42.2.1Noise shaping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2.2Linearity of A/D conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.2.3Scalable ADC resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Disadvantages of sigma-delta modulation . . . . . . . . . . . . . . . . . . . . . . . . 132.3.1Offset and gain error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.3.2Lower data rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Simulation of sigma-delta modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.4.1342/56Simulation with [TUTORIAL] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Digital filtering - principle and design . . . . . . . . . . . . . . . . . . . . . . . . . . 153.1Function description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.2Example of Sinc filter function - resolution increase . . . . . . . . . . . . . . . . . 153.3Hardware design of Sinc filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17DFSDM peripheral operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.1Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.2DFSDM components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.2.1Serial transceivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.2.2Parallel transceivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.2.3Digital filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.2.4Integrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.2.5Output data unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.2.6Analog watchdog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244.2.7Short circuit detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24AN4990 Rev 1

AN4990Contents4.2.84.34.44.5DFSDM simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254.3.1Sigma-delta modulator principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254.3.2DFSDM filtering simulation (filter and integrator) . . . . . . . . . . . . . . . . . . 264.3.3Frequency characteristics for Sinc filter . . . . . . . . . . . . . . . . . . . . . . . . . 274.3.4Noise shaping of sigma-delta modulation . . . . . . . . . . . . . . . . . . . . . . . 284.3.5High order filters operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314.3.6Delta-sigma DAC simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334.3.7High pass filter simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34Additional functions in DFSDM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354.4.1Digital microphones (MEMS) support . . . . . . . . . . . . . . . . . . . . . . . . . . 354.4.2Beamforming support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374.4.3Audio clock support – independent clock operation . . . . . . . . . . . . . . . 39DFSDM power consumption optimization . . . . . . . . . . . . . . . . . . . . . . . . 404.5.15Extremes detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Power optimization in Sleep mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40DFSDM peripheral configuration tutorial . . . . . . . . . . . . . . . . . . . . . . . 425.1Configuration introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425.2Clocks configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425.3Transceivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435.45.3.1Serial transceivers configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435.3.2Parallel transceivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475.4.1Sinc filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475.4.2Integrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495.5Analog watchdog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505.6Short circuit detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505.7Pulse skipper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515.8Configuration using [TUTORIAL] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55AN4990 Rev 13/563

AN4990Table 1.Table 2.Table 3.Table 4.4/56Applicable products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1DFSDM application examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44DFSDM analog watchdog parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55AN4990 Rev 1

AN4990List of figuresList of figuresFigure 1.Figure 2.Figure 3.Figure 4.Figure 5.Figure 6.Figure 7.Figure 8.Figure 9.Figure 10.Figure 11.Figure 12.Figure 13.Figure 14.Figure 15.Figure 16.Figure 17.Figure 18.Figure 19.Figure 20.Figure 21.Figure 22.Figure 23.Figure 24.Figure 25.Figure 26.Figure 27.Figure 28.Figure 29.Figure 30.Figure 31.Figure 32.Figure 33.A/D conversion block diagram using the DFSDM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6PWM modulation example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Sigma-delta modulation example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Sigma-delta modulation principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Sigma-delta modulator voltages timing diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Spectrum of PWM and sigma-delta modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Simulation of sigma-delta modulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Example of 3rd order filter outputs with one bit per filter length . . . . . . . . . . . . . . . . . . . . . 16Example of 3rd order filter outputs with higher density of input pulses. . . . . . . . . . . . . . . . 17Basic schematic for simple moving average implementation . . . . . . . . . . . . . . . . . . . . . . . 18Simplification of Sinc filter design - step 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Simplification of Sinc filter design - step 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Simplification of Sinc filter design - step 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Simplification of Sinc filter design - step 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Higher order Sinc filter implementation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Block diagram of DFSDM peripheral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22Sigma-delta modulator simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Filtering simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27Filter frequency characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Sigma-delta and PWM modulated signals (for frequency spectrumcomparison) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Spectrum of sigma-delta signal and PWM signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Spectrum of sigma-delta signal and PWM signalwith signal amplitude reduced to 10% of full scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31High order filters - multiple averaging principle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32First order delta-sigma DAC principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33Delta-sigma DAC simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34HP filter simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35MEMS microphone outputs (L and R channel) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36MEMS microphone connection to DFSDM (stereo support). . . . . . . . . . . . . . . . . . . . . . . . 36Beamforming principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Pulse skipping implementation for beamforming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38Pulse skipping example (FOSR 8). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Sinc filter frequency characteristic shape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48DFSDM configuration in [TUTORIAL] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53AN4990 Rev 15/565

Overview of A/D conversion principle using DFSDM1AN4990Overview of A/D conversion principle using DFSDMThis document supports Arm (a)-based devices.1.1Fundamental concept of A/D conversion using DFSDMThe basic block diagram of analog-to-digital conversion using DFSDM is provided inFigure 1.Figure 1. A/D conversion block diagram using the DFSDMSigma-Delta modulator(Σ )AnaloginputAnalogDigitizerSTM32 microcontrollerSerial lineDATACLKDFSDM1-bit datastreamMSv43870V1The external analog signal is processed by an external sigma-delta modulator whichconverts the analog signal into a digital 1-bit stream (DATA and CLK signals). The 1-bitstream is a fast serial line stream of logical ones and zeros: the DATA signal is sampled byCLK (clock signal). The average value of these logical ones and zeros, computed during along enough time duration, represents the analog input value. The duration of the averagingperiod determine the precision of the analog input signal capture.The averaging of the 1-bit stream is performed by the STM32 microcontroller DFSDMperipheral (DFSDM digital filter for sigma-delta modulators). The DFSDM acquires andprocesses the 1-bit data stream (digital filtering, averaging). The DFSDM outputs datasamples at a slower data rate than the input 1-bit stream but with a higher resolution. TheDFSDM digital filter settings define the output resolution and data rate.1.2Sigma-delta modulatorThe DFSDM peripheral requires an external analog front-end that performs the A/Dconversion of the analog source. This external analog to digital conversion is performed in asigma-delta modulator.A sigma-delta modulator consists in a 1-bit(b) A/D converter which digitizes the input analogdata into a serial digital data stream. The analog input is sampled and converted into a 1-bitdigital data stream with alternating zeros and ones. The mean value of the digital streama. Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.b. In general the output of a sigma-delta modulator can be multi-bit however in this document the focus is on a 1bit A/D converter (which is the most frequent case).6/56AN4990 Rev 1

AN4990Overview of A/D conversion principle using DFSDMcomputed during a given time interval represents the average value of the input analogsignal during the same time interval. The sigma-delta modulation principle could bepresented as a special PWM modulation where both the period and the duty cycle would bemodulated (whereas the period is fixed and only the duty cycle is modulated in a typicalPWM modulation). See Figure 2 and Figure 3 for comparison between PWM and sigmadelta modulation.The digital data stream outputting the sigma-delta modulator is then processed by theSTM32 microcontroller DFSDM peripheral. The DFSDM performs a digital filtering usingparameters that need to be configured according the application requirements.Note:For analysis, the digital stream is usually “converted” from binary 0 and binary 1 weights into 1 and -1 weights for comparison with input voltages cleared of any DC component. Thezero input voltage generates duty cycle 50:50 (first order sigma-delta modulator is used).Figure 2. PWM modulation example1.5originalPWM modulated10.50-0.5-1-1.5MSv43871V1AN4990 Rev 17/5655

Overview of A/D conversion principle using DFSDMAN4990Figure 3. Sigma-delta modulation example1.5originalSigma-delta modulated10.50-0.5-1-1.5MSv43872V11.3Digital filterThe DFSDM peripheral (digital filter for sigma-delta modulators) processes the digital part ofthe A/D conversion. The digital data stream is provided by an external sigma-deltamodulator. The basic functionality of the DFSDM is to implement a digital filter. The DFSDMprocessing consists in averaging a fast rate input serial stream and producing a parallel,lower rate, data output with higher resolution. The DFSDM embedded filter features a set ofconfigurable parameters that allow to tune the output resolution and data rate and meet theapplication requirements.The DFSDM features additional ADC-related functionalities including:8/56 Independent fast watchdog on each channel with programmable speed and resolutionto detect input signals exceeding minimal or maximal allowed voltage levels. Break signal generation used to instantaneously report events like analog watchdog orshort circuit detection to other peripherals (timers). Short circuit detector on each channel for very fast detection of signal clamping: wheninput voltage reaches one of the analog range limits and stays steady in excess of agiven time duration (independent from the main conversion). Extreme detector to record minimal and maximal input voltage excursion.AN4990 Rev 1

AN4990Sigma-delta modulation principle (external analog front-end functioning, simulations)2Sigma-delta modulation principle (external analogfront-end functioning, simulations)2.1Principle of sigma-delta modulationThe basic functional block diagram of a sigma-delta modulator is presented on Figure 4.Figure 4. Sigma-delta modulation principleIntegratorDifferenceAnaloginput 1Comparator 254LatchDBitstreamoutputQ31-bit DAC( Vref/Vref)AClockDMSv36525V21. The references [1] to [5] present in the above figure are used in the following paragraphs.AN4990 Rev 19/5655

Sigma-delta modulation principle (external analog front-end functioning, simulations)AN4990Figure 5 provides an example of the signals available at the different stages of the analog todigital conversion.Figure 5. Sigma-delta modulator voltages timing diagram2Analogue input [1]Difference [2]Integrator [3]Comparator [4]Latch [5]1.510.50-0.5-1-1.5-2MSv43873V11. The references [1] to [5] present in the above figure are used in the following paragraph.The below description of sigma-delta modulation uses references present in Figure 4 andFigure 5:The analog input signal [1] is added to the 1-bit DAC output feedback from the comparator( Vref or -Vref voltage) and the result [2] goes to the integrator. The integrator cumulates thedifference between the analog input signal [1] and the 1-bit DAC output feedback ( Vref or Vref voltage). The integrator output [3] is then compared with the zero voltage reference bythe comparator. The comparator output [4] is latched periodically at the clock frequency bythe D-latch to propagate the comparator result to the modulator output in quantized timesteps (clock ticks). The D-latch output [5] is the digital 1-bit output from the sigma-deltamodulator. The output is fed back to the 1-bit D/A converter which outputs only 2 possibleanalog voltages (usually

AN4990 Sigma-delta modulation principle (external analog front-end functioning, simulations) 55 2 Sigma-delta modulation principle (external analog front-end functioning, simulations) 2.1 Principle of sigma-delta modulation The basic functional block diagram of a sigma-delta modulator is presented on Figure 4. Figure 4. Sigma-delta modulation .

Related Documents:

STM32CubeIDE quick start guide - User manual Author: STMICROELECTRONICS Subject: STM32CubeIDE is STMicroelectronics integrated development environment for STM32 microcontrollers and microprocessors. Keywords: STM32, IDE, Eclipse , QSG Created Date: 11/2/2020 4:57:17 PM

[2]. Ben Jordan, Amit Bahl Rigid - Flex PCB Design a guide book for design, Sierra Proto express, 2013 [3]. STMicroelectronics. STM32 embedded graphic objects/ touchscreen library, 2011. [4]. STMicroelectronics. STM32F10xxx ı2c optimized examples, 2010. [5]. STMicroelectronics. Migratin

How a designer can make the most of STMicroelectronics serial EEPROMs Introduction Electrically Erasable and PROgrammable Memory (EEPROM) devices are standard products used for the non-volatile storage of data parameters, with a fine-granularity. This application note describes most of the internal architecture and related functionality of

– Electrostatic discharge protection Application Reverse battery protection of an electronic control unit Description The VN5R003H-E is a device made using STMicroelectronics VIPower technology. It is intended for providing reverse battery protection to an electronic module. This devic

Application note SPC560Pxx/SPC56APxx HW design guideline Introduction This application note is intended for hardware designers. It gives hardware design references on SPC560Pxx/SPC56APxx microcontroller. Four topics are covered: Voltage Regulator (VREG) Main oscillator Supply pins Reference Reset circuit www.st.com

March 2017 DocID028650 Rev 3 1/7 For further information contact your local STMicroelectronics sales office www.

User manual Discovery kit with STM32L496AG MCU Introduction The 32L496GDISCOVERY Discovery kit is a complete demonstration and development platform for the STMicroelectronics Arm Cortex -M4 core-based STM32L496AGI6 microcontroller. Thanks to the innovative ultra-low-power-oriented features, extended RAM,

Python: Introduction for Programmers Bruce Beckles Bob Dowling University Computing Service Scientific Computing Support e-mail address: escience-support@ucs.cam.ac.uk This is the UCS one day course on Python for people who have some experience of programming in a programming language other than Python. The course assumes that you