当前位置:网站首页>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
边栏推荐
- [introduction to cryoelectron microscopy] Caltech open class course notes part 3:image formation
- 关于pip升级损坏导致的问题记录
- Day 014 2D array exercise
- Realize the effect of changing some colors of a paragraph of text
- Some tools, plug-ins and software links are shared with you~
- The computer system has no standard tcp/ip port processing operations
- String class
- Qt/PyQt 窗口类型与窗口标志
- An Optimal Buffer Management Scheme with Dynamic Thresholds论文总结
- [untitled] format save
猜你喜欢

MySQL uses date_ FORMAT(date,'%Y-%m')

Why don't you like it? It's easy to send email in cicd

IonIcons图标大全

Data unit: bit, byte, word, word length

Solving linear programming problems based on MATLAB

An optimal buffer management scheme with dynamic thresholds paper summary
What are the common error types and solutions of black box testing?

Implementation of simple matcap+fresnel shader in unity

Rotation in model space and rotation in world space
![[paper reading | cryoet] gum net: fast and accurate 3D subtomo image alignment and average unsupervised geometric matching](/img/dc/255bf122d5243f2a08ca0e03b53137.png)
[paper reading | cryoet] gum net: fast and accurate 3D subtomo image alignment and average unsupervised geometric matching
随机推荐
Sort out the two NFT pricing paradigms and four solutions on the market
Phased learning about the entry-level application of SQL Server statements - necessary for job hunting (I)
330. Complete the array as required
Dynamic thresholds buffer management in a shared buffer packet switch paper summary
Some thoughts on growing into an architect
For the application challenge of smart city, shengteng AI gives a new solution
Autojs微信研究:微信自动发送信息机器人最终成品(有效果演示)
20 hacker artifacts
Official tutorial redshift 01 basic theoretical knowledge and basic characteristics learning
Useful websites
Unity beginner 2 - tile making and world interaction (2D)
Unity beginner 1 - character movement control (2D)
Crawl notes
Sqlmap (SQL injection automation tool)
Compare three clock circuit schemes of single chip microcomputer
Unicode私人使用区域(Private Use Areas)
How to connect VMware virtual machine to external network under physical machine win10 system
Space shooting Lesson 17: game over (end)
[密码学实验] 0x00 安装NTL库
Resize2fs: bad magic number in super block