Read PWM input without TIM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-04-29 7:29 PM
Posted on April 30, 2014 at 04:29
Excuse me, I want to ask, can I know duty cycle of PWM without using TIM? I thought if I can read the time of PIN either in high or low logic and then divided by period. So I can measure the duty cycle. Assumption : I know the frequency of PWM input, so I can determine the period at first.
Thank you very much.
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-04-29 8:09 PM
Posted on April 30, 2014 at 05:09
Well you can certainly time stamp the pin transitions against some other free running time base, and from those compute period/duty. You could use the EXTI interrupts. The desire to do this in software will limit the maximal frequency.
You could use some other 32-bit TIM, or the core cycle counter DWT_CYCCNT
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..
