Need help regarding opening .asc file in LTspice.

Thread Starter

Darrell_3011

Joined Jun 12, 2021
6
I have obtained a LTspice file from the net, its a .asc file but its in the form of the following text. I cannot for the life of me figure out if there's a way to convert this to schematic and run it as a simulation file. Please help.

Version 4 SHEET 1 1180 680 WIRE -352 -288 -416 -288 WIRE -416 -256 -416 -288 WIRE 512 -208 -32 -208 WIRE -416 -160 -416 -176 WIRE 336 -144 192 -144 WIRE -352 -112 -352 -288 WIRE 192 -112 192 -144 WIRE -384 -96 -640 -96 WIRE -176 -80 -320 -80 WIRE -32 -80 -32 -208 WIRE -32 -80 -128 -80 WIRE 96 -80 -32 -80 WIRE -384 -64 -560 -64 WIRE -560 -32 -560 -64 WIRE 512 -32 512 -208 WIRE 560 -32 512 -32 WIRE 688 -32 608 -32 WIRE -352 0 -352 -48 WIRE 192 0 192 -32 WIRE -640 16 -640 -16 WIRE 336 32 336 -144 WIRE 336 32 208 32 WIRE 736 32 336 32 WIRE 864 32 736 32 WIRE 208 64 208 32 WIRE 736 64 736 32 WIRE -560 80 -560 48 WIRE 96 80 96 -80 WIRE 160 80 96 80 WIRE 336 80 336 32 WIRE 688 80 688 -32 WIRE 864 80 864 32 WIRE -352 96 -352 80 WIRE 688 144 688 128 WIRE 160 160 160 128 WIRE 208 192 208 144 WIRE 272 192 208 192 WIRE 336 192 336 144 WIRE 336 192 272 192 WIRE 736 192 736 144 WIRE 816 192 736 192 WIRE 864 192 864 144 WIRE 864 192 816 192 WIRE 272 224 272 192 WIRE 400 224 272 224 WIRE 544 224 480 224 WIRE 816 224 816 192 WIRE 816 224 624 224 WIRE 272 256 272 224 WIRE 272 256 208 256 WIRE 336 256 272 256 WIRE 816 256 816 224 WIRE 816 256 736 256 WIRE 864 256 816 256 WIRE 208 288 208 256 WIRE 736 288 736 256 WIRE -32 304 -32 -80 WIRE 48 304 -32 304 WIRE 160 304 96 304 WIRE 336 304 336 256 WIRE 688 304 640 304 WIRE 864 304 864 256 WIRE 160 384 160 352 WIRE 688 384 688 352 WIRE 208 416 208 368 WIRE 336 416 336 368 WIRE 336 416 208 416 WIRE 736 416 736 368 WIRE 736 416 336 416 WIRE 864 416 864 368 WIRE 864 416 736 416 WIRE 208 432 208 416 WIRE -32 464 -32 304 WIRE 640 464 640 304 WIRE 640 464 -32 464 FLAG 192 0 0 FLAG 688 384 0 FLAG 688 144 0 FLAG 208 432 0 FLAG 160 384 0 FLAG 160 160 0 FLAG -416 -160 0 FLAG -352 96 0 FLAG -560 80 0 FLAG -640 16 0 SYMBOL Gain 64 304 R0 SYMATTR InstName U1 SYMBOL sw 208 160 M180 SYMATTR InstName S1 SYMBOL voltage 192 -128 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName Vd SYMATTR Value 380 SYMBOL diode 352 144 R180 WINDOW 0 24 64 Left 2 WINDOW 3 24 0 Left 2 SYMATTR InstName D1 SYMBOL diode 352 368 R180 WINDOW 0 24 64 Left 2 WINDOW 3 24 0 Left 2 SYMATTR InstName D2 SYMBOL sw 208 384 M180 SYMATTR InstName S2 SYMBOL diode 880 144 R180 WINDOW 0 24 64 Left 2 WINDOW 3 24 0 Left 2 SYMATTR InstName D3 SYMBOL sw 736 160 M180 SYMATTR InstName S3 SYMBOL diode 880 368 R180 WINDOW 0 24 64 Left 2 WINDOW 3 24 0 Left 2 SYMATTR InstName D4 SYMBOL sw 736 384 M180 SYMATTR InstName S4 SYMBOL res 384 240 R270 WINDOW 0 32 56 VTop 2 WINDOW 3 0 56 VBottom 2 SYMATTR InstName R1 SYMATTR Value 10 SYMBOL ind 528 240 R270 WINDOW 0 32 56 VTop 2 WINDOW 3 5 56 VBottom 2 SYMATTR InstName L1 SYMATTR Value 100m SYMBOL voltage -640 -112 R0 WINDOW 3 -224 268 Left 2 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value PULSE(-10 10 0 0.03124m 0.03124m 0.00002m 0.0625m) SYMATTR InstName V_t SYMBOL voltage -560 -48 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName vc SYMATTR Value 8 SYMBOL Comparators\\LT1721 -352 -144 R0 SYMATTR InstName U2 SYMBOL voltage -416 -272 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName Vcc SYMATTR Value 10 SYMBOL voltage -352 -16 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName Vee SYMATTR Value -10 SYMBOL Gain -160 -80 R0 SYMATTR SpiceLine G=100 SYMATTR InstName U3 SYMBOL Gain 576 -32 R0 SYMATTR InstName U4 TEXT 648 -160 Left 2 !.model SW SW(Ron=1u Roff=100Meg Vt=90) TEXT -112 -288 Left 2 !.tran 55m TEXT -128 -376 Left 4 ;DC-DC full bridge bipolar voltage switching TEXT -112 -256 Left 2 ;Fs = 16 kHz
 

crutschow

Joined Mar 14, 2008
34,281
I looked at one of my .asc files and there is a CR (new line) after each statemen, e.g.

WIRE 464 448 464 368
WIRE 576 448 576 368
WIRE 208 496 208 480
FLAG 272 256 0
FLAG 16 160 0
FLAG 208 496 0
SYMATTR InstName R4
SYMATTR Value 5k
SYMBOL schottky 672 80 R0
SYMATTR InstName D3

and so on.

You may have to add that after each of the statements in your file.
 

Papabravo

Joined Feb 24, 2006
21,159
Hi I had pasted the text into notepad and saved it with extension .asc. But when I open it with LTspice I see a blank sheet.
Using notepad was a great mistake. What you have is an entire file on a single line. There must be line breaks in order for LTspice to understand what is going on. I don't have the patience to go and add them back in. Give me a link to it and I will see if I have better luck.
 

Thread Starter

Darrell_3011

Joined Jun 12, 2021
6
I looked at one of my .asc files and there is a CR (new line) after each statemen, e.g.

WIRE 464 448 464 368
WIRE 576 448 576 368
WIRE 208 496 208 480
FLAG 272 256 0
FLAG 16 160 0
FLAG 208 496 0
SYMATTR InstName R4
SYMATTR Value 5k
SYMBOL schottky 672 80 R0
SYMATTR InstName D3

and so on.

You may have to add that after each of the statements in your file.
Yes this worked! Thank you!
 

Thread Starter

Darrell_3011

Joined Jun 12, 2021
6
Using notepad was a great mistake. What you have is an entire file on a single line. There must be line breaks in order for LTspice to understand what is going on. I don't have the patience to go and add them back in. Give me a link to it and I will see if I have better luck.
Hi, I have added line breaks and it has worked! Thank you
 

eetech00

Joined Jun 8, 2013
3,858
Using notepad was a great mistake. What you have is an entire file on a single line. There must be line breaks in order for LTspice to understand what is going on. I don't have the patience to go and add them back in. Give me a link to it and I will see if I have better luck.
Notepad is a good editor to use (I use notepad++) because it does not add formatting or other special characters to the file that can corrupt its use in programs. The copied file didn't work because it was copied from a source that did not contain end-of-line characters.
 

Papabravo

Joined Feb 24, 2006
21,159
Notepad is a good editor to use (I use notepad++) because it does not add formatting or other special characters to the file that can corrupt its use in programs. The copied file didn't work because it was copied from a source that did not contain end-of-line characters.
How he downloaded the file is a bit ambiguous. It seemed like it was a download of a file, followed by an opening in notepad. It did not occur to me that it might have been a "cut and paste". I use notepad++ as well and abandoned notepad for the lack of features. I'm glad the TS was able to solve his own problem.
 
Last edited:
Top