cancel
Showing results for 
Search instead for 
Did you mean: 

How to measure clock frequency inside of MCU?

matic
Associate III
Posted on December 29, 2015 at 16:06

Hi.

I would like to measure different clock sources with TIM16 and MCO as it is described in reference manual for STM32F303 uC, which I am using.

I configured TIM16 input capture from remap (in TIM16->OR register), but I am not sure how exactly this measuring works. In the reference manual, there is no extensive description. Could someone describe how this works please. I would be very grateful. Short description of this approach is in RM on pages 122 and 136.

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/reference_manual/DM00043574.pdf

Or do you have any other suggestion how to measure clock with minimum CPU usage? Actualluy I don't have to know exactly what the frequency is, but have to know when something goes wrong (if frequency is not in the specified range).

Thanks a lot.

10 REPLIES 10
matic
Associate III
Posted on December 31, 2015 at 00:01

TIM16 couldn't be clocked at 144 MHz in F303CB part, which we have due to size restrictions. This is true only for larger packages - 64 pins and above. In F303CB TIM1 and TIM8 can be clocked at 144 MHz.

Thank you all for the suggestions. I will try to make something.