2020-06-12 05:33 PM
In Cube, setting the Comparator to work with the DAC requires the DAC to be set as a GPIO however, I'd like to use the GPIO pins for other tasks, is this possible or does the DAC need to output on the GPIO for the comparator to work?
2020-06-12 05:49 PM
I imagine this is supported by the hardware but not by CubeMX. Likely just re-running HAL_PIN_Init on the affected pin in your user code will get it to work correctly without needing to modify CubeMX generated code.
2020-06-12 05:55 PM
Brilliant, thank you! I just wanted to clarify it wasn't a hardware limitation before committing to a PCB.
2020-06-13 12:26 AM
TDK did not say it *is* possible, but that it is possible that it is possible.
I'm not that sure. Read carefully the RM and errata. The RM at least has IMO contradictory informations in this regard.
In the newer 'H7 and 'Gx, where DAC output structure is different and includes explicit settings with DAC connected only internally, this does not work properly and the DAC, if switched on, is permanently connected to its respective output pin (maybe yet unpublished in official errata, but confirmed on this forum by ST) .
I would recommend you to verify this on a prototype, maybe using a Nucleo board, and perhaps communicate directly to ST.
JW
2020-06-20 01:58 PM
Just a similar example with STM32L432KBUx. While selecting pins for a new PCB in CubeMX, OPAMP settings didn't have a mode with VINP connected internally to DAC, but VINM and VOUT routed to external pins. In the real life everything worked as expected and that pin, to which VINP can be assigned, was used for other functionality.