Introduction - If you have any usage issues, please Google them yourself
Use the STM8 TIM2 input capture function PWM duty cycle and period measurement, the measured signal received TIM1 of CH1, when a PWM into the interrupt trigger edge changes, which can use one channel measuring high and low time to give the duty cycle and period