Reading timer counter & prescaler on the fly - STM32F205RBT6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-07-19 4:47 AM
Posted on July 19, 2014 at 13:47
I am using STM32F205RBT6.
I have to start a timer when a particular event happens. This I have done in programming.After that interrupts comes on three other pins. Now I have to measure the time between:1. Start & interrupt on pin 1 2. Start & interrupt on pin 23. Start & interrupt on pin 31. Can I read the value of counter & timer on the fly so that I can measure time?2. If answer is yes, then I think there is some error in it. Like when interrupt happens on pin then control will first go to external pin ISR, where I will read timer values. In this error may come ? Can I reduce this error?3. Is there any better method to do this?
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-07-19 5:51 AM
Posted on July 19, 2014 at 14:51
You can read TIMx->CNT, or have the pin transition latch the event in TIMx->CCRx
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
‎2014-07-29 9:42 AM
Posted on July 29, 2014 at 18:42
Thanks clive for your reply.
But I have 3-10 such stop pulses come.But CCRx register has only one or ttwo pins with it. then what would be best way to do thatOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-07-29 9:50 AM
Posted on July 29, 2014 at 18:50
Most timers have 4 channels, and can latch events on four pins.
If the counter is free running Input Capture is the equivalent of TIMx->CCRx = TIMx->CNT; // At the event You can back out the interrupt latency by reading TIMx->CNT in the handler. ie current value, vs value latched at the edge. For PWM Input mode, or resetting the timer, then you'll likely need one timer per input signal.
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..
