|
|
I've benefited greatly from using a free tool from Linear Technology called Switcher CAD III or just LTSpice. I use it for comparing with my own internal mental models (the spice part of it) and as a helpful schematic capture tool (the electronics editor part.) When I'm posting schematics, I tend to do so in ASCII so that it is retained in long-term storage for later lookup by google. LTSpice schematics are in a series of specialized ASCII directives, and that can be posted. But it relies on the fact that readers are willing to take the trouble of grabbing them, getting a copy of LTSpice, and loading them up just to look at them. So it's especially nice to have some way of making them modestly visible, directly in ASCII. The downside there is that not everyone has trained their eye to 'see' such schematics well and, of course, they may be using a proportional spaced font when reading and it all looks like a mess, then. Despite that, ASCII schematics still have their place. ASCII SchematicsI'm providing a small DOS-based tool for converting LTSpice schematic files into ASCII schematics. For now, consider it only an experimental tool. The C code is working pretty well, I believe, and provides a reasonable complement of features to enable the idea. But I have NOT done much work on completing the ASCII symbol library. It's woefully short, right now, including only the most basic parts (resistors, capacitors, bjts, diodes, and inductors.) So it is only modestly usable. My reasoning for getting this "out there" is to get some feedback about its shortcomings and, perhaps, some free work from others on enhancing the ASCII library. (It's very easy to add new symbols.) I've tried to add some reasonable documentation in the source code file, so that there is a chance at understanding why I did what I did in some reasonable amount of time. Let me know if you have some specific suggestions to improve the comments or the code. This includes changes to make the program more broadly compilable or retargetable or simply just better. I've spent about one full day on this code now, so it's very much in its infancy. The code is offered freely, without much in the way of restrictions.
The executable program is in a ZIP file and is located here:
The ASCII symbol file uses a fairly simple format. The special character, ?, is used to prefix lines with special meaning. The rest is just the ASCII images for the various parts. All of the parts are stored in this single file and it is editable with any ASCII text file editor -- no special characters are required or used. The details of the format are located in the header commentary in the source file, but it's not too hard to figure it out from just looking at the ASCII part library file. Without any command line options, the program simply converts its standard input and writes the results to the standard output. With a single file specified, it writes the output again to the standard output. If more than one file is given (and you can use wildcards), then each file is converted to a .TXT version and stored as a disk file in the same directory. The files, ASC.COM and ASC.SYM, should be co-located in the same directory because the program automatically searches for the symbol file in the same directory it is located. Also, you can freely rename these two files, just so long as they both have the same name -- the program doesn't assume any particular name. I've used this program for a few months and it is quite satisfactory for my needs. It does NOT have a complete library listing by any stretch of the imagination, so it is very easy to create LTSpice programs which will include empty areas in your output because the shape is simply missing from the ASCII library. I am considering some way of reading the symbol files from LTSpice with an eye to some kind of 'smart' ASCII conversion, but the inspiration hasn't yet arrived. So a separate ASCII symbol library remains a need, for now. I don't think this is necessarily a serious drawback, because engineers often find their schematic packages requiring them to build package libraries and the like. But hopefully, I will find a good way to convert the symbol files and avoid the whole issue. Until then, it is what it is.
Here's an example for the output from a small schematic I drew in LTSpice: PRIMARY SPECIFICATIONS +12V +5V .param Vbb=12V --------------------- | | 2 supplies available, | | .param Vcc=5V + the relay uses 10mA | | @ 12V, ctrl is 0 to 5 --- --- .param ILoad=10mA --------------------- - V1 - V2 --- {Vbb} --- {Vcc} - - | | DESIGN ESTIMATIONS | | | | .param Q1Vbe=0.6V Q1beta=200 gnd gnd .param Q2Vce=0.2V Q2Vbe=0.7V Q2beta=50 +12V | .param IR2=0.1*Q2Ib | | +12V \ | / R2 | DERIVATIVE CALCULATIONS \ {R2} | / | .param Q2Ic=ILoad Q2Ib=ILoad/Q2beta | | | | .param Q1Ic=Q2Ib+IR2 Q1Ib=Q1Ic/Q1beta | |<e Q2 +--------| 2N3906 .param Q1Ie=Q1Ic+Q1Ib | |\c | | | | |/c Q1 | RESISTOR VALUES +5V---| 2N3904 \ |>e / R3 .param RLoad=(Vbb-Q2Vce)/ILoad | \ {RLoad} | / .param R2=Q2Vbe/IR2 | | | | SIM .param R1=(Vcc-Q1Vbe)/Q1Ie \ | BUZZER / R1 | \ {R1} | / gnd .tran 1m | active low | active low sim CTRL------------------' ,----------------CTRL | gnd If you want, you can download the exact LTSpice file that I used for the above diagram, here. You can run it just fine and check out the values generated.
Feel free to email me. Last updated: Friday, January 06, 2006 09:36 |