Timer1 capture data
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-12-21 5:07 PM
Posted on December 22, 2012 at 02:07
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 you
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-12-21 7:05 PM
Posted on December 22, 2012 at 04:05
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.
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
‎2012-12-21 7:50 PM
Posted on December 22, 2012 at 04:50Thank you for your fast reply because sometime my signal stream off and i want to clear counter in this time.But i don't know how can i clear counter reg.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-12-21 7:56 PM
Posted on December 22, 2012 at 04:56
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.
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
‎2012-12-21 8:11 PM
Posted on December 22, 2012 at 05:11
Thank you Clive1
TIMx->CNT =0;
Arg1=TIMx->CNT;
was work.Thank you for your help. It's helpful as usual.