2014-07-19 4:47 AM
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?2014-07-19 5:51 AM
You can read TIMx->CNT, or have the pin transition latch the event in TIMx->CCRx
2014-07-29 9:42 AM
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 that2014-07-29 9:50 AM
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.We’re moving the ST Community to a new platform to give you a better and more reliable community experience.