I need to measure the frequency of the input signal using stm32f407-Discovery and send it once per second. The frequency of the controller is 168 MHz. The maximum input frequency is 6 MHz. If I use EXTI, I can measure a maximum of 4 MHz. As the frequency increases, the values that change are more like noise. Although the estimated maximum interrupt frequency is approximately 13 MHz. What is the best way to solve this problem?
Asked
Active
Viewed 1,198 times
1
-
3There are two topics involved: 1) Don't use EXIT. It will trigger millions of interrupt handlers per second. clog up your MCU and limit the frequency. Instead, use a counter with an external trigger. I think STM calls it timer with external clock. 2) Achieving good signal quality probably deserves it own question. At lower frequency, a Schmitt trigger is helpful. At higher frequencies, other measures are helpful. Getting good results across a wide frequency range requires additional smarts. – Codo Oct 06 '20 at 09:20
1 Answers
3
Use this signal as theclock signal for one of the timers.
Use another timer to trigger DMA transfer in the regular intervals. The CNT register change will be proportional to the frequency of the signal.
The rest is a very simple math.

0___________
- 60,014
- 4
- 34
- 74