当前位置:网站首页>STM32 tutorial triple ADC interleaved sampling
STM32 tutorial triple ADC interleaved sampling
2022-07-05 08:04:00 【Shallow Xu】
ps: This article is based on stm32F407ZGT6 Single chip microcomputer
stm32F4 The maximum sampling rate of single channel acquisition of single chip microcomputer is 2.4M, Therefore, it is sometimes difficult to meet higher frequency sampling , So consult the chip manual , Find out stm32F4 Support multiple ADC collection , Use the conversion time of each channel , Dislocation sampling , So as to improve the sampling rate , Turn the sampling rate to 2.4*3=7.2M. ( I started learning last year ADC When studying , be based on cube and HAL Triple of Library ADC There are few cross sampling references , I also studied for a period of time , Write this blog, hoping to help more people .)
The schematic diagram is as follows :

The following is an illustration of the official example ,
In this example, the system clock is 144MHz, APB2 = 72MHz and ADC clock = APB2 /2.
Since ADCCLK= 36MHz and Conversion rate = 5 cycles
==> Conversion Time = 36M/5cyc = 7.2Msps
This is triggered by software ADC Continuously sampled , I tried , It is feasible. . The few references on the Internet are also under the continuous conversion mode mentioned above .
But I am used to using timer to trigger sampling , Because the sampling rate is continuously adjustable , More flexible than continuous conversion .
So I started trying to trigger triple timer ADC!
The configuration is as follows : open TIM8, Hang on APB2 On , by 144M

How much is the clock frequency configured ?
Open the chip manual :

Thus we can see that The trigger source only needs to trigger ADC1 ADC2 and 3 The acquisition is automatically started after the inherent time of the triple mode set by the chip
so ADC1 Just configure 2.4M 144M/60=2.4M

ADC How to configure ?
Look at the chip manual !

DMA mode2 !
ADC1 The configuration is as follows :
( Choose the channel 12 Because it is pure Less interference )
Remember to open it. DMA !
Configuration is similar to single channel ADC+ Timer triggered !

ADC2/3 ditto I won't repeat it here !
complete !
The generated code !
How to write in the code ?
Open the chip manual again !!

So that's it ! I feel like I can !
Turn on ADC123 and TIM8:( Pay attention to triple ADC In alternate mode ,ADC1 There is an inherent opening function )


compile ! burn !

Tested last year , The epidemic situation will not be tested at home QAQ
Last year, the signal generator was used to give 100khz Sine wave signal , A cycle was picked 72 A p.m. .
ps: According to the seniors, this way is unstable , When the workload of single chip microcomputer is large, it may appear bug.
边栏推荐
- Global and Chinese market of core pallets 2022-2028: Research Report on technology, participants, trends, market size and share
- Record the visual shock of the Winter Olympics and the introduction of the screen 2
- Pointnet++ classification practice
- . Net service governance flow limiting middleware -fireflysoft RateLimit
- Measurement fitting based on Halcon learning [II] meaure_ pin. Hdev routine
- VESC Benjamin test motor parameters
- C, Numerical Recipes in C, solution of linear algebraic equations, LU decomposition source program
- C WinForm [display real-time time in the status bar] - practical exercise 1
- Shape template matching based on Halcon learning [viii] PM_ multiple_ models. Hdev routine
- Measurement fitting based on Halcon learning [i] fuse Hdev routine
猜你喜欢

Nb-iot technical summary

Network communication model -- Network OSI tcp/ip layering

UEFI development learning 3 - create UEFI program

Shell script basic syntax

研究发现,跨境电商客服系统都有这五点功能!
![Measurement fitting based on Halcon learning [II] meaure_ pin. Hdev routine](/img/da/8c70699d2cd3ec5b36ec716b8f6bd1.jpg)
Measurement fitting based on Halcon learning [II] meaure_ pin. Hdev routine

PMSM dead time compensation
![Shape template matching based on Halcon learning [v] find_ cocoa_ packages_ max_ deformation. Hdev routine](/img/a1/d13b37955b044b6be5f1fd10263c5e.jpg)
Shape template matching based on Halcon learning [v] find_ cocoa_ packages_ max_ deformation. Hdev routine

Ads learning record (lna_atf54143)
![[tutorial 19 of trio basic from introduction to proficiency] detailed introduction of trio as a slave station connecting to the third-party bus (anybus PROFIBUS DP...)](/img/54/2fe86f54af01f10de93818103f2154.jpg)
[tutorial 19 of trio basic from introduction to proficiency] detailed introduction of trio as a slave station connecting to the third-party bus (anybus PROFIBUS DP...)
随机推荐
如何将EasyCVR平台RTSP接入的设备数据迁移到EasyNVR中?
C WinForm [exit application] - practice 3
Vofa+ software usage record
Adaptive filter
Consul installation
Relationship between line voltage and phase voltage, line current and phase current
The research found that the cross-border e-commerce customer service system has these five functions!
UEFI development learning 4 - getting to know variable services
如何进行导电滑环选型
Global and Chinese market of core pallets 2022-2028: Research Report on technology, participants, trends, market size and share
Shell script basic syntax
Process communication mode between different hosts -- socket
Bootloader implementation of PIC MCU
UEFI development learning 5 - simple use of protocol
Sql Server的存儲過程詳解
[trio basic tutorial 16 from introduction to proficiency] UDP communication test supplement
Global and Chinese markets for waste treatment air switches 2022-2028: Research Report on technology, participants, trends, market size and share
Cadence learning records
【论文阅读】2022年最新迁移学习综述笔注(Transferability in Deep Learning: A Survey)
Shape template matching based on Halcon learning [v] find_ cocoa_ packages_ max_ deformation. Hdev routine