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µ.
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
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.
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
- This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
- Home
- Design & Build
- Software Tools
- How can I do a 10 khz square wave with LtSpice ?