RAMKIT: Build your own 64K RAM

NEED MORE MEMORY? Shortly after the ZX81 was released, many questions arose that Sinclair’s poor technical documentation left unanswered. Memory! Could one add more than Uncle Clive’s intended 16K of RAM? Quite a few knowledgeable people had said “No, the Sinclair bussing and memory map are too awkwardly structured.” Since those times, industry has produced add-on RAM expansions for T/S computers approaching 1 megabyte.

Ramkit is a 64K RAM expansion project, designed to be easy to build and simple to use. Although the components are available in most electronic shops, there may be quite a bit of travelling and price comparing to do; we suggest you order the complete package of components including the printed circuit board from Gladstone Electronics (see box at end of article). Construction is relatively straightforward with a total assembly time of about two and one-half hours.

Circuit diagram (part 1)
Circuit diagram (part 1)
Circuit diagram (part 2)
Circuit diagram (part 2)
Ramkit as constructed by author.
Ramkit as constructed by author.

Memory Restrictions

Users should be aware of some of the memory restrictions that T/S,ZX computers place upon the Z80 microprocessor’s memory mapping structure. The Sinclair ROM and circuit logic have been set out in a manner that makes BASIC programming in certain RAM areas impossible. See the chart in Figure 1. Other functions may be implemented in these memory areas through either fancy machine code programming or unique hardware changes that may mask or restructure the computer’s memory map.

Figure 1. Memory Map

Decimal  Functional  Sinclair Map               Ramkit
Address  Address

65536    64K         Screen Display Area        D File must be relocated
                     BASIC variables and        Opcodes have no access, no
                     arrays. Mirror Image       BASIC or machine code
                     of 16K RAM                 programs here  [shaded]

49152    48K         Input/Output data          Opcodes have no access,
                     storage BASIC variables    no machine code here  [shaded]
                     and arrays
                     Two Mirror Images
                     of 8K RAM

32768    32K         User RAM, BASIC and        No ROM or input/output
                     machine code programs      here  [shaded]
                     16K RAM Module

16384    16K         RAM with operating         ROM usage by supporting
                     system support             peripherals may overlap
                     ROM and COS. Mirror        addressing
                     Image of ZX-81 ROM         RAM for user M/C and Data

8192     8K          Sinclair BASIC ROM         Paging ROMs would
                                                entail writing O/S
                                                software as well

Note: When Ramkit is connected, the internal 1K RAM is disabled by internally shutting the RAM CS line. Programming in the 8 to 16K region is by machine code only. This area will be safe from the NEW command. Any data stored here must be transferred to another location if this information is intended to be saved. RAM available for BASIC programs and operating system data in shaded area only.

Although many memory locations are very restrictive, do not be too discouraged about this. Some of these areas are still quite useful. For instance, in the BASIC ROM addressing area, locations 7680 to 8191 are used by Sinclair for character generation. One could easily write one’s own character set, bypassing Sinclair’s.

Once Ramkit is connected to the computer, after power-up, it latches onto the memory map by controlling both the ROM CS and RAM C/S lines. When Ramtop has been set, there is operational RAM for the selected areas shown by the user. Entry points to the monitor are still available.

Construction

If you are building the circuit board, use the layouts provided in this article. See Figures 2, 3 and 4.

Figure 2. Component side of printed circuit board.
Figure 2. Component side of printed circuit board.
Figure 3. Reverse side of printed circuit board.
Figure 3. Reverse side of printed circuit board.
Figure 4. Component layout.
Figure 4. Component layout.

The plastic case does not allow the usage of IC sockets due to sizing. Experienced builders should have no difficulty in soldering the chips directly onto the circuit board. We suggest that novices should first consult reading materials covering the basics of component soldering. Set up in a clear area away from carpets and static electricity; it never hurts to be near a well-grounded item such as a cold water pipe. Before you touch any component, discharge yourself of static by touching the electrical ground; my favorite on such occasions is the telephone — the bottom plate or metal stopper of the dialing mechanism on older telephones works very nicely. After you have collected your components together are ready to start, remember to take the time to properly identify each component and its proper positioning on the circuit board. Two common flaws in constructing electronic gear are a lack of precautionary handling and misplacement of components.

Insert each of the ICs first: simply fit them through the solder masked board into their respective positions. Bend a set of diagonally opposite pins of the IC to keep it from falling out before soldering. It is always best to bend a pin away from a close neighboring component whenever possible. This will aid you in preventing any hazardous solder bridges.

When all of the ICs have been mounted and their positions checked a final time, begin soldering. Mount and solder the rest of the components.

If you have collected your own components through various means, you probably have a length of edge connector which has to be cut down to size. Remember to insert a key in slot 3A/3B. This acts as the guide pin to allow for proper fitting of the RAM when completed.

An optional expansion buss has been included. Although it is not mandatory for Ramkit operation, it is still a good idea to add the extra printed circuit edge connector. After all, there is no sense in limiting your expansion capabilities where all other add-ons must be inserted before your 64K RAM.

Testing

Once final assembly is completed, it is time to try the new memory. Sinclair users with the standard 1-ampere power supply will have plenty of current to power up Ramkit. Owners of the earlier 650-ma. supplies are best advised to acquire the heavier unit before connecting their RAMs.

Ramkit will react visually as do other memory expansions. After powering your computer, there will be a quick glitch on the screen; shortly after, the cursor should appear in its normal position. If your RAM does not perform in this manner, quickly disconnect the power and check your construction. After verifying component layout, check solder joints carefully. Dry joints are a common fault.

Before final testing reset the computer’s system so that it knows more memory is connected. To set Ramtop for 64K addressing, enter “POKE 16389,255 ; NEW”. Now enter the memory test program (Listing 1). Should any failures occur, the defective memory chip should be identified and replaced. It is advisable to check the RAM select lines before replacement just to affirm your suspicions.

After all seems well, re-enter the test program in Listing 1.

Listing 1. Memory Test

10 FAST
20 CLS
30 LET X=VAL "256"
40 RAND
50 LET Y=X*RND
60 RAND Y
70 FOR I=VAL "17530" TO VAL "65535"
80 POKE I,INT (X*RND)
90 NEXT I
100 RAND Y
110 FOR I=VAL "17530" TO VAL "65535"
120 IF PEEK I < > INT (X*RND) THEN PEEK I "FAILURE AT ";I
130 NEXT I
140 PRINT "RAM TESTED OK EXCEPT WHERE LISTED"
150 STOP

Testing the full memory of Ramkit will take about half an hour. The VAL function is used here because of its unique reaction to stray values in variables. Whenever the T/S1000,ZX81 computer evaluates a numeric string with VAL, the expression must be completely true. If not, the basic operating system will crash the program. When doing a RAM test, it is most important to test each individual byte of memory. This may seem like common sense, as that should be the purpose of any memory check. Some manufacturers and technical writers prefer to use the dimensioning of large arrays (eg. DIM A(9000)). These tests may set arrays of great magnitude, but are unsatisfactory since they do not actually enter and retrieve data in each of their dedicated memory allocations.

Full Time Testing

If you wish to continually test Ramkit for an extensive period, please make the following changes:

140 CLEAR
150 GOTO 20

Parts List

IC1        74LS32
IC2        74LS86
IC3        74LS10
IC4        74LS240
IC5        74LS74
IC6,IC7    74LS157
IC8        74LS244
IC9-IC16   MK4564 N-20 Mostek Dynamic
           RAM 200 ns.
T1         7805 voltage regulator
C1-C12     .1M decoupling capacitors
J1         44-pin edge connector
PCB1       main layout board (see Figure 1)
EXT1       extension printed circuit board
           (see Figure 3)
           Case and assembly screws.

Where To Buy It

The complete package of components for Ramkit is available from Gladstone Electronics. The complete kit, including a case, costs $79.95 ($99.95 in Canada). A “barebones” kit consisting of a case, the main printed circuit board, edge card extension and 44-pin connector costs $24.95 ($29.95 in Canada). Ramkit is also available fully assembled for $99.95 ($149.95 in Canada). Please add $3 ($4.50 in Canada) to all orders for shipping and handling. Send your order with remittance to Gladstone Electronics, 1585 Kenmore Ave., Buffalo, N.Y. 14217. In Canada: Gladstone Electronics, 1736 Avenue Road, Toronto, Ontario M5M 3Y7.