Error Using multiple Output Compare channels
Hello,
I'm using a F401 blackpill board for a school project.
Currently I'm trying to generate a pulse with adjustable length to open a MOSFET circuit.
I managed the pulse by using an Output Compare channel and setting the CCR to 1, so the pulse would be the length of the ARR.
Where I run into a problem is when I try using more than one Output Compare channel from one timer to do the same operation. The pulse fires once and then all the channels go to HIGH output.
To trigger the timer channel I use this function:
void pulse(uint16_t pulsetime, TIM_HandleTypeDef *htim, uint8_t channel)
{
htim->Instance->ARR = pulsetime;
HAL_TIM_OC_Start_IT(htim, channel);
}
Then in the DelayElapsedCallback I stop the timer channel with HAL_TIM_OC_Stop_IT().
As long as I only ever start one of the timer channels it works fine, however as soon as another channel is started in this manner, all channels stop working.
Can anyone help me figure out why using multiple channels won't work?
