6 days, 10 hours ago.

Sample Code for Measure frequency upto 10MHZ in MBED Nucleus Board (STM32F104)

Sample Code for Measure frequency upto 10MHZ in MBED Nucleus Board (STM32F104) for timer 2 channel 3....?

Comment on this question

2 Answers

2 days, 3 hours ago.

Did you mean STM32F401? This is usually called pulse counting or maybe frequency counting. That micro has an 84MHz clock so 10MHz is a screaming fast signal to try to measure. Basically impossible to do this in software. This has to be offloaded to hardware. The best way I can think of is to configure a timer to work with an external clock input. This external 10MHz signal then clocks your timer and software can check the accumulated timer value periodically at a fixed time interval. Of course only works if the micro timer hardware supports external clock input - it appears timers on this micro do support this. This requires that you dig down into the ST HAL layers.

You can also check the STM forums, I'm sure there are some examples of setting this up in HAL. I don't immediately see anything from the mbed import wizard that fits the bill here. And of course read the HAL libraries, they may even have a function to help setup timers in this mode.

1 day, 19 hours ago.

Please refer my notebook.
I don't know STM32F104F but I hope you can use similar configuration for your CPU.

To post an answer, please log in.