MCU PWM

I want to mimic an MCU PWM output.

I have a had a good look around but I am still none the wiser. For some reason the PWM module always seems to output at 5v even when I set it to 3.3.

Can someone point me in the right direction.

by StuntMonkeh
May 20, 2014

Vin min and Vin max refer to the voltages that set 0% and 100% duty cycle.

They have no effect on output voltage.

The CL PWM element has no supply input and produces a set 0 - 5V output swing.

If you need a lower output voltage swing then you could simply pot it down using resistors or scale and offset it (in the sense of y=mx+c) using a behavioural voltage source.

If you net labelled the PWM source output as pwmout then using a voltage source with an expression along the lines of:

3.3/5*V(pwmout)

will give you a 0 - 3.3V swing.

(3.3-0.2)/5*V(pwmout)+0.1

will give you a 0.1 - 3.2V swing and so on.

by signality
May 21, 2014

See:

https://www.circuitlab.com/docs/circuit-elements/#behavioralsources

for info on behavioural sources and expressions.

by signality
May 21, 2014

Post a Reply

Please sign in or create an account to comment.

Go Ad-Free. Activate your CircuitLab membership. No more ads. Save unlimited circuits. Run unlimited simulations.

About CircuitLab

CircuitLab is an in-browser schematic capture and circuit simulation software tool to help you rapidly design and analyze analog and digital electronics systems.