LTSPICE - How to create PWM with rise time
The proposed methods will work, but you're much better off using a dedicated element for this job: [Digital]/diffschmitt:



You can specify separate rise and fall times through trise and tfall. For more about it, see the help, LTspice &gt; Circuit Elements &gt; A. Special functions.