STM32G opamps routing to ADC and to comparator
My Question: If the opamp output multiplexer is configured to connect the output pin (OPAINTOEN set to zero) then can I still use the ADC to read the opamp output?
The wording in the reference manual is ambiguous – it implies that the output is either ADC or VOUT. I’m reading DM00605707 and specifically looking at STM32G474VE.
I don’t mind if I internally route opamp to ADC, or if I enable both ADC_IN and VOUT on the same pin. Either could and probably will work.
More detail:
I have an application where I wish to route the opamp output to both the ADC and to a comparator. We need the comparator for very fast over current protection and the ADC to measure the current.
It appears that there is no internal routing from opamp to comparator, so I have enabled the opamp VOUT and then routed it back into the comparator. This is okay, although I’m surprised ST haven’t allowed for this connection internally.
My guess is that I should be able to do what I am after, because it seems like a pretty obvious thing to do and the ST designers do a pretty good job of designing their chips. Furthermore, the CubeIDE lets me configure it this way.
An alternative which will also work great would be to connect both ADC and opamp VOUT to the same pin. Eg, I could configure pin PA2 as OPAMP1_VOUT, and then enable ADC1_IN3 on the same pin.
If I cannot connect both ADC and VOUT pin to the opamp concurrently nor use common pins I am likely to run out of spare pins.
