Showing posts with label Sinclair. Show all posts
Showing posts with label Sinclair. Show all posts

Sunday, 1 March 2020

A ZX Spectrum with 80K of RAM?

This ZX Spectrum apparently has 80K of RAM.

The image was posted on Twitter by Claire, ZX Claire, and I was intrigued as I hadn't come across the East London Robotics SP80 upgrade kit before.

The kit is to be used to upgrade a 16K ZX Spectrum to 80K, the base 16K, plus the normal expansion of 32K giving the 48K plus a second bank of 32K accessible via an OUT instruction to take it to 80K.

It looks a little bodged, but that was the product as supplied.

Issue one Spectrums had 16K on board, and two sockets at the back to fit a 32K RAM module, but by the time they got to issue two, the extra RAM had been integrated onto the mainboard.

You could still buy 16K versions, and later upgrade them to 48K, there were sockets where the eight RAM chips and four logic chips required for the upgrade could be installed. Later machines were supplied as 48K as standard and these parts were soldered directly to the board.

The logic chips between the ULA and the Z80 handle multiplexing the address bus for the RAM chips. IC3 and IC4 are for the lower 16K of RAM (present on all Spectrums) and the other four chips are for the initially optional extra 32K.

The RAM used was normally marked 4532, and was a little unusual in that they were 64K x 1 RAM chips that had faults, but at least half the chip was OK, so they were sold as 32K x1 RAM chips so only the good sides would be used. This is sometimes reported as a cost cutting measure, which it was, but also, 32K was all that was left in the address space after the 16K ROM and 16K RAM already present were used, so it was better than wasting 32K of good chips, or fitting 16 16K chips. (or you have the equally unsatisfactory solution of the Acorn Electron, 4 bits x 64K and access them in two halves over two cycles to give 8 bits x 32K, but at a slower speed)

There were two types of 4532, one where the top half was good, and one the bottom half. This was selected by a jumper on the board, maked LK3 and LK4 on the schematic. You occasionally see a wire link from pin 10 of IC26 to it's ground pin or 5V pin so the user could install the chips without having to change the link.

I've redrawn the relevant section here, the 74LS157 mux chip is used to set the address to be accessed in two sections, a row and a column. That is how DRAM seems to like it, it keeps the pin count of the RAM chips down.

Here the first part of the address is made up of A8, A7, A14 and A9. RAM doesn't care what order the address lines are in. You read back from the same location you wrote to, so it's not important what order they are in. The second part is made up on A1, A0, A2 and where there forth address would be is either tied high or low, to access only the top or bottom half of RAM.

The upgrade kit was supplied with 4164 RAM chips, full 64Kx1. (pictures of the modified board kindly supplied by Claire). The kit adds some logic which forms a latch, so that the extra line on the mux chip is switched from high to low under software control, and indicates which bank is active with an LED which would shine out of the expansion port.

There is an extra logic chip (a 74LS02) sitting on top of the 74LS157 mux chip, soldered to some of it's pins, with wires going to the 74LS00 and 74LS32 chips that were all part of the upgrade.

Some of the pins of the 74LS00 are bent up. Originally, only two gates were used, so the spare gates are used as part of the logic.

I reverse engineered what was going on from the Spectrum issue 2 schematic and the photos. There's a little bit of guess work going on here as I think there are some links under the chips and the connections between the 02 and the 157 underneath are unclear as one is 14 pins and the other 16 pins, so it's sitting between the pins.

I've redrawn it for clarity, this is what I think is going on. The circuit does indeed drive the extra input to the 157 mux, with the state being shown by the LED. Starting on the left, if A7 is low and /RD is low, then there is a write operation where bit 7 of the address is low, and the output of IC26U.2 is high (that is the 02 which is above IC26). Next if MREQ is high, then it is not a memory request, so it must be an IO operation. If those two are high, the output of the gate goes low. That signal is used as the trigger for the rest of the circuit, it only goes low when there is an IO write operation with bit 7 low. (N.B. this turns out be be /WR not read, as pins 4 and 5 of IC20 are transposed on the schematics - see the update at the end)

Anyone still following? That signal going low causes the output of IC24.4 to go low irrespective of the state of the signal driving the LED. This then feeds one input to a flip flop made up of IC26U.1 and IC26U.4. The output of IC26U.1 then goes low and the LED turns on. That then feeds IC26U.3, if A14 is high, that won't make any difference, and the state will be latched with the output low and the LED on. However, if A14 is low when this happens, then the other half of the flip flop is triggered and the output is latched high and the LED goes off. I think the 3K9 resistor delays things slightly to make sure the sequence is followed.

This tallies with the manual, to activate 'page 2', type OUT 65407,0. 65407 is FF7F in hex, or 1111 1111 0111 111 in binary, so you can see bit 7 is low. (the ,0 is irrelevant as the databus is not connected so you could use any value). To switch back to 'page 1', type OUT 49023,0. That is BF7F, or 1011 1111 0111 1111, bits 14 and 7 low.

That's it for the moment, I think the reverse engineered schematic is correct. I need to dig out a suitable machine to try this out on. It is an entirely reversible mod, as all the wiring is between the chips in the sockets that would have been part of the kit. I would also be interested to find any software which can make use of the extra RAM, otherwise it's interesting but essentially pointless. I don't think this was around long enough to gain traction, and as soon as Sinclair started shipping boards with 48K as standard and no sockets, this was no longer an option and so this didn't gain the ground it may have done if it had been available for later machines.


Stop Press:

Claire has found another one, this time buried inside a DK Tronics case, along with a whole lot of other stuff!

This one looks like it has a switch to disable the mod (maybe it caused some issues with software inadvertently writing to an IO address with bit 7 low?). It's not clear how that is connected as it is covered with tape, but my guess would be pulling the end of the 3K9 resistor to ground to stop that half of the flip flop from being activated.


Update

See below a video from Happy Little Diodes which goes into more details on this upgrade with a very comprehensive explanation of what is going on.



Advertisements

I don't sell 80K upgrades, or Spectrums, but if the ZX81 or ZX80 (or even Commodore PET) is more you thing, I do have the full range of Minstrel and Mini PET kits and accessories.

UK and US only I am afraid, I can ship worldwide, contact me with your location and what you want. Sorry I have to keep saying that. I am working on an alternative.

All the links can be found here:

Patreon

You can support me via Patreon, and get access to advance previews of posts like this and behind the scenes updates. These are often in more detail than I can fit in here, and some of these posts contain bits from several Patreon posts. This also includes access to my Patreon only Discord server for even more regular updates.

Sunday, 14 April 2019

ZX81 with early ULA

This is an old post, preserved for reference.
The products and services mentioned within are no longer available.

Slightly unusual blog post today. Here's a broken computer I'm not going to fix.
It's a ZX81 in not too bad condition, but with one of those aftermarket keyboards on. These give it a sort of ZX Spectrum 48K style feel.
It would originally have been stuck on, but the adhesive has dried up over time and it fell off easily.
The rubber keys press down on the original ZX81 membrane, so underneath is a standard ZX81.
This one is not working, so time to venture inside.
For once, the keyboard membrane tails don't look too bad.
This is an issue 1 ZX81 board, but quite an early one. The giveaway is the ULA.
This is one of the early ones with only a date code, no other labelling. So we know this one was produced sometime shortly after the 11th week in 1981.
Most of the issue 1 ZX81 boards after this had Ferranti labelled ULAs, 2C184E versions, and most of the chips were socketed.
Back to the earlier board, and the ROM is also soldered in, and I think is also an earlier buggy version.
The Z80 is an original Zilog part, dated even earlier, 30th week 1980.
The RAM is difficult to read, a Mostek MK4118 8038 date code?
It is at rather a jaunty angle. All the bits must have fallen down to one side.
The 5V is there, and there is a clock and the Z80 is doing stuff, but the screen is white. Testing with an external RAM pack makes no difference, so it's probably not the internal RAM, or at least not only the internal RAM.
It's looking like the ULA is faulty, and it's not socketed and soldered in. I've got (many) other ZX81s, so I don't need this one to work. It would be a shame to remove the ULA and replace it, or even to straighten up or replace the RAM, as that would make it just the same as any other issue 1 ZX81, so in this case, I think I'm going to leave it alone.

Wednesday, 27 March 2019

ZX Spectrum +2 Grey Repair - Working but with screen corruption

This is an old post, preserved for reference.
The products and services mentioned within are no longer available.

Here is a slightly unusual ZX Spectrum +2 128K, the grey model. It appears to be running, but there is noise on the screen when it is working.
The noise doesn't appear to be analogue in origin, it is very clear regularly repeating patterns, and they stop when you hold down reset. Quite strange.
Normally when you see screen corruption like that on a Spectrum it is a RAM fault, it is in the shared memory bank that provides both the screen RAM and the lower 16K. That means the Spectrum doesn't usually work.
This one is a little twitchy, some things aren't running, but running the same thing from a ROM appears to work better.
And indeed this memory tests pass.
As does the other one.
So, I was less inclined to think this is a memory problem. (I was wrong, but please don't judge me). The 128K has a lot more going on inside that the original 48K machine, but still has a lot in common.
I had seen something similar on a 48K Spectrum, there it was a problem with the multiplexor chips which switch the RAM address lines between the Z80 and the ULA (which generates the screen display).
On later Spectrums, and the Grey 128K, the multiplexor chips are combined into a single 40 pin package, here marked PCF1306P. I desoldered and socketed that, and tried a known working MUX chip (a later Amstrad 40058 version), but that didn't make any difference.
I also looked at a few other chips involved in the multiplexing circuitry, before accepting that it probably wasn't there.
Maybe it was the RAM then? Even though it was passing RAM tests? I decided to get a second opinion before starting on the RAM.
Brendan Alford (the author of the ZX Diag software I had been using for testing) confirmed the RAM hypothesis (and referenced an article he had written about ZX Spectrum RAM faults). He even pinpointed the problem chip for me.
IC26 is bit 6 of the lower bank of memory (which is shared between the CPU and the display). You can see for looking closer that all the lines are on the second pixel along on each character. The rest of the characters are fine, although the background brightness changes (which is also controlled by bit 6).
I removed IC26 and replaced it with a known working chip. I didn't have the same speed (150nS) to hand, so I used a faster 120nS chip.
Success. The corruption has gone, so it seems the RAM was woking fast enough when the CPU accessed it, but not quite fast enough for the video RAM. Most of the Grey 128K machines I have seen had 120nS RAM, so maybe they changed to that later on.
This one now has the single 120nS chip, and the rest still seems to be coping fine after a soak test. I wouldn't normally mix speeds, but you can get away with it as long as your replacements are not slower than the originals.
That seems to have fixed it. Can't say I've come across a RAM chips which was right on the edge of failing, but still just about running OK at slower speeds.
Time for some more testing with the built in tape drive, and a divMMC future.