I need to design a circuit that can take a digital output from an MCU (3.3V) and amplify it to a selectable output voltage. The output voltage should be configurable between 3.3V, 5V, 12V, and 24V.
Additionally, the output must be able to operate in both push-pull mode and open-drain mode.
My current idea is to use two NMOS transistors with a gate driver. In push-pull mode, both the high and low inputs of the driver would be used, while in open-drain mode only the high or only the low side would be driven. The output voltage would be selected by switching between the supply rails (3.3V, 5V, 12V, 24V).
Would this approach work? What are better ways to achieve this?


