2020-10-14 08:33 AM
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?
2020-10-14 02:59 PM
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
2020-10-14 04:44 PM
To get a pulse, you need to set the period and the pulse value. For 50% duty cycle, set pulse = (period + 1) / 2.
2020-10-15 12:11 AM
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