How can I connect an analog pin to an ADC and a comparator?
HuEl_264296 Jan 14, 2023
Hi,
I would like to sample an analog input pin with an ADC, but also generate an interrupt if the pin voltage falls below a certain level. So I wired up my schematic like this:

However, it won't build, giving the error message:
Net_453 is expected to connect to only one GPIO analog pin but instead it connects to \Comp:ctComp\. Please fix the connection.
When I wire the comparator to a separate pin, it builds fine.

But this isn't want I want.
What I can't understand is why this limitation is there. Looking at the analog layout, I can see that the GPIO pin could be connected to both the comparator and the ADC. The connection is right there, circled in red in this image:

If only that connection could be enabled, the pin would connect to both.
Is there any way to connect the pin to both the comparator and the ADC?
Is there any other way to solve this problem?
------------------------------
HuEl,
I believe that ADC_SAR_Seq is using Analog Hardware Mux to switch the channels. The picture of ADC_SAR_Seq is deceiving - there is no any Mux inside! The problem is, this Mux is not a separate piece of hardware, which has input lines to the Pins. Instead it made using actual Pins' hardware and resides inside the Pins. It is not possible to attach to the input lines, as there are no input lines! - The ADC_SAR just switches its single input between the Pins.
However, it is possible to connect Comparator to a separate Pin, and wire it externally to the desired ADC pin.