cancel
Showing results for 
Search instead for 
Did you mean: 

Mesure time

ybitton
Associate II
Posted on July 28, 2011 at 10:24

Hi,

I would like to mesure time between software events.

I thought of using  TIM17 channel 1 input capture mode and trigger it by software.

But i have a problem, how can i configure it to ignore it's port (PB9) input data and just be activated by software? is it possible?

Thanks - Udi.
2 REPLIES 2
Posted on July 28, 2011 at 13:53

Typically you'd use a free running counter of some sort, depending on the granularity and period between measurements.

For seconds you have the RTC, you can get it to measure fractional seconds by playing with the prescaler. At seconds, the period is about 140 years as I recall.

The TIMx timers can be set in simple counting modes, but the 16-bit width can be very limiting.

The core cycle counter, part of the trace unit, is a 32-bit counter that clocks at SYSCLK, depending on the frequency you're looking at a resolution of several nanoseconds, and periods around a minute.

You can also use SysTick to increment a software counter at say 1 millisecond, and get fractional ticks from core cycle counter.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
ybitton
Associate II
Posted on August 01, 2011 at 09:45

Thanks for the option review.

Actually i am using software counter incrimented by SYS clock.

I thought of improving it by using TIMx channel as input capture mode activated by software, therefore i asked how to configure it's port.