ASCII schematics from LTSpice

J

Jonathan Kirwan

Guest
I've just posted up an initial web page that includes my short program for
converting LTSpice schematics into ASCII ones:

http://users.easystreet.com/jkirwan/new/LTSpice.html

The included ASCII library file has just a few symbols in it, right now. And I
mean __just a few__!! It has two resistor orientations, 0 and 90, two cap
orientations, 0 and 90, one orientation for 'npn2', one for 'voltage' and that
is IT! It's dead easy to add more, though, with any editor program. I'm going
to work on adding the fuller complement of the more common parts as time
permits, but I thought it was more important to put out something right now and
let folks look and complain and kibitz so that it can be improved quickly before
too much time goes into the library side of things.

Anyway, full source is included (for those with MS VC 1.52C compiler) and there
is a big comment section at the top describing many details.

Jon
 
On Sun, 12 Sep 2004 22:08:16 GMT, Jonathan Kirwan <jkirwan@easystreet.com>
wrote:

I've just posted up an initial web page that includes my short program for
converting LTSpice schematics into ASCII ones:

http://users.easystreet.com/jkirwan/new/LTSpice.html
I've finally managed to add some of the basic ASCII library elements so that
most schematics will look ... about right. If you already have LTSpice you may
want to give it a try. It's still very preliminary and the ASCII symbols aren't
the best for everyone, but it will read okay I think.

The program handles netlist node names, resistors, capacitors, inductors, bjts,
mosfets, diodes, and a voltage source. No B-sources or similar stuff, yet. I
can use any feedback on how things should look and any library enhancements
anyone adds to the library file.

For now, I've just compiled it as a DOS .COM file. In the ZIP it is named
"ASCSCHEM.COM" and the library file is "ASCSCHEM.SYM". But you can move these
two files anywhere in your path and you can also rename them, just so long as
they both have the same name.

To use it, just type (in DOS):

ascschem draft3.asc

which places the ASCII schematic on stdout. Or,

ascschem *.asc

which places all of the schematics onto the same file names but with a .TXT
extension.

etc.

Here's an example from a 2Hz oscillator I had on disk:

Vcc
|
|
|
,-------+------------------+-------+
| | | |
| | | |
| | | |
| | | |
\ \ \ \
/ R4 / R2 / R3 / R5
Vcc \ 6.8meg\ 330k \ 680k \ 6.8Meg
| / / / /
| | | C2 | |
| | | || .033u | |
| | +----||--------------------+
| | | || | |
- | | C3 | |
--- V1 | | || | +-----OUT
- 5 +----------------||--------+ |
--- | | || | |
| | | .033u | |
| | |/c Q1 Q2 c\| |
| '-----| 2N3904 2N3904 |-----'
| |>e e<|
gnd | |
'------+-----------'
|
|
|
\
/ R1
\ 2.7Meg
/
|
|
|
gnd

That was directly created without any hand-intervention on my part from a
schematic I'd placed on disk more than a year ago.

Jon
 
On Tue, 14 Sep 2004 09:48:30 +0100, Terry Pinnell
<terrypinDELETE@THESEdial.pipex.com> wrote:

Presumably diagonal lines are a problem
And yes, they are currently ignored in the program. I specifically exclude
placing them, since I'm not yet sure how to emulate them in ASCII. If something
really nice comes to mind, I'll see about putting it in there. In the meantime,
use nice and neat horizontal and vertical lines. Oh, well.

Jon
 
Jonathan Kirwan <jkirwan@easystreet.com> wrote:

I've got the MOSFETs and inductors added, now. Try getting the program again.
Sorry to keep saying that, but there it is.
Thanks for that comprehensive and prompt reply. Downloaded the latest
version. Clapp.asc now shows inductors, but not the FET.

,-------------,
' |
|
|
-
,--------+----------+---- --- V1
| | | - 10.
| | | , ---
| | --- C1 | |
|( | --- 750p| |
L1 |( | | | |
100u |( | | | |
|( --- | | GND
| D2 / \ +------+
|1N4148 --- | |
| | | |(
--- C2 | --- L4 |(
--- 50p | ---1mH |(
| | | |(
| | | |
| | | |
| | | |
GND GND GND GND

I'll revisit in a week or so.

--
Terry Pinnell
Hobbyist, West Sussex, UK
 
On Tue, 14 Sep 2004 20:50:27 +0100, andy <news4@earthsong.free-online.co.uk>
wrote:

On Sun, 12 Sep 2004 22:08:16 +0000, Jonathan Kirwan wrote:

I've just posted up an initial web page that includes my short program for
converting LTSpice schematics into ASCII ones:

http://users.easystreet.com/jkirwan/new/LTSpice.html

The included ASCII library file has just a few symbols in it, right now. And I
mean __just a few__!! It has two resistor orientations, 0 and 90, two cap
orientations, 0 and 90, one orientation for 'npn2', one for 'voltage' and that
is IT! It's dead easy to add more, though, with any editor program. I'm going
to work on adding the fuller complement of the more common parts as time
permits, but I thought it was more important to put out something right now and
let folks look and complain and kibitz so that it can be improved quickly before
too much time goes into the library side of things.

Anyway, full source is included (for those with MS VC 1.52C compiler) and there
is a big comment section at the top describing many details.

Jon

Is there any reason it shouldn't compile under linux?
It won't, I'm fairly sure. It uses Microsoft-specific libraries. They aren't
complex ones (for example, _strlwr() is used to lower the case of every
character in a string) but they'd need to be replaced by appropriate functions
in the gnu library.

If not, I may have a
go to see if it can display the results of the gschem schematic program.
Okay. Of course, you'd need to change the parsing process. How hard that will
be will depend a lot on how closely aligned the schematic semantic designs are.

I can't read your site atm, which is why I haven't just done it.
Just try again, I suppose.

If you do take a whack at this, I'd appreciate any feedback on the source code
or the ASCII library layout. All these things are subject to change and
improvements. For example, there is no distinct "node point" designation in the
ASCII library for the parts, with special meaning. Instead, the source code
tries to do "reasonable things" when it sees a dash (-) or vertical bar (|) in
the image and matches it up with wires it sees in the schematic.

Jon
 

Welcome to EDABoard.com

Sponsor

Back
Top