1

I'm very new to embedded SW development and I'm trying to understand as much as possible by realizing simple code for a STM32G031C6T6 MCU, so probabily this is a stupid question but I can't find the answer anywere. First I set up channel 1 of TIM1 for PWM generation, that is output on the PA8 pin and it's working properly. Then I set channel 1 of TIM3 for input capture, that is performed on the PA6 pin rising edge. In the code I started the timers with HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1) and HAL_TIM_IC_Start_IT(&htim3, TIM_CHANNEL_1). I run the the program and the input compare in TIM3 is triggered everytime there's a rising edge of the PWM signal generated by TIM1. I can't figure out why this is happening and I'm unable to find any info about this behavior. Last but not least I am sure that there's no physical connection between PA8 and PA6, plus the input compare channel is filtered (I tried to set the filter even at its max value) so that no noise from the PWM channel can trigger it.

screenshot of the configuration in cubeMx [TIM3]: https://i.stack.imgur.com/ehXbe.jpg [TIM1]: https://i.stack.imgur.com/s95kU.jpg

PS: after further testing i noticed that it happens only if I enable the input compare on channel 1 the other 3 channels seems to work just fine

0 Answers0