cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency count and Input Capture

smeric
Associate II
Posted on October 21, 2013 at 16:22

How can I count more then 50Mhz frequency with STM32F407 series.

#prescaler #input-capture #sample #frequency-counter #frequency-counter #frequency-counter
7 REPLIES 7
Posted on October 21, 2013 at 16:35

How can I count more then 50Mhz frequency with STM32F407 series.

Use an external counter mode (counts using external source), and sample over a fixed period to integrate.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
smeric
Associate II
Posted on October 21, 2013 at 16:39

Have you got any sample ?

Posted on October 21, 2013 at 16:52

Have you got any sample ?

I posted one for counting external pulses, not sure I've published a free complete solution.

[DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Discovery/STM32F4%20Timer%20External%20Pulse%20counting&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentviews=134]https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSTM32Discovery%2FSTM32F4%20Timer%20External%20Pulse%20counting&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F¤tviews=134

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
John F.
Senior
Posted on October 21, 2013 at 17:56

The Data Sheet seems to say fEXT (Timer external clock frequency on CH1 to CH4) is 42MHz for timers on APB1 and 84MHz for timers on APB2. I may have misunderstood the terminology. I only glanced at the Data Sheet.

If there is a limitation, could you use an external IC hardware divider as a pre-scaler?

Posted on October 21, 2013 at 18:03

There is a synchronizer on the externally facing pins, though if I recall that will be off the AHB, but the TIM units likely have their own. So, yes, I'd probably be cautious about aliasing effects, and check the docs thoroughly.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
smeric
Associate II
Posted on October 21, 2013 at 18:15

yes John. I have already prescalers before MCU. I am trying to count GHZ. but after prescalers I wanna count.(prescaler 2/4/8) for example when I try to read 433 mhz (HAM radio) . 433/8=~54.6 Mhz.. so I did that before with other MCU. I read 90Mhz with Pic18f series. but I decided to change architecture and I decided to use STM32 series.( I think it is  better then other when look  priceand performance ).

Posted on October 21, 2013 at 18:30

I don't think ~50 MHz should be a problem, though the synchronizer is going to introduce some amount of jitter related to how the two rates beat together, and relative clock drift. Dividing it down would help, if you can get it down in the 10's of KHz Input Capture and measuring the period would also work.

At around 84-90 MHz I'd definitely want to look at other solutions. The F429 can clock APB1 at 90 MHz (CPU @ 180 MHz), but USB wouldn't be usable.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..