cancel
Showing results for 
Search instead for 
Did you mean: 

timer

yang hong
Associate II

I am using NUCLEO-H743ZI2. I am trying timer to generate pulse using TIM_OCMODE_TOGGLE channel 1. my timer clock is 100MHz, I set pre-scaler as 9 and channel 1 pulse as 9 as well. It seems it is difficult to get pulse, except I add more count on channel 1. is it true?

3 REPLIES 3

You have to set the respective CCRx register to below value you've set into ARR, otherwise there is no compare thus no toggling. Prescaler (PSC) has nothing to do with this fact, it only influences the output frequency of toggling.

JW

TDK
Guru

To get a pulse, you need to set the period and the pulse value. For 50% duty cycle, set pulse = (period + 1) / 2.

If you feel a post has answered your question, please click "Accept as Solution".

Just to avoid any confusion: TDK talks about PWM mode.

TOGGLE mode results always on 50% duty and half the frequency of timer's overflow frequency.

JW