How to set "Reference Voltage" to raise an Interrupt from External Sensor

Hi,

I want to connect an FSR sensor (Force Sensitive Resistor) to H7.
Generally, FSR connects 3.3V, GND (through as Resistor) and any Input PIN (which receives changing voltages from FSR based on the pressure put on the FSR surface).

Pins already in use on my H7:
Pins P4 & P5: Already in use for UART.
Pin P6: Already in use as ADC.
Pin P7: Already in use for signal output.

Which pins (out of the remaining) can I use for obtaining input from the FSR, please?

Voltage Input from FSR varies continuously. How can I set a reference voltage (eg. 1.25V) and obtain an Interrupt ONLY when the voltage from FSR lies above the reference voltage?

I tried to understand the notes written here: https://github.com/openmv/openmv/blob/master/src/sthal/h7/src/stm32h7xx_hal_comp.c
But, being a novice, failed to comprehend how to implement it.

Any help in this regard is highly solicited, please.

PS: Forgive me if such questions are not supposed to be asked on this forum.

Thanks,
Regards.
Govind

Hi, you have to use an external comparator circuit that tests if the voltage is higher than 1.25v. General purpose I/O pins can’t be used to measure voltage levels.

You can use any pin that is free for the interrupt from the comparator.

Thanks for the quick guidance.