4,294,967,296 vectors should take over a year to draw, even at 100 per second. However if you want to try — the ETI Graf-vec will do it.
THIS PROJECT takes us away from the familiar world of the TV display and shows us instead the other principal means of producing a picture. The ordinary TV set produces a picture by moving an electron beam backwards and forwards across a phosphor coated screen so that it traces a fixed number of paralle horizontal lines. The actual picture is produced by turning the beam on to display a bright dot at the right time and turning it off where no light is required. This method works very well for broadcast pictures, but is sometimes not so good for pictures generated electronically. For a home computer to generate a picture, it must generate a pattern of bits which determine when the electron beam in the display tube is to be on and off. Since the transitions can only occur at discrete time intervals, the picture produced does not always appear as smooth as we might wish. This effect is usually most noticeable on diagonal lines where there are marked contrast changes.
While we cannot pretend that this project will replace a TV type of display for home computer applications, it does provide an interesting alternative output device for graphics.
The method employed by the Graf-vec in producing a picture is to define the start and finish of a line and cause an electron beam to traverse the intervening space relatively slowly. Drawing many such lines in a short space of time allows us to build up a picture. The main disadvantage of this method is that if too many lines are drawn the whole display will appear to flicker. This can be reduced by the use of long persistence phosphors if available.
As described, the Graf-vec will draw lines between any two points on a 256×256 grid. The relatively simple circuitry used does not compensate for differing line lengths changing the brightness but still gives an interesting result.
The Circuit
The circuit consists of a power supply, digital input and control section, and two linear scan generators. The basic mode of operation requires a data source — probably your trusty home computer — to put two bytes of data into the device to represent the co-ordinates to which a vector is to be drawn (The starting point is assumed to be where you are now). The Graf-vec will draw the vector and then wait for the next set of data and indicate that it is ready. The digital input circuitry of the Graf-vec is designed so that one byte of the next vector can be input at any time as it is stored in a latch, but the second byte should only be put in after the status bit is detected as high as this will start the next scan.
When the second byte of a new vector is written in, the logic section generates a 400 uS enable pulse for the linear scan generators. This allows them to generate the linear voltage ramps which eventually move the spot around on the oscilloscope or other display device.
Once the 400 uS pulse has finished, the linear scan generators are set up ready for the next vector and the display enable or blank output will go low. If you have the facility available, this can be used to blank the display between vector scans or, by means of the internal latch accessible by writing to two further addresses, the display can be turned on and off to allow you to move position without drawing a line.


The Linear Scan Generator
This is the heart of the whole system and is basically an integrator. Before each scan starts, the output voltage and the voltage stored on a sample and hold circuit are clamped to the current output from the D to A circuits. When a scan starts, the sample and hold circuit changes to its hold function and the output is unclamped. Since the output is closely associated with the integrator capacitor it does not change immediately.
The D to A circuit now changes its output voltage to the new value and a current is generated which is proportional to the difference between the old and new input voltages. This current is used to charge the integrator capacitor and will do so at a constant rate. This gives a linear voltage ramp between the old output voltage and (if set up properly) the new one.
At the end of the scan pulse the sample and hold circuit and the output voltages are again clamped in readiness for the next scan. Note that while in the clamped state there is ideally no current flowing in the output circuit of the current generator as its input voltages are equal.
Semi-Solid Section
This is about the interface between the hardware described in this project so far and the software needed to make it do anything interesting. Fig. 6 shows in flow chart switch the actions needed to form the display. In order to prevent a lot of flicker, the routine scans all the points in the display many times each time it is called. The main cause of any residual flicker is the relatively slow response of the BASIC program which calls it. If this too were in machine code a very smooth display could result.
Table 1 shows how the flow chart is implemented in Z80 code while Table 2 (up to line 45) is the ZX81 basic program which is used to control it. Lines 50 onward are a simple program which allows hexa-decimal codes to be typed into the machine which are then held in the REM statement in line 10.
For initial entry of the machine code, alter line 50 to read:—
50FOR K=16514 TO 16543 Then you can run the program from line 50 and input the program code. Changing line 50 back again will let you type in the data for the picture. The format for typing hex numbers in is two characters 0 to 9, A to F followed by newline. Wrong characters or wrong number of characters will require re-entry of the correct ones. To abort this entry mode type a single space and newline. When first entered, line 10 can be REM with at least 64 characters after it.
While the development work for the project was done on a Z80 system, there is no reason why any other processor could not used. The only differences would be in the actual interface hardware and the machine code realization of our flow chart. There are 8 data lines, 7 control lines and one status output to the project. Normally the data lines will be connected to the controller’s data bus. The status output line is from a three state buffer and can be connected to the data bus (we used bit 7). One of the remaining control lines is devoted to reading the status bit and must go low when a read operation is required (on a 6502 system it could be tied low permanently as the read and write are controlled by the same line). Of the remaining 6 control lines, one must be high and two must be low before anything happens. These would normally be used as select lines. The last three lines are used to select the operation to be carried out. One of these should be the R/W or similar function while the others will be simple address lines to select the particular operation to be performed. Exactly how these various lines are connected will depend on your particular requirements but Table 3 shows how we did it for a ZX81.
Construction
This should cause no headaches as it is quite straightforward. First of all, decide whether you want to use the PCB as it is or to split it into two parts (it might be tricky to cut it once the parts are assembled!). Note that there are eighteen links on the main board and five on the power supply, and begin by inserting these, the resistors, and the IC sockets. We recommend the use of sockets if only because some of the devices are expensive and therefore worth protecting… Next, fit the smaller capacitors, potentiometers, and sockets, followed by the power supply diodes, resistor R1 (mounted 6 mm above the board), larger capacitors, fuse, and power connector. Finally, fit the transformer and insert the ICs into their sockets. Check that the ICs and capacitors are mounted the right way round.

Test the power supply section fully before connecting it to the other board and BE CAREFUL, there is HIGH VOLTAGE present. If all is well, all that remains is to wire the PCB connectors to suit your microcomputer or whatever and then connect up.
Setting Up
If you have an oscilloscope at hand — you need one for the display — set up the sample driver program or something similar on your computer and check that you get negative going pulses on the outputs of IC7 pins 15, 14 and 11. (this could change if you use a different jumper pattern for a different computer interface.) Set VR1 to give a low pulse period of 400 us at pin 4 of IC8.
Check the outputs from IC13 with the oscilloscope. These should consist of straight line segments with no sudden jumps. If this is not the case, adjust VR2 and VR4 for the X channel and VR3 and VR5 for the Y channel. VR2 and VR4 are effectively offset controls which tend to have the effect of shifting the lines in one direction whereas VR3 and VR5 are gain controls which increase the slope of the lines in whichever direction they happen to be going. The proper setting of these controls is vital to the production of a good display. If you have difficulty setting them, set up the data in the display table to be 00,00,FF,FF etc. This will give a repeating full scale display.
When the controls have been set up reasonably, run the demonstration program and set the ‘scope to X-Y mode. You should now have a moving display. Final trimming of the pots may be made to clear up any visible defects. If you do not have an oscilloscope, connect up the device to whatever you are using for a display, set all pots to mid travel and run the demo program and tweak for best results.
HOW IT WORKS
The Graf-vec consists of three major parts. The first of these is a straightforward stabilized power supply giving ± 12 V and +5 V at about 100 mA each. Only one transformer is used, to save on cost and space. The output is regulated by three IC stabilizers which often need no heatsink in normal operation. However, R1 is provided to dissipate some of the excess power in the +5 V regulator, and a small piece of aluminum would not go amiss.
The second major part consists of the logic, timing and digital to analogue conversion. IC7 is a 74LS138, 1 of 8 decoder whose inputs are available at the input connector. This enables simple interfacing to some computers systems without additional circuitry. The outputs from this device are all available on the board via links and are used to enable the other logic functions. The first output drives the strobe input of a 74LS374 (IC4), which is an octal latch with three-state outputs. The outputs from the device are permanently on in this circuit and it is used to store the data corresponding to the X vector before it is loaded into the DAC (IC5).
The next output from IC4 has two uses. It drives the data input enable pins on the DACs (IC5 & 6) and it also drives the trigger input on IC8. ICs 5 & 6 are ZN428 monolithic digital to analogue converters which accept data from the inputs when the enable pin is low and store it while the pin is high. They convert the digital data to a corresponding analogue output voltage in the range 0 to 2.55 V. Note that IC6 gets its data from the input data bus whereas IC5 gets it from the output of IC4.
IC8 is a dual monostable device only one part of which is used in this circuit. Its purpose is to provide the timing signals for the sweep generator, a display enable signal, and status indication back to the controller.
The next two outputs from IC7 are used to set or reset a simple latch made from two parts of IC10. An output from this latch is gated with the output from IC8 and enables or disables the display (if this facility is used.).
The final output from IC7 enables part of IC9 which is a 74LS125 quad three state buffer. This transfers the logic level at SK1 pin 19 onto the enable pin of another section of IC9. If this is low, the logic state of IC8 Q output is impressed on SK1 pin 20. This indicates that the unit is ready to start display when the pin is high.
The final part of the Graf-vec is made up of two identical circuits. Each of these takes the output from a DAC (IC5 or 6) and processes it to give the required output. We shall only explain one of these circuits as the other is exactly the same.
The output from the DAC comes via R6 and C7 which remove glitches and high frequency noise from the signal. It is then amplified by a factor of 2 by IC11a. This also provides a low impedence drive to the rest of the circuit.
Consider firstly the case when the Q output from IC8 is high (i.e. not triggered). The output from IC11a is connected via two of the four FET switches in IC12, an LF13331, to C9 and C11. This ensures that these capacitors are charged to a defined voltage before each sweep. Nothing further happens to this part of the circuit until the DACs are loaded with new information and IC8 is triggered. When this happens all the switches in IC12 are turned off. This isolates C9 which will hold its previous voltage for some time, and also removes the clamp on C11. The voltage on C9 is buffered by IC11b and applied via R13 to the inverting input of IC13. A new voltage now appears on the output of IC11a as the DAC has been updated. This is applied via R12 to the non-inverting input of IC13, an LM13600, which contains two transconductance amplifiers and two buffers. The transconductance amplifiers provide an output current which is proportional to the difference of the two input currents, modified by currents into two other inputs.
In this circuit, one amplifier and buffer combination is used for each channel. The currents through R12 and R13 are subtracted and a current proportional to their difference flows into C11. Currents flowing through R20 and VR4, R22 determine what the actual gain will be. As the voltage on IC11a output is constant after its initial change and that on IC11b output is also constant, the resulting current flowing into C11 will be constant. The result of this is that C11 will charge linearly and will also tend to go in the direction of the voltage on IC11a output. In fact, when everything is set up correctly, the voltage on C11 will just reach the voltage on IC11a output as the monostable pulse ends. At this time the capacitor voltage will be clamped by the FET switches being turned on again. The capacitor voltage is buffered by buffers in the LM13600 before being sent out.
Finally it should be mentioned that R16, 17 and VR2 form a balancing network and DC return path for the input currents and one of the control currents.
Table 1. Z80 machine code demo program.
16514 11 10 00 LD DE,0010 :Scan counter = 256
17 PICOUT 06 0E LD B , 0E :Points/scan = 14
19 21 A0 40 LD HL,40A0 :Start of data table = 16544
22 POINTOUT 7E LD A,(HL) : Get "X" data
23 D3 1F OUT (1F),A :Output "X" data
25 23 INC HL :Move data pointer
26 TESTIT DB 1F IN A,(1F) :Input status indicator
28 CB 7F BIT A.7 :Isolate status bit
30 28 FA JRZ (TESTIT) : Jump back if not ready (low)
32 7E LD A,(HL) :Get "Y" data
33 D3 3F OUT (3F),A :Output "Y" data
35 23 INC HL :Move data pointer
36 10 F0 DJNZ (POINTOUT):Repeat for all points
38 1B DEC DE :Decrement scan counter
39 7A LD A.D :Get scan count high byte
40 B3 OR A,E :OR with scan count low byte
41 20 E6 JRNZ (PICOUT) : Repeat if not zero
43 C9 RTS :Return to calling program
DATA LIST
16544 00 80 40 C0 7F 80 AE C0
FE 80 7F 80 97 68 7F 50
68 65 7F 80 7F 30 7F 80
40 80 0C 00
Table 2. ZX81 BASIC program. Note that you must go to line 50 to enter data and RUN to display.
10 REM )( \.':5[illegible]RNDACS [illegible]C IF .?[illegible][illegible] NEW TAN XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
15 FAST
17 LET X=10
18 LET Y=X
30 POKE 16545,X
35 POKE 16553,X
40 LET X=X+Y
41 IF X>235 OR X<15 THEN LET Y=(-1)*Y
45 GOTO 20
50 FOR K=16514 TO 16575
60 PRINT K,
70 INPUT A$
75 IF A$=" " THEN STOP
80 IF LEN A$<>2 THEN GOTO 70
90 LET A=CODE (A$(1 TO 1))
100 LET B=CODE (A$(2 TO 2))
110 LET C=CODE "F"
120 LET D=CODE "0"
130 IF A>C OR A<D OR B>C OR B<D THEN GOTO 70
140 POKE K,16*(A-D)+B-D
150 PRINT CHR$ A;CHR$ B
160 NEXT K

Table 3 Connections to the ZX81.
Graf-vec, socket 1 ZX81 pins 1 - 8 (data in) D0 - D7 pins 10, 17 (OV) OV pin 11 (address LSB) A5 pin 12 (address) A6 pin 13 (WRITE) WR pin 14 (SEL) A7 pin 15 (SEL) IORQ pin 19 (READ) RD pin 20 (status out) D7

PARTS LIST
Resistors (1/4 W Carbon film unless otherwise stated) R1 82R 1W R2 100R R3 390R R4,16,17,18,19 470R R5 22K R6,7 2K2 R8,9,10,11 10K R12,13,14,15, 20,21 12K R22,23,24,25 18K VR1,4,5 47K min. horizontal preset VR2,3 470R min. horizontal preset Capacitors C1 2,200 uF 25 V axial electrolytic C2 1,000 uF 25 V axial electrolytic C3 47 uF 25 V axial electrolytic C4,14,18,19,20 10uF 25 V tant. bead C5,13 10nF ceramic disc C6 22nF polycarbonate C7,8 470 pF ceramic 1 nF polycarbonate C11,12 10 nF polycarbonate C15,16,17,21,22 100 nF ceramic Semiconductors IC1 1N4002 IC2 7805 IC3 7915 IC4 74LS374 IC5,6 ZN428 IC7 74LS138 IC8 74LS123 IC9 74LS125 IC10 74LS00 IC11 TL084 IC12 LF13331 IC13 LM13600 D1,2,3,4 1N4002 Miscellaneous T1 0-12, 0-12 V 6 VA PCB mount transformer FS1 1 A, 20 mm fuse + PCB mount holder SK1 2 off, 10 way 0.1 in pitch PCB connector PCB; Small heatsink for IC2; 23 way double sided edge connector 0.1 in pitch; 16 way(min) or 20 way ribbon cable. (Ferrenti, distributed by Zentronics)




Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.