interrupt of the timer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-06-29 5:32 PM
Can I have a link or an code example to count the rising edges that have an input signal in a prefixed time?
I need the number of rising edges in a second.The frequency of the signal on a gpio input is in a range from 10 Hz to 70Hz.how count the number of rising edges until the timer is 0?I use stm32f4 discovery.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-06-29 8:15 PM
You could use one TIM in external counter mode, and use a second to define the integration period, this could trigger a DMA sample of the counter of the first, and subsequent measurements would allow you to compute the increments over the period. There may also be other gating options.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-06-30 1:46 AM
Can I ask you an example?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-06-30 1:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-06-30 7:52 AM
There are several manuals for it, Data Sheet/Manual and Reference Manual. The timer section is a bit heavy going, but if you have familiarity with other micro-processor and timer designs it should give some perspective.
http://www.cs.indiana.edu/~geobrown/book.pdf
I don't really want to have to write everyone's code. I've posted some external counter examples. You could review the count every 1000 iterations of a 1ms SysTick interrupt? The kind of frequency you're talking about would seem easy to measure using PWM Input mode. Integration is perhaps more effective with faster clocks.Up vote any posts that you find helpful, it shows what's working..
