72 k32
Hf,jc
HPage ##
Hz,m0,t4,jc
HPCB Drawing Aid
HBy John Coyne
Hjl,m4
H
HIntroduction
H
HThe original concept of the PCB drawing aid came from the need toHprovide a number of different small PCBs. The preparation of theseHboards can be quiet tedious and time consuming, especially if changes toHthe original drawings are necessary. The ability to draw, edit and thenHprint the masks for PCBs on a computer was very appealing.
H
HIt must be recognised that the graphics capability of the standard modelH4, or the memory and performance limitations of the model 4 when aHhi-res board is fitted does impose restrictions. To obtain the best ofHwhat is available the drawing aid only supports vertical and horizontalHlines. Angular lines were not considered feasible because of the blockHgraphic structure of the model 4. The line thickness of a track is alsoHdetermined by the block structure. Lines can be made thicker by drawingHparallel to the original line. Considering these limitations it is stillHpossible to produce quiet complex PCBs and print a scale drawing on anHEpson printer.
H
HProgram Modules
H
HP1/CMD	Main PCB drawing program
HP8/CIM	Help Module
HPCPNT/CMD	PCB print module
HPRX/CMD	Hi-res print module
HDUM/PCB	Side 1 demo drawing
HDUM1/PCB	Side 2 demo drawing
H
HPCB Size
H
HThe program will allow the creation of a single or double sided PCBHoverlays. The maximum size of each overlay is approximately 10.5" xH5.25". On the model 4 this represents 2 screens wide by 4 screens high.
H
HMemory Requirements
H
HThe PCB program was designed to run on a basic 64k model 4 and thereforeHdoes not use any additional memory. It does, however, use nearly all ofHthe available memory. The main program is located in lower memory fromH3000H to 7FFFH. The two print modules available with this program, oneHfor the standard scale PCB (PCPNT/CMD) and one for a hi-res printH(PRX/CMD if hi-res board fitted) are not memory resident. They getHcalled from disc when required. These two programs load and run in theHTPA at 2600H-3000H. The drawing area is in the upper part of the mainHmemory from 8000H-0F800H, allowing approximately 2k of memory forHvarious drivers. Please note this program does not check High$ and willHtrample over anything below 0F800H.
H
HCommands
H
HPlease note all commands must be in uppercase. The program forces theHmodel 4 to uppercase during initialisation, however, there is nothing toHprevent to user from changing case. The PCB program will not recognise aHlower case input.
H
HPCB will accept two types of keyboard input. A command level input whichHis divorced from drawing and an on-line input which can be invokedHwhilst drawing. When PCB is called up from the dos prompt the screenHwill clear and for a few seconds display a logon message. The programHwill then enter the drawing mode, displaying the drawing cursor in theHmiddle of the screen and filling the screen with whatever the drawingHmemory contains (usually rubbish). At this stage type 0, this will clearHthe screen and enter the command mode.
H
HCommand Mode
H
HThe command mode will accept a two letter abbreviated command without aHCR except X which is a single letter command and the print commandsHwhich have a parameter and are terminated with a CR. The optionsHavailable are:
H
H	X	Return to drawing mode
H	EE	Exit to dos
H	CL	Clears drawing memory
H	Rx	Set cursor repeat speed (x=1-9) default 4. 1= fast.
H	LD	Load file from disc (will prompt for filespec)
H	Sx	Save drawing side to disc (x=1 side1, 2=side2, A=all)
H		(will prompt for filespec)
H	DS	Dos command (will prompt for command)
H	Pn(x)	Print (n=1 side1, 2= side2, A= all)
H		(x=M mask only, P= PCB only, CR= mask & PCB)
H		Break = stop printing
H
HX	 Returns to the drawing mode from the command mode. The commandHmode does not change any of the drawings.
H
HEE	Exit to dos. This does not alter the drawings in memory unlessHanother program is invoked which uses memory above 8000H. The PCBHprogram may re-entered with the drawings still intact.
H
HCL	Clears the drawing area by filling the drawing area with 80HH(graphic space) and return to drawing mode.
H
HRx	Changes the drawing speed of the cursor, 1 = fastest, 9 slowest,Hdefault to 4.
H
HLD	Will load a previously saved PCB drawing. This command will promptHfor a filespec. NOTE: No checks are made to ensure the program is loadedHin the correct area. It will take any valid dos filespec. A previouslyHsave drawing will always load in its correct place, however, a none PCBHprogram may overwrite the drawing program.
H
HSx	Will save the specified drawing side to disc. A filespec will beHprompted for.
H
HDS	A dos command may be executed whilst in the drawing program,Hhowever, these command should only be library commands which use theHTPA. Other programs may overwrite the drawing program.
H
HPn(x)	This command will send to the printer any drawing specified by theHparameter. The sides of the drawing to be printed are specified by n. 1=Hthe drawing area from 8000H to 0AC00H which is the first side. 2= side 2Hfrom 0AC00H to 0F800H."A" will select both sides.
H
HIn order to provide a rudimentary silk screening mask and also toHprovide some reference point on the PCB, a means of printing charactersHon top of the PCB, or separately, was catered for. The x parameter willHallow the selection of this screening mask. "M" will select theHscreening mask only. "P" will only print the PCB and CR (default) willHprint both. On completion of the print run the drawing mode isHre-entered.
H
HOn-line Commands
H
HThe following commands will be accepted at any time whilst in theHdrawing mode. Break will cancel a partly completed command.
H
HArrows:-
H
HUp		Draw up
HDown		Draw down
HRight		Draw right
HLeft		Draw left
H
HShift up	Erase up
HShift down	Erase down
HShift right	Erase right
HShift left	Erase left
H
HClear up	Move up one line
HClear down	Move down one line
HClear right	Move right one line
HClear left	Move left one line
H
HShift clear	Clears screen
HCtrl F	Flips to other side of pcb
H
HNxx		xx pin narrow connector
HWxx		xx wide connector
H
H0		Entry to command mode
H
HM		Masks screen display
HE		Erases mistakes by copy memory to screen
HC		Copy screen to temp. buffer
HD		Copy temp. buffer to screen
HG		Grid mask
HK		Kill grid
HPxx		Prints dil sockets
HZ		Zap Screen Editor (cursor = +)
HL		Automatic line
HH		Hires screen
HS		Special character - allows entry of ASCII characters
HX		Delete line at cursor as far as next break in the line
H?		Help screen
H
HArrows	The plain arrow keys will move the cursor in the directionHof the arrows drawing a line. If the cursor strikes the edge of aHscreen, and there is more drawing area beyond the edge of the screen,Hthe screen will move over the drawing surface until the edge of theHdrawing area is encountered. At this point the cursor will stop. FurtherHprompting towards the edge of the screen will be ignored.
H
HShifted Arrows	The shifted arrows are the reverse of the plainHarrows. The cursor will erase any white area in the direction of theHcursor path. Movement is the same as the plain arrow.
H
HClear Arrows	 Whereas the previous arrows move the cursor, the clearHarrow moves the screen leaving the cursor in position relative to theHscreen. The cursor does not draw and is non-destructive. This functionHsimply moves the cursor quickly to another part of the drawing.
H
HShift Clear	This command will clear the drawing area on the screenHonly, the remainder of the drawing area is not affected.
H
HControl 'F'	Ctrl 'F' flips to the other side of the drawing board. TheHcursor position will remain identical on both sides of the boards. InHother words if a 16 pin dil socket is printed on one side, the sidesHflipped over and another 16 pin socket printed the resultant PCBHoverlays could be used for plating through.
H
HNxx (Narrow)	This will draw from the current cursor position, goingHright, xx number of edge connectors with 0.1" spacing. xx is a two digitHinput, therefore for two connectors the input must be N02
H
HWxx (Wide)	Will produce the same results as the narrow connectorHexcept the pin spacing is 0.2".
H
H0	This will save the current screen and enter the command mode.
H
HM (Mask)	Starting with a blank drawing board can be veryHdisorientating. Moving the screen about will leave you not knowing whereHyou are. Invoking 'M' will place markers on the drawing board which willHallow some means of identifying which window is currently on the drawingHboard.
H
HE (Erase Mistake)	It is important to understand how the screen toHmemory function is handled to make maximum use of any editing facility.HAll drawings are stored in memory and are move to and from the screenHwhen required. It is the movement of the screen that saves and recalls aHsection of drawing area, therefore any work done in a screen is not saveHuntil the screen it is moved. If you want to save the screen at variousHstages of development and the screen has not been moved simply use theHclear arrow once and it will have been saved. What 'E' does is toHreplace the current content of the screen with what is in memory,Htherefore it will take you to the point the last time the screen wasHmoved.
H
HC (Copy Screen to Temporary Buffer)	The content of the screen is savedHin a special area for subsequent recall. This special area can beHrecalled from any screen position on either side of the 'PCB' andHwill place itself into that area of the drawing.
H
HD (Dump Temporary Buffer to Screen)	This is the recall function of aHpreviously saved screen. Please note this function will always copy aHFULL screen. Small copy functions are covered in the Zap function.
H
HG (Grid Mask) For Hi-res Boards Only	This facility is provide to aidHalignment on a screen. It does not interfere with normal drawing. TheHgrid will not be printed if print is invoke while the grid is active.HAny form of exit form the drawing mode will remove the grid.
H
HK (Kill Grid)	Removes the hi-res grid.
H
HPxx (Pins)	P will create an xx number DIL socket pads if xx is even,Hor xx number of single line pads if xx is odd. The cursor position isHthe left hand lower pad on a DIL socket, or the left hand pad for an inHline row. P08 will create a 8 pin DIL socket at the current cursorHposition. If the cursor is at the edge of the screen and there is moreHdrawing area beyond the edge the screen will move to accommodate theHspace required. If there is no space beyond the edge of the screen onlyHthose pads that will fit will be created. The xx is a two parameterHentry, therefore single digits must be padded with a 0 eg. a 8 pin DIL =HP08, a 16 pin DIL = P16. Break will terminate a partially completedHcommand.
H
HZ (Zap (running short of meaningful single characters))	So farHeverything has a global effect on the drawing and can be accordinglyHcumbersome. Zap has been provided as a flexible screen editor and willHwork within the screen boundary only. When invoked the cursor willHchange to a '+' and become non-destructive. Using the arrow keys theHcursor will rapidly move around the screen. On striking the right orHleft edge the cursor will wrap around, the screen will not move. TheHscreen editor has its own set of options and are as follows:
H
HBreak	Exit Zap and return the cursor to where it was on entry.
H
HP	Exit Zap and leave the cursor in its current position.
H
HZap has the ability to manipulate small areas within a screen boundary.HThese commands are termed block commands.
H
HBlock Commands within Zap
H
H'('	Start of a marked block
H')'	End of a marked block
H
HThe block can be any size within the boundaries of the screen. '(' isHconsidered to be the top left hand point of the marked block and the ')'His the bottom right hand point of the block. The area within this blockHforming a rectangle is the marked block. A single line can be marked byHplacing the markers at the left and right of the line or part of line.HOnce a block is marked the following command may be implemented:
H
H'D'	Delete a marked block
H
H'S'	Save the marked block in a special buffer for subsequent recall.HThis buffer is independent from the previous full screen special buffer.HOnly one block may be save at a time. Further saving will overwrite theHcontent of the buffer. The buffer will remain valid when Zap has beenHleft and returned to the drawing mode. The buffer can recalled when ZapHis re-entered in another part for the drawing area. This facility willHallow the transfer/ copy of small parts of a drawing to another area.
H
H'R'	Recall places the block in the special buffer at the currentHcursor position. In this instant only the area saved will be recalledHeg. if only one line was saved only one line will be recalled.
H
H'O' 	Overlay is another mode of recall, however, this time the recalledHblock stay attached to the cursor and any movement of the cursor movesHthe block with the cursor. Break will finally place and detach theHblock. Overlay overlays the current screen position with the block. 'O'Hwill change the cursor to '*'.
H
H'I'	Interleave is exactly the same as overlay except the white area ofHa block will interleave with the content of the current screen.
H
H'E' 	Erases the block recalled by 'R', 'O' or 'I' providing the ZapHmode has not been left.
H
HOn returning to drawing 'E' may be used to delete all the work doneHduring a Zap providing the screen has not moved since leaving the ZapHmode. 
H
HL (Automatic Line Drawing)	An automatic line drawing facility wasHdeveloped as an experiment and has been left in the program. It is farHfrom perfect, but it proved an interesting experience and can beHused with varying degree of success. The means of a line finding its wayHaround a cluttered board without over-running a line was not difficult,Hbut to stop a line from tying itself in a knot proved very difficult.HWhat is left in the program is a compromise between keeping the programHsize within limits and performance. The line drawing routine can linkHsome quiet difficult points but success is not guaranteed.
H
HTo start the autoline function place the cursor at the start point andHpress 'L'. Nothing is visible, it is simply noted as the start point.HMove the cursor to the end point and again press 'L'. The autolineHprocess will now attempt to link the two points. The lining processHdefaults to invisible for performance reasons, however, providing partHof the path used during linking is on the screen 'F1' can be used toHtoggle between visible and invisible. During invisible lining process aHmarker flashes at the top right corner of the screen showing the numberHof different attempts made to join the line. If successful, the joinedHlines will become visible, if unsuccessful the cursor will re-appearHwithout a connection. The drawn line may need tidying up. IfHunsuccessful it made be necessary to draw smaller line first, assumingHof course it is possible to form a link.
H
HIf the line appears to take to long, or it is required to terminate theHprocess press 'F3'. Do not press Break during the lining process, itHwill exit to dos. If this does happen simply reload the PCB program. TheHdrawing will not have been lost.
H
HWhen setting up the start and end points for autoline ensure theHcursor is NOT in contact with another line. During the linking processHan unsuccessful line will be deleted and it will be deleted up to theHfirst break in the line. If there is no break at the start of the newHline, delete will carry on deleting the old line too.
H
HX (Delete Line)	To delete an existing line, place the cursor atHthe one end of the line and press X. The line will automatically beHdeleted. As mentioned in the previous paragraph there must be a break atHboth ends of the line. If during the delete a junction is encountered inHthe line, a scan will start clockwise from the current cursor positionHand the first line encountered in the scan will be used to continue.
H
HS (Special Characters)	This command will change the cursor to '$'Hand can be used to include alphanumeric characters in the drawing. TheseHcharacters can be included in any printout if the print option isHselected with the default (CR (enter)) in the () or with (M) for theHmask only. Although there is no limit to the length of string enteredHusing the 'S' option, the string must be kept as short as possible. WhenHprinting the PCB the printer is operating in the dot addressable mode.HAny alphanumeric character encountered on the print line will force theHprinter back into normal mode, print the character and go back to dotHaddressable graphics. There is an obvious character alignment problemHwhen using this method, however, to reduce this problem four differentHreference points are used across a line, but this will still no resolveHthe long string problem. When placing characters in a drawing theyHshould not be placed in a confined space. Mis-alignment may cause theHcharacters to overwrite parts of the drawing. Characters will lookHalright on the screen, the problem occurs when printing, however, itHwill still produce useful results. Break will return to the drawingHmode.
H
H?	This provide a basic on-line help screen. Break will return to theHdrawing mode
H
HH (Hi-res)	This facility should only be use if a hi-res board isHinstalled.
H
HWhen working on a PCB which covers a number of screens it frequentlyHnecessary to be able to view the whole board, both sides. 'H' from theHdrawing mode will condense the PCB, both sides, onto one hi-res display.HThis hi-res mode also provide a number of useful options.
H
HClear Up & Down Arrows	Unfortunately, if the full drawing area isHused the bottom few lines of the PCB will not fit on one screen. TheHclear arrows will scroll the hi-res screen up and down to show the lastHfew lines.
H
HShift Up & Down	These arrows will rotate the hi-res screen throughHits buffers in a circular fashion.
H
HPlain Arrow	On entry to the hi-res screen a '+' will appear as aHflashing cursor in the top left hand corner of the screen. This cursorHis used as a marker. It can be moved around the screen, but only in theHleft hand portion of each of the visible PCBs. If the cursor move acrossHa boundary it will jump into the first half of the other PCB. ThisHcursor is used in conjunction with the 'M' option when returning to theHnormal drawing screen. The cursor should be placed on the part of theHhi-res screen of interest. Using the 'M' option will now return to theHdrawing mode with the cursor position selected in the hi-res mode beingHthe top left hand corner of the drawing screen. Automatic side selectionHwill take place depending on which side was selected.
H
HBreak	This is the standard return from the hi-res mode. It will returnHto position from which the hi-res option was selected.
H
HP (Print)	'P' will provide a hi-res print of the complete drawingHarea. Note alphanumeric character will not be displayed in hi-res mode.
H
HSummary of all commands
H
HP1(x)	Print PCB side 1.
HP2(x)	Print PCB side 2.
HPA(x)	Print both sides.
H	(x)	(M) Mask (writing only)
H		(P) PCB only (no writing)
H		(enter) All
HBreak stops printing
H
HRx	Set cursor repeat speed (x = 1-9)
HCL	Clears all drawing from memory
HX	Returns to drawing from command mode
H
HEE	Exits to DOS
HS1	Saves side 1 to disc
HS2	Saves side 2 to disc
HSA	Save both sides to disc
HLD	Load file from disc
HDS	DOS command
H
HOn line commands
H
HArrows:-
H
HUp		Draw up
HDown		Draw down
HRight		Draw right
HLeft		Draw left
H
HShift up	Erase up
HShift down	Erase down
HShift right	Erase right
HShift left	Erase left
H
HClear up	Move up one line
HClear down	Move down one line
HClear right	Move right one line
HClear left	Move left one line
H
HShift clear	Clears screen
HCtrl F	Flips to other side of pcb
H
HNxx		xx pin narrow connector
HWxx		xx wide connector
H
H0		Entry to command mode
H
HM		Masks screen display
HE		Erases mistakes by copy memory to screen
HC		Copy screen to temp. buffer
HD		Copy temp. buffer to screen
HG		Grid mask
HK		Kill grid
H
HPxx		Prints dil sockets
H		Even no. pins = socket (max 52 pins)
H		Odd no. pins = single line
H
HZ		Zap (cursor = +)
H		( = start of marked block
H		) = end of marked block
H		D = delete marked block
H			on return to main screen 'E' will
H			return original screen (if required)
H		Break = return to normal screen
H		S = save marked block (remove markers)
H		R = restore previously saved block( must use
H			I or O first) 
H		(O = overlay, move block around screen) 
H		(I = interleave, move block around screen)
H		(E = erase block recalled by I/O)
H		Break = return to zap mode
H
HL		Automatic line
H		Break = Exit to DOS
H		F1 = Toggle between show drawing/show only result
H		F3 = Break Exit back to PCB
H
HH		Hires screen
H		clear up arrow bring next lower part of mem to screen
H		clear down arrow next upper part of mem to screen
H		shift up arrow scroll screen buffer
H		shift down scroll screen buffer
H		break return to drawing
H		
H		up	)
H		down	) moves cursor around hi-res area for
H		left	) marking on return
H		right	)
H		
H		M = Marks current cursor position as top left hand
H			screen position on return to normal drawing.
H		P = Prints hi-res screen.
H
HS		Special character - allows entry of ASCII character
H			for marking drawing area. It is an aid to
H			drawing only, however, can be printed if
H			the print parameter is selected. These 		H			characters are not displayed on the hi-res
H			screen.
H
H			Break returns to drawing
H
HX		Delete line at cursor as far as next break in the line
H
H
H
H  