Questions about this circuit and a solution
Hi,Master:
Platform: STM32F301K8U
As shown below in Figure 1, PA7 (MCU_14) is a video signal (As shown below in Figure 2), which contains the line sync signal (A area in Figure 2, fixed frequency, there may be noise)and the field sync signal(B area in Figure 2). I want to distinguish the line sync signal and the field sync signal . My question is as follows:
Question 1: What is the purpose of PA4 in Figure 1 through capacitor to ground and PA2, PA3 short circuit?
Question 2: I want to use the comparator to compare PA7 and DAC1_CH1 and then use the input capture to measure the period to distinguish between the two signals (As shown below Figure 3). Is it feasible? I worry that if there is a lot of noise on the PA7, it may be difficult to distinguish. Is there a better solution? Ask the master for advice.
Thank you very much!

Figure 1

Figure 2

Figure 3