Question
Changing Timer Capture Compare from Timer ISR
I am trying to change the PWM duty cycle of timer3, channel 1 from the period elapsed ISR of timer 6. This seems to cause the chip to crash.
I can confirm that:
- timer6 is properly configured and interrupt fires appropriately.
- timer3 is properly configured and is outputting PWM (duty cycle can be changed normally from main loop)
Using stm32f103vct6
Any ideas?
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
if (htim->Instance == TIM6)
{
__HAL_TIM_SET_COMPARE(&htim3, TIM_CHANNEL_1, 1800);
}
}
