2021-10-27 04:35 PM
Hello,
I'm working with STM32L433RB.
I would like to, in TIMER1, use COMP2_OUT to as the ETR, to make time-shifting of a PWM output signal.
The setting of TIM1 registers are as the following:
TIM1->CR1 = 0; // disable TIM1
TIM1->PSC = 9 - 1;
TIM1->SMCR = 0x00004; // Reset Mode
TIM1->OR2 = 0x8000; // COMP2_OUT as ETR
TIM1->CCR3 = 4; //
TIM1->CCMR2 = 0x00060; // PWM mode 1
TIM1->CCER = 0x0400; // CH3N output enable
TIM1->BDTR = 0x8000; // MOE: main output enable
TIM1->CR1 |= 1; // enable TIM1
I have the PWM signal output, and the COMP2_OUT can rise an interrupt correctly.
But the COMP2_OUT has no impact on the PWM signal.
Do I miss some settings ?
Best regards
2021-10-27 11:16 PM
If you want to use ETR as trigger to the slave mode controller, you have to set TIMx_SMCR.TS to 0b111.
JW
2021-10-28 11:05 AM
With TIMx_SMCR.TS set to 0b111, it works as expected !
Thank you JW!