TIMER std peripheral lib
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2011-04-05 4:47 AM
Posted on April 05, 2011 at 13:47
Hi,
While using standart peripheraltim
library, i have noticed that the folloeing OC modes are avilable:- TIM_OCMode_Timing.
- TIM_OCMode_Active.
- TIM_OCMode_Inactive.
- TIM_OCMode_Toggle.
- TIM_OCMode_PWM1.
- TIM_OCMode_PWM2.
Can anyone describe each mode?
what is the difference between them (for example between 1 & 3)? (I read the chip refrence manual timer section but couldn't figure all modes). Thanks - Udi. #stm32-timer
Labels:
- Labels:
-
TIM
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
2011-04-05 12:32 PM
Posted on April 05, 2011 at 21:32
I think the reference manual does go into some detail, you can correlate the defined values against the register settings, and the block diagrams of the timers.
The Timing mode (1) doesn't do ANYTHING with the output pins, it's for interrupt tickers. Whereas Inactive mode (3) the OC1REF is driven to ZERO on a match, or Active (2) the OC1REF is driven to ONE on a match, basically describes a one-shot pulse. The difference between PWM1 and PWM2 is whether you are controlling the ON or OFF periods, a repetitive pulse. The toggle mode flips the state of OC1REF at each match, a clock divider (50/50 duty). There are several modes which don't have library defines, and these drive OC1REF to ZERO or ONE all the time, regardless of any comparisons. The usefulness of any of these modes will depend on your application.
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..
