cancel
Showing results for 
Search instead for 
Did you mean: 

timer channels STM32F303x6/x8

ABarb.7
Associate II

Hi! Regarding the microcontroller STM32F303x6/x8.

I have to generate 4+4 PWM waveforms. Waveforms from 1 to 4 have the same frequency but each must have different duty cycle. The waveforms from 5 to 8 have same frequency (different from the first group)  but each has different duty cycle. I want to use one timer for the first group. And another timer for the second group. The datasheet states "4 independent channels for output compare" in each chapter describing the timers. What does it mean? Are There 4 channels for each timer? or are there 4 channels for each group of timers (4 channels shared for TIM2/TIM3/TIM4 and other 4channels shared for TIM1/TIM8/TIM20)? or are there only 4 channels for all the timers of the microcontroller? thank you.

5 REPLIES 5
rpip.1
Associate III

4 channels for each timer is correct. tim1 & tim2 is enough.

ABarb.7
Associate II

just to understand. So I can set 4 match compare registers for TIM1 to generate 4 different interrupts. And the same for TIM2. so I can handle 4+4 PWM on the pins I want by setting manually the pins on the interrupt routine. Is it correct? Thank you so much.

You don't need interrupts for PWM, the TIM outputs PWM automatically if set to that mode, and if the respective TIMx_CHx pin is set as AF in GPIO.

Read the TIM chapter in RM.

JW

PS. Please tell us about your background, your questions sound like you are coming from Arduino or PIC world, is it so?

yes but why you need an interrupt. i don't see the need.

ABarb.7
Associate II

I cannot explain with messages. The application is more complicated. For some outputs I can operate as suggested with PWM mode. With others I need some interrupts to be generated in order to do other stuff... Thank you so much for the answers.