2012-12-21 05:07 PM
Hi all
i run timer 1 in capture mode and i want to know how can i reset the counter.for example i capturing signal and store it in an array. The counter counting from 0 to 65535 and every time edge comes in interrupt routine i read counter value and subtract it from last value but sometimes i need too rest counter value how can i do that please help me Thank you2012-12-21 07:05 PM
Can't you just write to the TIMx->CNT register? But if you're just computing a delta between two readings I'm not sure why you'd need to reset it.
2012-12-21 07:50 PM
2012-12-21 07:56 PM
But i don't know how can i clear counter reg.
Try writing zero to it, it is documented to be a R/W register.2012-12-21 08:11 PM
Thank you Clive1
TIMx->CNT =0;
Arg1=TIMx->CNT;
was work.Thank you for your help. It's helpful as usual.