Simultaneous PWM output and input at the same timer (STM32H7B0)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-14 2:57 AM
Hi,
I'm using Timer 3 channel 4 for the PWM output und channel 2/1 as a combined PWM input where channel 2 is the direct input.
If I feed the output pwm to the input, I don't get a capture value in CCR2, only in CCR1.
Can I use the output and input simultaneously at all on the same timer?
Kind regards,
Stefan
- Labels:
-
STM32H7 Series
-
TIM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-14 4:32 AM
Yes you can, but if by "combined PWM input" you mean that you reset the timer through slave-mode controller, PWM won't work as you expect i.e. period set to ARR gets effectively ignored and you'll see only short pulses on the output.
> I don't get a capture value in CCR2,
What does this mean?
Read out and check/post the timer registers content. Timers are simple enough to be programmed directly by registers.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-14 5:49 AM
It seems that CCR2 is counting up to the ARR value set by pwm output and then reset, what I then read out. In this constellation I can only measure signals that have a higher frequency than the current pwm output to not get a higher CCR2 than ARR.
This also means that pwm output and input isn't really independent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-14 10:06 AM
Read the timer chapter in RM, it describes the timer functionality in detail. You may want to read it multiple times, performing experiments as you go. The related appnotes (AN4013 and AN4776) are worth reading, too.
JW
