Circuit Design

By Richard Dimond

Originally published in EUG #23

I was recently sent a simple CAD program written for the BBC DFS and asked if I could make it work with ADFS at &1D00.

It needed several modifications to save memory and, although my first version worked well, I felt that it was rather limited as there were only eight preset components. While it was fairly easy to redefine these, it was not possible to add further ones because of the limited memory.

I then thought of using overlays to enable the data for the components to be changed. This now works well and you can change the data without losing the drawing that you have already done.

I have made up two DATA files (CD and CD2) which give you a choice of thirteen components plus three items to modify components. These are all shown by loading a circuit file named COMPS. This shows the filename and the key to press for each one.

Should you BREAK out of the program, you must CHAIN it again from the disk. This is because, after the DATA file is loaded, the value of top$ is altered with the added file and another file is added on top of this and a 'Bad Mode' error is given.

The function keys are used for the following:

  f0:Toggle between Text and Graphics modes
f1:Shows the direction in which the component is drawn
f2:Turns the Erase facility ON/OFF
f3:Turns the Link facility ON/OFF
f4:Turns the Node facility ON/OFF
Shift-f5:Clears the screen
f6:LOADs a Circuit file
f7:SAVEs a Circuit file
f8:Dumps to printer
f9:LOADs the DATA files
 

When the program is first loaded, you will be asked to enter a DATA filename. The main display screen will then be shown. This shows two windows. The top window shows the f0 - f4 function key flags and other messages. The lower is the drawing area.

The flags should show:

  Text/Graphics:G
Erase:0
Link:0
Node:0
 

The components represented in each file are shown below, together with the key to press.

 File CDFile CD2
ADiodeZener Diode
BOp. AmplifierLogic gate
CTransistorArrow )
DFE TransistorArrow ) see note below
EResistorArrow )
FCondenserElectrolytic Condenser
GInductorIron Cored Inductor
HTransformerIron Cored Transformer

The arrow options C, D & E in file CD2 together with the components can enable the distinction between NPN and PNP transistors also to set up variable and preset condensers, resistors and potentiometers by drawing them over the component.

To link components together, press f3. The link flag will turn to 1. The link is drawn by the rubber-band drawing procedure. Move the cursor to the start position and press COPY. Then move to the end position and press COPY again. When the linking is finished, press f3 again to turn the facility off.

To insert a node, press f4. The node flag will turn to 1. Move to the position required and press COPY and, when completed, press f4 again to return to the drawing mode.

Mistakes can be corrected by pressing f2 to turn on the erase facility and re-draw the component, line or node at the same position.

The DATA files can be changed using f9 and entering the filename. The drawing will remain so that all components can be drawn.

Drawings can be SAVEd using f7 and re-LOADed with f6.

New DATA files may be written a in similar manner to those included. The eight components must be allocated to lines 1110 to 1190 in steps 10 and the first data is Z%, the number of commands, followed by the groups of three values. The total length of the file must be less than &500. This is the length of the memory reserved between TOP and LOMEM.

Richard Dimond

Way back in the "Good Old Days" before I got into computers, I was an electronics buff. Like many electronics buffs, I saw computers as a means of controlling my electronics projects and didn't really bother to buy one since I could get enough control without one.

I got my first computer, a Jupiter Ace, because I wanted to compile a database of electronic circuits which I had aplenty but could never find when I needed one. Of course I never did find the right software, even when it was available, as it was either too expensive or unsuitable for my machine.

When I received this program, my heart literally jumped! My Elk can use DFS so that wasn't really a problem but I passed it to Richard in the hope everyone could use it.

Now I must say that Richard has done us all proud yet again. The program I sent him couldn't print out and had only a few symbols. His version is first class.

Gus Donnachaidh, EUG #23