Hi
How can I generate a 10 khz square wave with LtSpice ? (50 % duty cycle)
And how for a 31 khz square wave ?
Thanx
Paul
How can I generate a 10 khz square wave with LtSpice ? (50 % duty cycle)
And how for a 31 khz square wave ?
Thanx
Paul
Hi
I don't know how to set the LtSpice pulsed voltage source for those frequency square waves.
Thanx
Paul
I don't know how to set the LtSpice pulsed voltage source for those frequency square waves.
Thanx
Paul
You can leave Ncycles alone since thats only how many cycles it'll give before it stops, leaving it blank will make a continous pulse train.
On Nperiod you put in the equivalent time for 31 kHz and Ton will be half of that value to define 50% duty cycle.
Rise and fall can be set to 1µ.
On Nperiod you put in the equivalent time for 31 kHz and Ton will be half of that value to define 50% duty cycle.
Rise and fall can be set to 1µ.
Tperiod would be 1/31000.
Ton will be half that
You may do:
Ton = {0.5/<value in Hz>}
and
Tperiod = {1/<value in Hz>}
I would also use rise/fall times of 0.01u as this will give you a "perfect" square wave with no percievable rise/fall time.
Ton will be half that
You may do:
Ton = {0.5/<value in Hz>}
and
Tperiod = {1/<value in Hz>}
I would also use rise/fall times of 0.01u as this will give you a "perfect" square wave with no percievable rise/fall time.
for symmetry you need to set Ton = (1/2)*(1/f) - t_rise
use curly brackets, .param to save typing
Hi
I've try your param but it was not work ok.
Can you show me a capture image of the LtSpice Fonctions window showing the pulse parameters.
Thanx
Paul
Last edited:
clik on the attachment thumbnail?
the line:
.param f = 31k, t_edge=1u
has to be entered in the <.op> tool pop up window (far right on toolbar)
the line:
PULSE(-1 1 0 {t_edge} {t_edge} {1/2/f-t_edge} {1/f})
is the "value" entry for the Vsource, usually entered in the dialog window but can be pasted in the pop up box when rt clking on the value
[edit: paste the line in a Vsouce "Value", then rt cik Vsource body, you will see filled in parameters in window]
add new named params to control additional sources, you can have f1 = 10k, f2 = 31k on the same schematic with the Vsources each using the appropriate parameter name
the line:
.param f = 31k, t_edge=1u
has to be entered in the <.op> tool pop up window (far right on toolbar)
the line:
PULSE(-1 1 0 {t_edge} {t_edge} {1/2/f-t_edge} {1/f})
is the "value" entry for the Vsource, usually entered in the dialog window but can be pasted in the pop up box when rt clking on the value
[edit: paste the line in a Vsouce "Value", then rt cik Vsource body, you will see filled in parameters in window]
add new named params to control additional sources, you can have f1 = 10k, f2 = 31k on the same schematic with the Vsources each using the appropriate parameter name
Last edited:
Hi
I was meaning the LtSpice Fonctions window like the image I show here.
Thanx
Paul
I was meaning the LtSpice Fonctions window like the image I show here.
Thanx
Paul
Attachments
Last edited:
tessier,
Can't you figure out the period of a 31 KHz square wave? If not, you have a lot of work to do before you will learn anything from LTspice.
Rick
Can't you figure out the period of a 31 KHz square wave? If not, you have a lot of work to do before you will learn anything from LTspice.
Rick
Hi
The 31 khz square wave are working but it's all down on the negative side like you can see in my image.
I've only used Ltspice with sine wave in amps simulations.
Thanx
Paul
The 31 khz square wave are working but it's all down on the negative side like you can see in my image.
I've only used Ltspice with sine wave in amps simulations.
Thanx
Paul
Attachments
Last edited:
OK Paul, here's some useful information. The period of a 31 KHz square (or sine) wave is 1/31 KHz=3.226 us. So to make a 31 KHz square wave in LTspice set Tperiod=3.226us, trise=.01u, tfall=.01us, and Ton=1.6us.
OK Paul, here's some useful information. The period of a 31 KHz square (or sine) wave is 1/31 KHz=3.226 us. So to make a 31 KHz square wave in LTspice set Tperiod=3.226us, trise=.01u, tfall=.01us, and Ton=1.6us.
Hello sawreyrw
There is a small typo error.
1/31 KHz should give 32.26 us
Bye
Gaetan
yes it shows some more advanced spice feautures, but I thought I was clear on how they can be copy/pasted from my post
learning how to get the Spice SW do the calculation seems worth the complication if you're using oddball frequencies with primes too big to count on fingers in their factorizations
learning how to get the Spice SW do the calculation seems worth the complication if you're using oddball frequencies with primes too big to count on fingers in their factorizations
- Status
- Not open for further replies.
- Home
- Design & Build
- Software Tools
- How can I do a 10 khz square wave with LtSpice ?