Question
A CCR3 issue on all timers
Hello everyone,
I am starting to program with a stm32f103c8 and I have a problem when I want to update the compare output on channel 3. The output is either 0V or 3.3V depending on the polarity.
The rest of the outputs work correctly.
Here I leave the interrupt where I update the value of the register:
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef* htim)
{
if (htim == &htim2)
{
R=2000*factor*sin(i*paso)+2000;
i++;
if(i>n){
i=0;
}
TIM2->CCR1=R;
TIM2->CCR2=(4000-R);
TIM2->CCR3=R;
TIM2->CCR4=(4000-R);
}
}