简体   繁体   English

在STM32上测量信号频率

[英]Measure the signal frequency on STM32

I need to measure the frequency of the input signal using stm32f407-Discovery and send it once per second.我需要使用 stm32f407-Discovery 测量输入信号的频率并每秒发送一次。 The frequency of the controller is 168 MHz.控制器的频率为 168 MHz。 The maximum input frequency is 6 MHz.最大输入频率为 6 MHz。 If I use EXTI, I can measure a maximum of 4 MHz.如果我使用 EXTI,我最多可以测量 4 MHz。 As the frequency increases, the values that change are more like noise.随着频率的增加,变化的值更像是噪声。 Although the estimated maximum interrupt frequency is approximately 13 MHz.虽然估计最大中断频率约为 13 MHz。 What is the best way to solve this problem?解决这个问题的最佳方法是什么?

Use this signal as theclock signal for one of the timers.将此信号用作其中一个定时器的时钟信号。

Use another timer to trigger DMA transfer in the regular intervals.使用另一个定时器定期触发 DMA 传输。 The CNT register change will be proportional to the frequency of the signal. CNT 寄存器的变化将与信号频率成正比。

The rest is a very simple math.剩下的就是一个非常简单的数学。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM