It is also possible to connect a special driver chip to the output end of the single chip microcomputer. I once made a board, using MAX4426/4427 as the driving chip of PWM, which can greatly improve the amplitude of PWM signal and drive the power switch tube.
Besides, I tried another simple idea.
In the figure, two diodes are used to clamp the output voltage. If the on voltage of the diode is 0.7V and the input PWM voltage is 0-2V, the output voltage of the test terminal is1.4V-3.4V. ..
The power supply voltage should be greater than 3.4V, and the test terminal voltage will not change with the change of power supply voltage.
For reference only. . .