Best solution for expanding ram to 128k on a zx48k?

User avatar
Paul
Posts: 1506
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: Best solution for expanding ram to 128k on a zx48k?

Post by Paul »

Can you please post a photo of YOUR pcb? We would like to see if your upper 32k are socketed or not.
In theory, there is no difference between theory and practice. But, in practice, there is.
emuola
Posts: 7
Joined: Tue Jan 08, 2019 9:03 am

Re: Best solution for expanding ram to 128k on a zx48k?

Post by emuola »

Paul wrote: Wed Jan 09, 2019 3:52 pm Can you please post a photo of YOUR pcb? We would like to see if your upper 32k are socketed or not.
Is this good enough? Took that before the s-video mod in October. If it's not good, I'll pop the Speccy open for a better picture :)
Attachments
20181019_173054.jpg
User avatar
Paul
Posts: 1506
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: Best solution for expanding ram to 128k on a zx48k?

Post by Paul »

Yes, they are soldered inside.
Both solutions need the internal 32k RAM to be desoldered.
This is not easy and no beginners task. The internal version (wich I prefer) also needs the 16k lower RAM to be desoldered.
Getting rid of the DRAM and replace by SRAM makes the critical negative voltage generation obsolete which I think is good.
These changes are hardcore.
In theory, there is no difference between theory and practice. But, in practice, there is.
User avatar
1024MAK
Posts: 5087
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Best solution for expanding ram to 128k on a zx48k?

Post by 1024MAK »

Before I explain further, a bit of history and a time line.

Sinclair’s engineering staff developed the ZX Spectrum 16k and 48k machine’s based on what they had learned in creating the ZX80 and ZX81. The ZX Spectrum+ is just a 48k board (or a 16k board) in a new case with a slightly better keyboard.

Then the Spanish developed the 128k (toastrack). Sinclair in the U.K. produced a slightly different version of the 128k, but fundamentally it is the same hardware.

Amstrad brought Sinclair’s computer stock, designs and rights. They then produced a new machine based on the 128k (toastrack) design. There are some differences, but again, fundamentally it is the same hardware (it uses the same ULA).

To reduce costs and add extra features, Amstrad engineers produced a new gate array and new PCB for a new version of the +2. To differentiate it from the earlier +2 (which is dark grey in colour), these new machines are called the +2A. However soon after it was introduced, Amstrad put the gate array on a smaller PCB to further reduce costs, this is the +2B. The +2A PCB is the same as the +3 PCB. The +3 of course having the disk drive chips fitted. So most black coloured machines marked +2 on top, are actually +2B machines internally (even if it says +2A on the bottom). The +2A/+3 PCBs being then used to build the +3 machines. There is a design fault with the audio circuitry, so later a +3B PCB was produced to replace the 2A/+3 PCBs in later +3 machines. The +2B PCB also has this audio problem fixed.

In making the new gate array, Amstrad engineers went on the information that they had. Unfortunately this information did not accurately reflect how the 128k (toastrack) actually worked...

The main difference in terms of RAM between the 128k toastrack / +2 (grey) and the later Amstrad designed +2A, +2B, +3 & +3B is in which bank is provided by which physical RAM chips. Both have the same amount of RAM. Both will change the RAM bank. RAM appears in the same RAM banks as you would expect. The difference is in the access time as seen by the CPU.

If a particular RAM bank is provided by the same RAM chips that also are being used by the system (ULA or gate array) to produce the video picture, then any access by the CPU will be subject to delay (called contention) during the time that the ULA/gate array is getting screen data from the RAM.

If however the particular RAM bank is provided by the RAM chips that are only connected to the CPU and which never provide screen data, then the CPU is never delayed in accessing them (known as uncontented).

When using BASIC, this does not have much of an effect, but it may have an affect when running machine code programs such as games.

If you are going to use existing GAL equations or configuration data, then I would not worry about it. I have not checked, but it’s likely that the GAL design files will be designed to replicate the 128k (toastrack) bank arrangement.

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
User avatar
1024MAK
Posts: 5087
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Best solution for expanding ram to 128k on a zx48k?

Post by 1024MAK »

Paul wrote: Wed Jan 09, 2019 12:02 pm My programmer is a tl866
I use latest lattice settings without problems.
I am not sure whether I have a deviceID check disabled or if it's on defaults.
Kind regards Paul
Thanks Paul :D

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
emuola
Posts: 7
Joined: Tue Jan 08, 2019 9:03 am

Re: Best solution for expanding ram to 128k on a zx48k?

Post by emuola »

1024MAK wrote: Wed Jan 09, 2019 4:27 pm Before I explain further, a bit of history and a time line.

Sinclair’s engineering staff developed the ZX Spectrum 16k and 48k machine’s based on what they had learned in creating the ZX80 and ZX81. The ZX Spectrum+ is just a 48k board (or a 16k board) in a new case with a slightly better keyboard.

Then the Spanish developed the 128k (toastrack). Sinclair in the U.K. produced a slightly different version of the 128k, but fundamentally it is the same hardware.

Amstrad brought Sinclair’s computer stock, designs and rights. They then produced a new machine based on the 128k (toastrack) design. There are some differences, but again, fundamentally it is the same hardware (it uses the same ULA).

To reduce costs and add extra features, Amstrad engineers produced a new gate array and new PCB for a new version of the +2. To differentiate it from the earlier +2 (which is dark grey in colour), these new machines are called the +2A. However soon after it was introduced, Amstrad put the gate array on a smaller PCB to further reduce costs, this is the +2B. The +2A PCB is the same as the +3 PCB. The +3 of course having the disk drive chips fitted. So most black coloured machines marked +2 on top, are actually +2B machines internally (even if it says +2A on the bottom). The +2A/+3 PCBs being then used to build the +3 machines. There is a design fault with the audio circuitry, so later a +3B PCB was produced to replace the 2A/+3 PCBs in later +3 machines. The +2B PCB also has this audio problem fixed.

In making the new gate array, Amstrad engineers went on the information that they had. Unfortunately this information did not accurately reflect how the 128k (toastrack) actually worked...

The main difference in terms of RAM between the 128k toastrack / +2 (grey) and the later Amstrad designed +2A, +2B, +3 & +3B is in which bank is provided by which physical RAM chips. Both have the same amount of RAM. Both will change the RAM bank. RAM appears in the same RAM banks as you would expect. The difference is in the access time as seen by the CPU.

If a particular RAM bank is provided by the same RAM chips that also are being used by the system (ULA or gate array) to produce the video picture, then any access by the CPU will be subject to delay (called contention) during the time that the ULA/gate array is getting screen data from the RAM.

If however the particular RAM bank is provided by the RAM chips that are only connected to the CPU and which never provide screen data, then the CPU is never delayed in accessing them (known as uncontented).

When using BASIC, this does not have much of an effect, but it may have an affect when running machine code programs such as games.

If you are going to use existing GAL equations or configuration data, then I would not worry about it. I have not checked, but it’s likely that the GAL design files will be designed to replicate the 128k (toastrack) bank arrangement.

Mark
Ok, that was a very detailed explanation, which even I could understand :) Thank you.

One more thing: I understood that the other example I posted indeed is an external ram expansion:

https://velesoft.speccy.cz/zx/external_ ... /index.htm

Is it possible to use let's say an external ram expansion + external ay + external storage (such as Divide etc.) simultaneously, provided that at least the first two expansions have a pass through connector? To me it looks like the external ram expansion does not have the passthrough, so it would be the last one "in the chain". Sorry, this is just my unprofessional reasoning, please correct me where I've gone wrong :oops:

If it's not, I think I'll start tinkering with the generic (internal) 128k expansion. Let's see what happens :mrgreen:

*edit*

Replying myself: the external expansion has this shortcoming: "This upgrade can't support videoram switching. It is used only first videoram."

The internal one seems to support 2nd vram also. Da*n.

I'm not sure if this is exactly what Mark posted earlier :?: Not using 2nd vram is a showstopper?

*edit2*

It seems the 2nd vram is also called shadow ram and some older games don't work correctly with 128k. There is a way to circumvent this with a certain basic command before loading the game though. Hmm. Also shadow ram can apparently be used for double buffering. Does not sound too bad.
User avatar
1024MAK
Posts: 5087
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Best solution for expanding ram to 128k on a zx48k?

Post by 1024MAK »

Video RAM is the RAM used by the ULA (or gate array) to produce the video picture. In a ZX Spectrum 16k or 48k, this is always the same area of RAM in the “lower” RAM chips, that is, the 4116 chips (eight 16k chips each one bit wide).

The 128k machine (and later machines) have 128k chips. The logic is arranged so that the CPU can choose if the ULA / gate array uses the normal area of RAM, or an alternative area of RAM (in the same chips) by changing the address lines between the ULA / gate array and the RAM.

But this can only be done for internal modifications, as the ULA has no access to any external RAM.

The loss of this feature will affect any 128k game that makes use of it.

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
emuola
Posts: 7
Joined: Tue Jan 08, 2019 9:03 am

Re: Best solution for expanding ram to 128k on a zx48k?

Post by emuola »

1024MAK wrote: Wed Jan 09, 2019 11:38 pm But this can only be done for internal modifications, as the ULA has no access to any external RAM.

The loss of this feature will affect any 128k game that makes use of it.

Mark
Ok, this makes it clear, altough it's unfortunate and makes the ram expansion project a whole lot more challenging :/ Thanks again Mark and Paul for clearing things out for a sinclair noobie :)
User avatar
RS232
Posts: 42
Joined: Fri Apr 05, 2019 8:57 pm

Re: Best solution for expanding ram to 128k on a zx48k?

Post by RS232 »

You could just simplify things and retro fit a 128 board inside a 48k case which maybe 1. Cheaper 2. Less risk of damaging.

Was there any ram packs made for the 48 or 16k spectrum? If so a clue to further expansion could be found inside. 64 ram packs were produced for the zx81. It wouldn't surprise me if you were able to modify one to work on a spectrum.

I have a 48k model and planning on putting a volume control on the internal speaker, ive changed the regulator that drops the 12v to 5v both the zx81 and spectrum heat up too much with the stock ones... bad news when the devices have nasty cheap capacitors thay dry out and start to lower the shelf live of your kit.. gulp
User avatar
1024MAK
Posts: 5087
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Best solution for expanding ram to 128k on a zx48k?

Post by 1024MAK »

There were 32k byte RAM packs available for the 16k byte ZX Spectrum model.

The arrangement of most of the signals on the edge-connector on the ZX Spectrum models is different to that of a ZX81, so ZX81 RAM packs can’t be used.

The Z80 CPU only has an address space of 64k bytes. The original ZX Spectrum machines have 16k bytes of ROM and either 16k bytes of RAM, or 48k bytes of RAM. So for a 16k machine with 32k RAM pack, or a 48k machine, the whole of the Z80 address space is used up. There is no room or provision for any more memory.

In the ZX Spectrum 128k models, the work around is to use extra circuitry to provide a system called bank switching. This switches memory into the address space of the Z80 while switching out the area of memory that had been previously selected.

But no signals are provided on the edge-connector to deselect any of the internal RAM. So any external memory is only compatible with 16k machines (or 48k machines where the upper 32k of RAM has been removed or disabled).

This is very different to the ZX81, which did have a control line to disable its internal RAM.

So to sum up, you can’t have extra external RAM on a ZX Spectrum unless it is a 16k RAM model.

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
Post Reply