Mesure time
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-07-28 1:24 AM
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.
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-07-28 4:53 AM
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..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-08-01 12:45 AM
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.
