当前位置:网站首页>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
边栏推荐
- Vmstat memory consumption query
- 【学术相关】为什么很多国内学者的AI的论文复现不了?
- V-Ray 5 acescg workflow settings
- Operator overloading
- Unity beginner 3 - enemy movement control and setting of blood loss area (2D)
- 330. Complete the array as required
- Cyberpunk special effect shader
- @Use of jsonserialize annotation
- [beauty of software engineering - column notes] 21 | architecture design: can ordinary programmers also implement complex systems?
- Detailed explanation of two modes of FTP
猜你喜欢

Go 事,如何成为一个Gopher ,并在7天找到 Go 语言相关工作,第1篇

Ansible (automation software)

Excellent urban design ~ good! Design # visualization radio station will be broadcast soon

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

@Use of jsonserialize annotation

My entrepreneurial neighbors

Unity - default rendering pipeline - sculpt shader

CentOS deploy PostgreSQL 13
![[beauty of software engineering - column notes] 22 | how to do a good job in technology selection for the project?](/img/1a/72bfb3fef59c54188a823ead3a5390.png)
[beauty of software engineering - column notes] 22 | how to do a good job in technology selection for the project?

Convert source package to RPM package
随机推荐
[experience] relevant configuration of remote connection to intranet server through springboard machine
Shell script - global variables, local variables, environment variables
Resize2fs: bad magic number in super block
Jianmu continuous integration platform v2.5.2 release
An Optimal Buffer Management Scheme with Dynamic Thresholds论文总结
Prepare esp32 environment
MapReduce steps of each stage
[cryoEM] Introduction to FSC, Fourier shell correlation
C language interview preparation I (about understanding Department)
工业互联网行至深水区,落地的路要怎么走?
[note] the art of research - (tell a good story and argument)
Vmstat memory consumption query
QT connects two qslite databases and reports an error qsqlquery:: exec: database not open
[freeze electron microscope] analysis of the source code of the subtomogram alignment function of relion4.0 (for self use)
In the MySQL connector of flynk CDC, the MySQL field is varbinary, which is officially
[paper reading] tomoalign: a novel approach to correcting sample motion and 3D CTF in cryoet
20 hacker artifacts
You study, I reward, 21 day learning challenge | waiting for you to fight
【NOI模拟赛】计算几何(凸包,暴力,并查集)
10 common software architecture modes