Interrupt generation with PWM signal's rising and falling edges
Hello,
I am quite new to this. I am generating a PWM signal(100Hz with 40% duty cycle) using Tim1 on my stm32f103c8t6(Bluepill). I want to take ADC readings(both ADC1 and ADC2 in simultaneous mode) during the high part of the PWM signal at a frequency of 1KHz. I want to understand how many timers would be required for this. Currently I am trying to use Tim2 set at 1KHz and trying to trigger it using the TRGO of Tim1. Then I am using TRGO of Tim2 as external trigger conversion source for the ADCs. However as far as I know for Tim1 PWM signal I can only get an interrupt for either when the signal start(Update Event) or when it goes from high to low(Output Compare). How can I get both interrupts so that I can start and stop Tim2.
Any help would be appreciated.
TIA
