当前位置:网站首页>STM32 detection signal frequency
STM32 detection signal frequency
2022-07-29 08:02:00 【BobBobBao】
STM32 Detection signal frequency
The goal is
The signal :500kHz±50Hz Square wave signal , Duty cycle 50%, Low level :0V, High level :3.3V
testing : The frequency of the signal , Sampling rate 100Hz, Record the frequency value
analysis
Signal period 2μm, High level 、 The low level lasts 1μm;
sampling frequency 100Hz, That is, every 10ms Record the primary frequency value , Counting range :5000±50(4950~5050);
Use STM32F103 Single chip microcomputer , External crystal oscillator 8MHz, Internal clock frequency doubling up to 72MHz:
- External interrupt : One rising edge at a time / The falling edge enters an interrupt to record the number of pulses . Low frequency (<10KHz) You can use , The disadvantage is frequent access interruptions , It takes a lot of time , Cannot be used to measure high frequency
- PWM The input mode : Use it directly STM32 Hardware PWM Input mode to collect frequency
- Enter capture mode : Rising edge trigger , Record the start time , Record the second time at the next rising edge , Two time differences are one cycle .<100KHz The effect is very good , However fast the speed is, repeated in and out interruptions will reduce the detection accuracy
- External clock counter : Use two clocks , A clock is used for accurate and timely adoption , A clock is used for counting , Detect the number of pulses in a fixed time . For example, a clock is precisely timed 10ms, Another clock is used to record 10ms Number of internal pulses cnt, So frequency f=cnt/10ms. This method uses two separate timers , It can detect 2MHz The signal of .
Principle of frequency measurement
The idea of frequency measurement method is shown in the figure below , At a fixed time Tc1 Inside , Count the measured signal pulses to get N1. If the frequency of the standard signal is fc, Then the frequency of the measured signal fx = N1*fc
Reference resources :1. use STM32 The timer measures the signal frequency —— Frequency measurement method and cycle measurement method
2. Use STM32 Several methods of measuring frequency and duty cycle
[1]: https://www.cnblogs.com/helesheng/p/14107012.html
边栏推荐
- [beauty of software engineering - column notes] 22 | how to do a good job in technology selection for the project?
- File system I
- Ansible (automation software)
- [beauty of software engineering - column notes] 21 | architecture design: can ordinary programmers also implement complex systems?
- 在一个sql文件中,上面定义一个测试表及数据,下面可以select* from 测试表
- [paper reading | cryoelectron microscope] interpretation of the new subtomogram averaging method in relion 4.0
- 佳木斯市场监管局开展防疫防虫害专题食品安全网络培训
- Implementation of simple matcap+fresnel shader in unity
- Day 014 二维数组练习
- Jiamusi Market Supervision Bureau carried out special food safety network training on epidemic and insect prevention
猜你喜欢

Go, how to become a gopher, and find work related to go language in 7 days, Part 1
![[beauty of software engineering - column notes] 25 | what methods can improve development efficiency?](/img/c8/c2d45abbf36b898040f9f1cf6274ff.png)
[beauty of software engineering - column notes] 25 | what methods can improve development efficiency?

An optimal buffer management scheme with dynamic thresholds paper summary

Sqlmap (SQL injection automation tool)

Unity beginner 4 - frame animation and protagonist attack (2D)

Explanation and closing method of server 135, 137, 138, 139, 445 and other ports

Excellent urban design ~ good! Design # visualization radio station will be broadcast soon
![[untitled] format save](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[untitled] format save

Official tutorial redshift 01 basic theoretical knowledge and basic characteristics learning

Tcp/ip five layer reference model and corresponding typical devices and IPv6
随机推荐
Jianmu continuous integration platform v2.5.2 release
QT connects two qslite databases and reports an error qsqlquery:: exec: database not open
Monitor the bottom button of page scrolling position positioning (including the solution that page initialization positioning does not take effect on mouse sliding)
Ue4/ue5 C disk enlargement processing
Compare three clock circuit schemes of single chip microcomputer
Ansible (automation software)
Unity beginner 4 - frame animation and protagonist attack (2D)
JVM garbage collection mechanism (GC)
[cryoelectron microscope] relion4.0 pipeline command summary (self use)
What are the principles and methods of implementing functional automation testing?
(视频+图文)机器学习入门系列-第5章 机器学习实践
Data warehouse modeling, what is wide table? How to design? Advantages and disadvantages
[cryoEM] Introduction to FSC, Fourier shell correlation
Resize2fs: bad magic number in super block
Go 事,如何成为一个Gopher ,并在7天找到 Go 语言相关工作,第1篇
Implementation of simple cubecap+fresnel shader in unity
Dynamically load data
在js中,0表示false,非0表示true
LVM logical volume group management
Taiyuan bus route crawling