The Challenge of the TS2000
How would you like to have a computer with a color video display of fifteen colors, quality sound, high resolution, unlimited character sets, and a dual joystick interface? How would you like a system in which you do not have to worry about expansion? If you have a ZX81 (or ZX80 with the 8K ROM), you could have such a system—the COLORSIN81.
Since ZX81 hardware and software are incompatible with the TS2000 expansion bus, many of us who have made sizeable investments in these items will not be able to justify purchasing the new product, as is the case with me.
This article sets forth my answer to the challenge of the TS2000 in a design to give the ZX81 the capability of having all of these features at a very reasonable cost. We will cover the system features, circuitry background, applications, construction of the board, testing and debugging, and programming. Many of the debugging suggestions are useful in other applications.
System Features
Most peripherals on the secondary market provide the user with a new capability or function. They normally are not designed or sold to be interactive with the user or the machine. This system has been designed differently; it has the user in mind. By building or purchasing this system, you are not only adding the features mentioned, but are actually opening your system to be anything that you want it to be.
Figure 1 compares the COLORSIN81 with the TS2000 in features, ease of use, and expandibility.
The two systems use entirely different approaches in creating their displays. The TS2000 uses a new ULA to produce color, with the high resolution being a product of new software. The COLORSIN81 uses a dedicated IC to produce and maintain a display. It requires none of the user memory! It has its own 16K of video memory to store images and pages in. As you will see later, this protected memory has many other uses.
The 6-slot motherboard includes two slots which will accept Radio Shack stocked boards. For interfacing your homebrew circuits to the Sinclair I have included 8 memory-mapped select lines. These are for the exclusive use of experimenters and hobbyists.
So that the user does not have to “call” the capabilities of the board when required, the computer jumps to the system PROM, does the initialization of the system, loads the color display into memory, enables the sound, checks for joystick activity, and prompts the user with a “ready” on the screen.
Because the system PROM does the initialization, 64K RAM packs are fully supported. POKEing the Sinclair RAMTOP variables to have access to the upper half of memory is not necessary.
Since this system does not depend on the Sinclair to maintain a display, the computer may be run exclusively in the FAST mode. However, if you want both displays at the same time, you could run the system in the SLOW mode and use two TVs.
[Figure: Figure 1. Comparison of COLORSIN81 and TS2000 Features.]
COLORSIN81 TS2000
Number of colors available 15 + 8
transparent
Maximum pixel resolution 256 × 192 256 X 192
Sound range (octaves) 8 10
Sound produced by: speaker piezoelectric
element
Number of joysticks 2 (4) N/A
Characters/line 32-40 32
Ram available to user 56K 48K less
display
Additional video ram 16K N/A
Program merging supported yes no
Sprites available to user 32 N/A
User definable characters 256-768 21
Character sets redefinable yes no
Expansion slots provided 6 1 (the bus)
Interface circuitry provided 8 select lines N/A
New Commands
The system adds 17 new commands (see Figure 2), including READ, DATA, and RESTORE. However, after you discover the power of the other commands, you will consider these to be less important.
You will now be able to MERGE and CHAIN programs, whether in Basic or machine language. Instead of writing each program from the first line each time, just load in any number of subroutines and combine them with your new “application.” Your programming speed will increase many times over. By “chaining,” I mean that a tone could place in protected memory certain items of data and have this data shared by many other programs, each being able to change or modify the contents of the data.
Files and other data structures are supported on this system with easier manipulation of information. You will not have to dimension arrays for storing data, worry about RUN or CLEAR destroying hours or days worth of work, or be concerned with managing the memory.
You will be able to create animation easily, plot complex functions directly in high resolution, if desired, and easily interface your machine language programs with a special COLORSIN81 system variable which contains the starting address of your routine. This routine may be located anywhere in user memory in either a REM statement or a string. The system software keeps track of its location and automatically adjusts the variable.
If you should like to obtain additional reading material on other similar applications and sources of supply for kits and assembled systems, see the lists at the end of the article.
Figure 2. The 17 New Commands.
1. REM*DATA;A$;X1,x2…Xn:
A$ is the “name” assigned to a particular set of data. An unlimited number of data elements may follow, each separated by a semicolon and the last element followed by a colon.
2. REM*READ A$;X
Reads an element from the data named A$.
3. REM*RESTORE A$
Resets the pointers to begin at the first data element in A$.
4. REM*OPEN N
N is a file name previously defined using the FILENAME command and limited to an alphanumeric of fewer than 3 characters.
5. REM*CLOSE N
Closes the file and “protects” it from accidental access during the run of a program.
6. REM*CIRCLE;X;Y;Radius;Color:
A subroutine to draw a high resolution circle anywhere on the screen with any radius. Any of the 15 available colors may be used.
7. REM*FILL
Fills the bounded area of the CIRCLE or DRAWTO command with the same color as indicated.
8. REM*FILENAME X$;
Any three character alphanumeric to “name” a file. As such, its location can be stored and recalled by name. It may also be a copied page of the display.
9. REM*VARS A$;
Allows the user to name a variable being used by the Basic operating system to be used also by COLORSIN81 system commands such as DATA, FILENAME, FIELD, and SOUNDON. This variable may then be manipulated by a Sinclair Basic program and instantaneous values used by the system.
10. REM*FIELD:FILENAME:1 as 2$;2 as 4$;3 as 1$:…X as Y$:
By using the field command, you can assign specific memory requirements for each field. In the above example, the first field uses 2 bytes, the second uses 4 bytes, etc. The record length is associated to the FILENAME by the system software.
11. REM*MEMREM
When used in a GOTO statement, may be used to determine the total number of records which may fit in memory in any particular file. Uses the information provided by the FIELD command to make this calculation. The value returned may be POKEd to place additional files in memory.
12. REM*SOUNDON:channel.pitch.volume:etc.:
The main method of producing the sounds: the available channels are 1-4, the pitch may vary from 0-1023, and the volume from 0-15, with the value 15 shutting the tone generator off. May be used in conjunction with Basic variables which are manipulated by a program.
13. REM*HRPOS X
When used with a GOTO statement, then the current X,Y coordinates of character X are returned. Allows the programmer to determine in software the current location of any character on the screen.
14. REM*MEMLOC
When run as a GOTO statement, gives an approximation of the amount of available user Basic RAM space remaining.
15. REM*DRAWTO;X,Y;X,Y;…..X,Y;color:
Connects any two pixel coordinates on the screen. May be extended by as many destination points as desired without the final coordinates having to be the same as the first coordinate. Any of the available 15 colors may be used.
16. REM*BIN
When used in a GOTO statement, calls a special screen which may be used to define new characters, sprites, or a high resolution screen.
17. REM*MOVE;FILENAME; origin, destination:
Allows the programmer to move large amounts of information around in memory, to or from the protected memory of the video RAM. Implements the ability to “chain” and “merge” programs.
System Overview
The system consists of a buffered motherboard with six expansion slots. Two of these slots are designed to accept Radio Shack boards.
Color with a VDP
Color is produced using the TMS9918A Video Display Processor from Texas Instruments, hereafter referred to as the VDP. The VDP has the capacity for producing color displays and high resolution as well as the ability to create and manage 32 additional characters called sprites. A sprite is a variable sized character which may be moved smoothly over the entire display area in any direction. Each of the 32 sprites has its screen position determined by its own screen address, so creating animated sequences merely becomes a series of timed changes to these screen locations.
The VDP also offers four different Modes, each with varying utility depending on the application. Modes I and II are graphics modes. Mode I offers up to 15 colors plus transparent to be displayed on the screen at once. Up to 256 unique characters may be defined. In addition to allowing the 15 colors plus transparent to be displayed at the same time, Mode II allows all 16 colors to be present in the same character position. Mode I allows any combination of 8 colors maximum to be displayed in any one character position. Mode II offers up to 768 unique characters per display.
Because of the unlimited and unrestricted use of color in Mode II, this system utilizes it as the high resolution, 16- color mode. Mode I, because of its limitation on colors, is used as a high resolution, 4-color mode.
Mode 1 is sufficient for most appliciations, and allows the user the advantage of storing up to four pages in memory at a time, making paging very simple and quick. Mode II displays occupy 12K of video memory, so only one display may be stored in memory at one time. This mode seems best suited to games, creating highly detailed images to be dumped to the printer, and in creating displays where colors may be used either to form bounderies or to show movement. An example of this would be in CAD/CAM, where an electronic circuit could be displayed on the screen, and the pulses on the circuit shown as changing colors on the line.
Mode III on the COLORSIN81 may best be described as the multicolor, block mode. All 16 colors may be displayed on a page, but a combination of four colors maximum may appear on any one character line. Because of this apparent problem, the system software will actively support four colors in this mode. Since the block graphics are very similar to those of the Sinclair, I have dubbed this the Sinclair mode.
In Modes I, II, and III, sprites and graphics are supported. Each mode has 32 character positions across and 24 lines down, the same as the Sinclair. The multicolor mode, Mode III, has 64 blocks by 48 blocks on the screen, again the same as the Sinclair. However, Mode IV offers 40 characters per line with 24 lines down. This mode increases the Sinclair screen by 25% and makes word processing and other text related tasks far more readable. Formatting becomes much easier if you are using an 80-column printer, for you should not have the problem of broken words. However, with this feature, you lose the use of sprites, and you are limited to two colors over the entire screen. However, I am sure that most of you will enjoy having a larger screen to work with.
In the foregoing discussion of the modes of the VDP, I mentioned that the system software supported what appeared to be less than the potential of the VDP. This is because it seemed sensible to make trade-offs if similar results could be obtained using one of the other modes. This makes software implementation much simpler and allows the use of the new commands (in Figure 2) to make programming much simpler.
However, since all of the functions on this board are memory-mapped, your are free to use Basic or machine language routines to create anything you wish. Figure 3 compares the four modes and gives a synopsis of their capabilities.
[Figure: Figure 3. Comparison of the Modes.]
Mode
1 2 3 4
Characters/line 32 32 32 40
Lines/screen 24 24 24 24
Number of sprites 32 32 32 0
Graphics supported yes yes yes yes
Characters supported yes yes yes yes
Resolution high high block high
Number colors/screen (maximum) 16 16 16 2
Number colors/screen supported 4 16 4 2
Maximum number of user defined 256 768 256 256
Characters per screen
The COLORSIN81 offers a number of special screens which may be called as required. These screens will help in defining your new character set, defining new sprites, or helping construct a high resolution screen in Mode II. These screens are interactive in that the user is asked to supply very simple information and the computer/software takes care of storing that information in the appropriate memory locations. All screens and files in this system may be saved on tape, so any work which you might want to include in another program may simply be merged with it.
The Sound Chip
Sound is produced with the SN76489A Sound Chip from Texas Instruments. This IC offers an 8-octave range and 4 separately programmable channels, the fourth being a white noise generator. Full tone and volume control are accessible. Programs may be written in either Basic or machine language. Envelope control allows you to produce complex tones that simulate the piano or chimes.
The calculated frequency range in this system is approximately 100-10000 Hz, which should be sufficient for most applications. The sound is output through an 8 Ohm speaker, so the sound quality is very good.
The application sheets available from Texas Instruments create a fairly complex maze of registers and formats which must be considered when outputting a specific sound. However, the COLORSIN81 software takes care of formatting the information when the user loads simple, direct items of information into a command line.
The sound capability has applications in games, in word processing programs for positive key feedback , and in security systems as an audible noise source.
The Joystick Interfaces
Two joystick interfaces are provided on board, but up to four may be active at any one time. These interfaces accept inexpensve Radio Shack joysticks. The 6-bit resolution is sufficient to uniquely identify every character position of the screen. If the joystick is used to manipulate the position of a sprite, then the sprite may be positioned to the accuracy of a half character.
This feature is designed for applications in alternative input mechanisms, in gaming, and in aiding the manipulation of screen data. When used with the appropriate software, it could be used to change screen information, to move characters or words from one location to another, or to highlight an area on the screen.
Additional Options
At the time of this writing, several other options were being considered for the board: 1) up to 48K RAM on board, in increments of 16K; 2) a solid state interface to allow the user to “plug in” programmed PROMs apart from the Sinclair memory space and load into memory when needed (up to 80K of PROMs could be supported on the system, while using only 8 memory locations of the Sinclair memory); 3) an interface which would emulate a disk drive. The principle is the same as the solid state interface, but would use dynamic RAMs instead. These new products will become available over the next several months.
Schematic Overview and Circuit Operation
The motherboard consists of Slot 0, where the Sinclair bus originates. The address, data, and selected control lines are buffered by ICs 1-4. The PROMs, P1 and P2, provide all the address decoding required on the board.
The outputs of the PROM are used to enable ICs 8 and 33, which are one-of-eight decoders. Inputs A, B, and C provide binary information which is coded by IC 8 to produce one of eight active low outputs at one time. On IC 8, input A is grounded because address line 0 is used as a mode control for the VDP. The eight outputs (select lines) on IC 33 are extended to the Radio Shack boards to give the user total access for interfacing other homebrew boards.
IC 9, sections of which have WR inputs and RD inputs in addition to the inputs from IC 8, provides the necessary signals to the sound and joystick sections on the board.
The PROMs allow flexibility in design, in that the relative addresses of the peripherals on the board could be easily changed by changing the programming of the PROM. However, to maintain compatibility with other systems, the PROM programming should not be changed.
ICs 10 and 11 are latches used to store and continuously ouput their contents. In the joystick section, the output of the latch is fed into a CD4050 CMOS buffer. This chip is used because of its ability to output stable and reproducible voltage levels on its output. The output of the chip is fed into a resistor bridge, effectively assigning a “weight” to each of the data bits.
The sum of these weighted voltages is then fed to the negative side of IC 22, a voltage comparator. The function of the comparator is to output a positive voltage if the positive side of the comparator is greater than the negative side, and to output a negative voltage when less than the negative side. The voltage source for the positive side comes from the joystick itself. The joystick has its own 5 volt supply which may be varied by the dual potentiometers from 0 to 5.0 volts. The effective range, after going through a matching circuit of resistors, is approximately 0.25-4.75 volts. Because we are feeding 6 bits of data into the section, this 4.5 volts is divided by 64 equal units of approximately 0.07 volts.
Thus, any change in the position of the joystick creating greater than a 0.07 volt change could change the position of the cursor on the screen. However, in practical terms, we are concerned with character positions on the screen, so the full precision of the joystick will not be used. However, the software compensates for this when using sprites as the cursor by developing trend data in direction and speed to produce smooth movement instead of the expected jerky movement.
The function of IC 23, a buffer, is to make visible to the Sinclair via the data bus the present condition of the comparator. The processor, when in the joystick routine, continuously outputs data to the joystick latch and then reads the joystick port to sense any change in the outputs of the comparator. A change indicates that either the X or Y screen coordinate of the cursor has been determined.
In the sound section, the output of the latch is fed to the 76489A sound chip as data. The sound chip requires that the data be stable for a minimum of 32 clock cycles at 2 MHz. Because 2 bytes of data are required to produce a tone, a maximum of 3200 different tones may be produced per second using machine language programs.
In Basic, you are not really restricted by the 32 clock cycle requirement, for it takes a minimum of 1 ms. to execute a Basic instruction. Therefore, a maximum of 500 tones per second could be produced. Various frequencies are produced by rapidly turning the tone generators on and off with a seed tone varied by time.
The function of ICs 28 and 30 is to divide the 4 MHz frequency in half to 2 MHz, the maximum frequency the sound chip can handle. The audio output of the sound chip is fed to IC 32, an audio amplifier which is used to amplify the tone and drive an 8 ohm speaker. The large capacitors are used to improve the bass response of the speaker.
The video section does not use latched data, but receives its data directly from the data bus. Since the VDP operates asynchronously, data may be read or written to the VDP without considering what the VDP may be doing at that moment. The VDP has its own internal latches to store data until it is able to act upon it. Because of its high clock rate, there is no degradation in system throughout. You may run machine language programs at full speed reading or writing data without the VDP losing any of it.
The VDP interfaces to the CPU by the data bus, two select lines, a Mode Control line which is address 0 on the Z80 bus, and the reset line from the Z80. On power up, the reset line resets all registers in the VDP and clears all memory. It is now in a position to be programmed with data.
Programming is accomplished through the use of the select lines, the Mode Control line, and the data bus. The Mode Control line differentiates between VDP register accesses and video RAM accesses. The CSR and CSW lines, active low, determine whether the CPU is reading or writing to the VDP. These signals are used to strobe data into the VDP. The VDP then performs the required housekeeping duty of putting the data in the appropriate register or video memory location.
The VDP also refreshes the dynamic RAMs. The video RAM side of the VDP uses multiplexed address/data lines to determine a video RAM address. Two bytes of data are needed to set the starting address, and one byte of data for each data word to be read or stored.
The VDP features an autoincrementing register, so that, once the initial address has been set up, succeeding data transfers do not need new addresses. At this point, the VDP is processing the data stream as a parallel port. The 10.73 MHz crystal may be fine tuned by using the trim capacitor. It is used to adjust the crystal frequency to match the pixel rate of your TV. The composite video out signal is fed to an RF modulator which conditions the signal so that channel 3 or 4 may be used to display the images on your TV. However, if you wish to drive a color or monochrome monitor, a jack can be provided.
Constructing and Debugging the Board
This system was designed for incremental construction. Although the basic price of the system is low, some may prefer to spread the cost of the system over a period of time. Certain basic sections of the board must be present for others to operate, but, once these sections are built, you can extend the system at your own pace.
The system interfaces to the computer in one of two ways: 1) by a cable running from the expansion port of the cased computer to slot 0 of the COLORSIN81; or 2) by plugging the uncased computer directly into slot 0 on the motherboard.
If you have an auxilliary keyboard, you can connect it to the motherboard using the 25 pin D-type connector on the board; however, you can do this only if the computer is plugged into slot 0, for that is the only way to connect the flex-tail connector of the board to the keyboard input connectors on the computer. You should decide before ordering what approach you would use to interface the computer to the system.
Actual construction time of this board will vary from 3-5 hours for the experienced kit builder to 10-20 hours for the novice kit builder. If you built your own computer, then you should have no problems. However, even the novice kit builder, taking his time and following the suggestions in this article and in the assembly instructions, should be able to build this system.
Before beginning construction, assemble the basic tools: a 25-40 watt pencil type soldering iron, solderwick, screwdrivers, a multimeter, and a set of tweezers. The kit building progresses one section at a time, so you should segregate all the componements in the kit, arrange them by section, and bag each section. This will ensure that all the parts you need are present and will eliminate much searching when you actually are building the kit.
In general, the basic sequence of inserting parts onto the board should be: IC sockets, capacitors, resistors, diodes, followed by other discretes such as potentiometers, variable capacitors, and transistors. This approach allows you to use your best judgment in the placement of the components.
The Power Supply
I recommend a 15 volt, 5 amp power supply to acommodate future expansion of this system. When fully built with the computer and a 64K RAM pack attached, the power consumption approches 2.0 amps at 5 volts. If you intend to add more than 2-3 boards to the system, you might need to add a second 5 volt regulator. Although only +5 and +9 volts are required in this design, the board has room to accommodate +12 volts and -5 volts, obtained using an inexpensive voltage converter.
By purchasing the proper type of power supply, you will eliminate much frustration in the future. The power supply should have a regulated output. (When ordering a kit or assembled system, inquire about the availability of a power supply if you need it.)
The Power Regulating Section
The first part of the board to be built is the power regulating section. This is made up of 3 regulators and heatsinks, 1 IC, and several resistors, capacitors, and diodes. If you put the components into groups, assembly will proceed much faster. Starting with one of the voltage regulators and its associated parts, assemble the parts to the board and solder using the component placement layout in Figure 4.
Figure 5 is a schematic of the system and should be used when debugging the board. You might want to test the power supply before connecting it to the board. Turn power on to the supply with no connections to the motherboard. You should have a voltage of 15-18 volts. After all the components for the power section have been soldered, attach the power supply and turn on the power. Referring to Figure 4, locate appropriate test points and adjust the appropriate variable potentiometer until the desired voltage is obtained. When inserting components into the board, pay particular attention to polarity of the capacitors and diodes. Improper placement will result in poor performance. Once voltages are set to the indicated levels, proceed to building the motherboard and buffers.
The Motherboard
Assemble all the parts for the motherboard and buffer section. Insert the IC sockets, followed by the connectors and other components. Carefully inspect your work for solder bridging, especially on the connectors. For thoroughness, you might want to check for continuity from one connector to the next; remember that the address, data, and certain control lines go through the buffers.
At this point, you have a fully functional motherboard and may begin using the power of the Sinclair to help in making the rest of the system operational.
To prove that your computer may help, attach it to the system, insert some known working board, other than a memory board, into one of the other slots and turn on the computer. If the board operates normally, then all aspects of the motherboard are operating as expected. If the computer works but the peripheral board does not, then the problem lies in the soldering of the connectors or IC sockets. If the computer does not produce a display, then the buffers are not operating correctly, and again soldering should be checked.
[Figure: Figure 4. Component Layout of COLORSIN81 Board.]
The Address Decode Section
This section is made up of 5 ICs and sockets, assorted capacitors and resistors. Insert the parts indicated, power the system up, and check for proper voltages by referring to Figure 6. If you have access to an oscilloscope, you can test this section by POKEing the select addresses as indicated on the schematic. If not, then you will have to wait until the next section is added to prove that the address decode section is operational.
The Joystick Interface
This section is made up of 4 ICs and sockets, capacitors, component carriers for the resistors and a large assortment of resistors. Begin by assembling the component carriers as in Figure 7. Now that 90% of the parts are assembled, you can concentrate on the sockets and remaining components. Insert the ICs, power the system up, and check voltages to the ICs.
Once done, enter Listing 1 and RUN it. Check the output pins on IC1. You should see a rhythmic change in the measured voltage. If you do not see this activity, then check your soldering on both the address decode and joystick sections. If you still are unable to detect the indicated response to the program, then make a thorough check with a continuity tester. Check each line in the two sections to verify that no shorts exist.
Finally, if no problems are detected, then try one of two other approaches: 1) contact a friend who has a logic probe or an oscilloscope and ask for assistance in finding the problem; or 2) purchase additional parts from a supplier such as Radio Shack to isolate the problem. Although no one ever likes to admit it, occasionally component failure is the cause when a project does not work.
After you are able to observe the desired response to the program, insert ICs 22-24 and the component carriers as in Figure 4. Power the system and enter Listing 2. If you have purchased a Radio Shack joystick, assemble it as in Figure 8. Connect the joystick and RUN the program.
You should be able to place the cursor in each of the four corners of the display. Do not be alarmed at the response of the joystick. The machine language program will run many times faster than this Basic program. As the cursor position is changed from corner to corner, you might take a voltage reading at pins 1 and 2 of the voltage comparator, IC 22. You will see the maximum voltages that may be outputted to the two sides of the comparator.
[Figure: Figure 5. Schematic for COLORSIN81.]
Sound Section
Assemble the parts for this section and solder. You should have 4 ICs and sockets, a crystal, resistors, a variable resistor, 2 large capacitors, and a number of small capacitors. Do not insert IC 32 yet, as you do not want to output a load without a speaker attached. However, if you want to connect the speaker at this time, you can leave it in.
Enter Listing 1 again, changing line 40 to POKE 14344. Run the program to again observe the rhythmic changing of the voltage levels, particularly on pin 2 of IC 10. Do not be concerned with the hiss that you might hear from the speaker. The sound chip occasionally outputs a sound on power up. You can reduce the volume by adjusting the variable resistor.
Enter the program in Listing 3 and RUN it. You should hear a series of tones which sound like a chime. Adjust the variable resistor until succeeding runs of the program produce the tone at the desired volume level. Now proceed to the next section.
[Figure: Figure 6. Power Connections.]
IC P/N GRD +5 +9 1,2,3 74LS245 10 20 4,23 74LS367 8 16 5,6 6300-1J 8 16 7 74LS08 7 14 8,33 74LS138 8 16 9 74LS02 7 14 10,11 74LS373 10 20 12 TMS9918A 12 33 14 74LS08 14 7 15 D 2716 12 24 16, 30 74LS74 7 14 17 74LS00 7 14 18,19 74LS257 8 16 22 LM339 12 3 24 CD4050 8 1 28 74LS04 7 14 31 76489A 8 16 32 LM386 4 6 | +12 -5 34,41 4116-150 16 9 8 1
[Figure: Figure 7.]
1 261 K 100 K 10 K
2 147 K 51 K 10 MEG
3 75 K 5 K 1 K
4 38 K 13 K 10 K
5 19 K 5 K 10 MEG
6 10 K 2.6 K 1 K
7 100 K 1 K 20 pf
CC1A CC1B CC2A,B
Insert the resistors and capacitors into the component carriers as shown. Resistors in CC1A, B are 1% resistors. CC2A, B have 5% resistors.
[Figure: Figure 8. Joystick. Wiring of the Radio Shack joystick: +5V, Y, Ground and X leads]
Assemble the Radio Shack joystick as shown. You should get a dual 100K joystick.
Listing 1. Latch test.
10 SLOW
20 LET Z=14350
30 FOR I=1 TO 128
40 POKE Z,I
50 NEXT I
Listing 2. Cursor test.
5 LET X=0
7 LET Y=0
10 SLOW
20 LET Z=14350
30 FOR I=1 TO 127
40 POKE Z,I
50 IF PEEK Z=128 THEN GOTO 150
60 IF PEEK Z=192 THEN GOTO 200
70 NEXT I
80 FOR I=1 TO 64
90 POKE Z,I
100 IF PEEK Z=64 THEN GOTO 170
110 NEXT I
150 LET X=I
160 GOTO 80
170 LET Y=I
180 PRINT AT X/8,Y/4;CHR$128
190 PRINT X
195 PRINT Y
200 STOP
210 LET Y=X
220 GOTO 180
Listing 3. Chime demonstration.
10 FAST
20 LET Z=14344
25 REM TURN OUTPUTS OFF
30 POKE Z, 159
40 POKE Z, 191
50 POKE Z, 223
60 POKE Z, 255
65 REM INPUT ANYTHING
70 INPUT A$
75 REM ENABLE THE OUTPUTS
80 POKE Z, 140
90 POKE Z, 5
100 POKE Z, 170
110 POKE Z, 5
120 REM NUMBER OF BELLS
130 FOR B=0 TO 11
140 FOR I=145 TO 159
150 POKE Z,I
160 POKE Z,(I+32)
170 REM DELAY
180 FOR D=0 TO 1
190 NEXT D
200 NEXT I
210 NEXT B
220 GOTO 10
Video and Video RAM
This is undoubtedly the section many of you have been waiting to get to.
This section consists of 3 ICs and sockets, an RF Modulator and/or a monitor jack, a variable capacitor, a crystal, and several resistors and capacitors. Insert and solder all the components as in Figure 4.
Enter the program in Listing 4 and RUN. This program loads data into memory locations in video RAM and then reads these same locations and prints the results. You will notice that the program increments the data in multiples of 2; if, when printing the information to the screen, you notice a zero appearing where a number should be, this can aid you in determining that you might have a bad solder point in the section. It will even help to identify which line might be bad in that each bit of data has its own pin on the RAM chips that it enters and exits. If the demonstration program does not operate as expected, again check soldering quality and continuity. When the section works, you are ready to add the PROM interface and the automatic jump circuitry.
This section will be revised later to make use of the new 4416 memory chips from Texas Instruments when they become available. The required chips will be reduced from eight to two. This offers many advantages to the kit builder and user because debugging is much simpler and system reliability is increased. These chips could also be used whenever the on-board memory option is added and whenever possible in other suitable applications.
Listing 4. VDP and memory verification.
5 LET Z=0
10 FAST
20 LET WR=14349
30 LET RWR=14348
40 LET RRD=14346
50 REM SET UP STARTING ADDRESS
60 POKE WR,0
70 POKE WR,64
80 REM ENTER DATA
90 LET Z=Z+1
100 FOR I=1 TO 50
110 LET Z=Z*2
120 POKE RWR,Z
130 NEXT I
140 REM READ DATA
150 POKE WR,0
160 POKE WR,0
170 LET Z=1
175 SLOW
180 FOR I=1 TO 50
190 LET Z=Z*2
200 PRINT PEEK (RRD);
210 PRINT CHR$0;
220 NEXT Z
230 PRINT "DONE"
Try varying the numbers in lines 140 and 180. Observe the effects.
[Figure: Figure 9. Switch Settings.]
1 2 3 4 5 6 7 8
A [0 0 0 0 1 1 0 0] 1 = On
1 = Off
1 2 3 4 5 6 7 8
B [0 0 0 0 0 0 0 0]
Set the switch as in A to cause an automatic jump to the system PROM. Use the settings in B when running unmodified Sinclair programs.
PROM Interface and Automatic Jump Circuitry
The PROM interface consists of 1 IC and socket. Insert and solder and check for proper voltage levels. The Automatic Jump circuitry consists of 4 ICs and sockets, an 8-position switch, 2 transistors, and 2 resistors. Insert the components, solder and check for proper voltage levels.
You might notice that you no longer have a cursor on the display. This is expected and normal. If the PROM was inserted, the computer is now executing instructions in this PROM and is waiting for you to input something through the keyboard.
At this point, you might want to disconnect the TV cable from the Sinclair and attach it to the RF modulator on the motherboard. Set the switch positions as in Figure 9 and power the system up. The prompt “READY” should appear on the screen. At this point you have a fully operational system ready for you to develop applications.
If you have a video monitor, or another TV, you may want to connect one to the computer and one to the motherboard. In this way you can see what is happening to the Sinclair display.
When running application programs which have not been converted to run on this system, set the switch positions as in Figure 8, power the system up, and observe the results of the program through the Sinclair TV display port. If the sound or joystick features are to be used, then at some point early in the program LET Z = USR x, where x represents the beginning of the PROM subroutines for these features.
Programming the System
The joysticks are enabled in this system by POKEing six memory locations. The first location tells the software how many joysticks are to be active during this time period, and the second location actually enables the joysticks. Up to four joysticks are supported by the software. The next four locations are used to store the code number of the character to be used as the cursor for each joystick. If you wish to use sprites to indicate the position of the cursor, then zeros should be POKEd into these locations. The software will automatically use the four highest priority sprites as cursors.
The sound features are implemented by the SOUNDON command. The three parameters in the command are used to choose the desired tone generator, the pitch to determine the frequency, and the volume which is used not only to vary the volume, but also to turn a tone generator off. You can use variables for any of these parameters so long as they have been declared previously by the command VARS. You may also add multiples of these three parameters in the same REM line if you wish, the only condition being that separate groups be separated by semicolons and that a colon follow the last parameter in the REM line.
Most of the other commands are self-explanatory, and a bit of experimenting will quickly enable the programmer to produce application programs far easier than ever before and in much less time.
For those who purchase a kit or an assembled system, the accompanying manuals will detail in far greater depth how to program the system and develop applications. Sample programs and applications will be included to help encourage the new owner to discover the true power of this system as compared to the unmodified Sinclair.
Conclusion
I am sure that many of you are looking forward to using your new Sinclair. You should! You now have one of the most powerful computers on the market for under $1000. You have the superior graphic capability of the Texas Instruments 99/A computer, the high resolution of the Apple, the easy editing of the TRS-80, and sound comparable to the best on the market. You have the advantages of easy expandibility and interfacing, of adding new utilities on PROM to further expand the capabilities of the system, of adding new RAM to the system inexpensively, and of connecting your keyboard, if you have one, to the system. Best of all, you have the advantage of being able to expand your system at will from the large selection of inexpensive Sinclair peripheral equipment on the market.
I am sure that many of you are indecisive about investing in this type of expansion because a “better” computer might become available, or because this is your first computer and later you might decide to get another. Well, this system is portable. It may technically connect directly to any Z80 based computer such as the TRS-80. You might not be able to use the PROM designed to work with the Sinclair, but adding several routines to accommodate the TRS-80 should not be at all that difficult. Also, since most of the Z80 signals are duplicated in some manner on other microcomputers on the market, interfacing should be relatively simple. So not only are you investing in your Sinclair for today, but also you are looking forward to extending the capabilities of your future system.
References
I wish to acknowledge my indebtedness to the following authors and publishers for their kind permission to use concepts from their work in developing this project:
“Add Programmable Sound Effects to Your Computer,” by Steve Ciarcia, Byte, July 1982, McGraw-Hill Publishers.
“Build a Joystick A-to-D Converter for Your TRS-80 Model I/III,” by William Barden, Byte, January 1982, McGraw-Hill Publishers. Used by courtesy of Howard W. Sams & Co., Inc.
“High Resolution Sprite-Oriented Color Graphics,” by Steve Ciarcia, Byte, August 1982, McGraw-Hill Publications.
“A Guide to Using the Texas Instruments SN76489A Sound Generator,” by Ted Mahler, Texas Instruments Application Report. Courtesy of Texas Instruments Incorporated.
“Advanced Circuits, SN 76489A,” November 1981. Courtesy of Texas Instruments Incorporated.
“TMS9918A/9928/9929 Video Display Processor,” 1981. Courtesy of Texas Instruments Incorporated.
For reprints of the articles appearing in Byte Magazine, write to: Byte Publications, 90 Main St., Peterborough, NH.
For further information or technical literature from Texas Instruments, write to: Texas Instruments Incorporated, Customer Response Center (1-214-995-6611). When requesting information, be as specific as possible and mention this article for best results.
Suppliers and Technical Information
The parts for this project may be ordered from:
Daniel G. Roy, 99 Andover St., Lawrence, MA 01843. 1-617-682-5132; 6:00-7:00 p.m.
CAI Instruments, PO Box 2032, Midland, MI 48640. 1-517-687-7343; orders: 9 a.m. to 4 p.m.; technical information 6-7 p.m.
Following is the parts list. Enquire concerning assembled price, power supply, and any options desired.
Complete kit of parts (PC board, documentation, PROM, and all necessary parts, less power supply): $159.95. PC board, PROM, documentation: $59.95. Connector, address decode, and buffers: $29.95. Video: $49.95. Joystick interfaces: $9.95. Sound: $14.95. Automatic jump circuitry: $4.95.
Parts List
Power Regulating Circuits
U29 LM350 1 +5 volts, 3 amps.
U25 LM317 1 +9 volts, 1 amp.
U26 7812 1 +12 volts, 1 amp.
U27 ICL7660 1 -5 volts, .1 amp.
0.1 µf capacitor 2
10.0 µf capacitor 4
1.0 µf capacitor 2
tant
1N4004 3 diode
240 Ohm resistor 2
5%
TO-220 heat 3
sinks
socket, 8 pin 1
5K variable 2
resistor
Motherboard, line buffer, and address decode circuitry
U1,2,3 74LS245 3 line buffers, bidirectional
U4 74LS367 1 line buffer
U5,6 6300-1J 2 256×4 programmed proms
U7 74LS08 1 2 input AND gate
U8,33 74LS138 2 3-to-8 decoder
U9 74LS02 1 2 input NOR gate
U28 74LS04 1 hex inverter
R1-R8 8 1K, 5% resistors
P0-P4 5 Sinclair 46 pin connectors
P5-P6 2 Radio Shack 44 pin connectors
11 assorted 14,16,20 pin sockets
Sound Circuitry
U10 74LS373 1 8 bit latch with output enable
U31 76489A 1 TI sound chip
U30 74LS74 1 dual D-type flip flop
U32 LM 386 1 0.4 watt audio amplifier
4,000 MHz 1 crystal
1 1.0K, 5% resistor
1 2.2K, 5% resistor
1 10.0K, 5% resistor
1 2.7K, 5% resistor
1 10.0K, variable resistor
1 0.1 µf capacitor
2 250 µf capacitor, 25 volts
1 10.0 µf capacitor, electrolytic
4 assorted 8,14,16 pin sockets
Joystick Circuitry
U11 74LS373 1 8 bit latch with output enable
U24 CD4050 1 CMOS buffer
CC1A,B 2 component carriers (see Figure 7)
CC2A,B 2 component carriers (see Figure 7)
U22 LM339 1 dual comparator
U23 74LS367 1 buffer
8 assorted 8,14,16 pin sockets
2 dual 100K Ohm Radio Shack
joysticks
4 component carriers, 16 pin
Video Circuitry
U12 TMS9918A 1 TI VDP
U34-41 4116-150 8 4116 RAM chips, 16K×1,
150ns.
10.7386 MHz 1 VDP crystal
2 33 pf capacitors
VC1 1 9-35 variable capacitor
1 1K variable resistor
1 100 Ohm 5% resistor
Um1082 1 RF modulator
1 video monitor jack (optional)
9 assorted 16,40 pin sockets
Prom and Automatic Jump Circuitry
U15 D2716 1 2K×8 bit prom, 5 volts only
U16 74LS74 1 dual D-type flip flop
U17 74LS00 1 2 input NAND gate
U18,19 74LS257 2 2 to 1 multiplexors
SW 1 1 8 position dip switch
6 assorted 14,16,24 pin sockets
*also required, 49 pc. 0.01 µf decoupling capacitors