Thursday, 20 July 2017

Commodore Amiga 600 and 1200 USB keyboard kit

I have had few requests for USB keyboard kits for Amiga 600s and 1200s, so here they are.
The A600 and A1200 are very different from the Amiga 500. The A500 had a keyboard controller board on the back of the keyboard, and a serial interface to the mainboard. The Amiga 500 USB keyboard controller I built for that was a lot simpler in hardware terms, but a bit more effort to implement the serial protocol in the microcontroller.
The A600 and A1200 have no keyboard controller, and just a simple membrane connection to the mainboard. These have more connections and a smaller pitch than any of my previous USB keyboard controllers, so I have made a custom board.
The A600 cable is 30 way and the A1200 is 31 way, with a slightly different pinout. I found matching 30 way sockets for the A600, but I have not been able to get 31 way sockets, so I have used 32 way sockets for the A1200, just make sure the cable is aligned to the left of the connector.
The board mounts on the back of the keyboard using some self adhesive pillars. The cable on the LED board is not long enough to reach, so I supply a short extension cable.
The power LED is lit whenever the keyboard is plugged in. I have set the floppy and disk activity LEDs to act as scroll lock and num lock. You could drive these from software if you wanted to use them for another purpose.
They keyboard has a built in caps lock LED which shows the current state.
As usual the kit does not include an Amiga or keyboard, you need to provide those yourself, and please try to use a broken one.
The kit does include the USB keyboard controller, the LED cable, mounting pillars and a USB lead, and is available to buy from my Tindie Store.

I also have various single and dual 9 way D to USB joystick adapters that would fit nicely in the A600 or A1200 cases. These allow you to use original 9 way D joysticks (like Zip Stik or Competition Pro etc.) as USB joystick devices, contact me for more info.

Sunday, 16 July 2017

RC2014 Modular Z80 System

I'm sure you've all heard of the RC2014, it's a modular Z80 computer system available from seller 'Semachthemonkey' on Tindie. A great little system that makes it easy to build and expand a Z80 based system. (or even a 6502 system as the base is very adaptable).
I've just bought some new boards to add to my RC2014 system, so I thought it would be a good time to revisit the current system and go through all the boards on there before I add the new ones.


The system is based on a backplane with a common bus, 40 pins wide, carrying most of the Z80 lines. It uses 40 way 0.1" sockets for the modules to plug into. This is the 'back plane - 8' model where slots 1 and 2 and slots 7 and 8 can have their address and databusses isolated from the main slots, 3-6. This will allow some protection on the bus via resistors or to use split address and databusses for some cards to create ZX81 or ZX Spectrum type systems where the busses are isolated to simplify the screen generation process.
Into the backplane plug a selection of modules. Most are less than the full 40 pin width, and all align with the top of the backplane, pin 1, with the exception of the clock / reset module which hovers around the middle. Full details of the backplane and other modules can be found on the website.

Z80 CPU Module

The heart of the system is the Z80 CPU board. This has little else on there, other than a pullup resistor on the INT line. This is an older board, with inputs not passed to the backplane such as NMI, WAIT and BUSRQ tied high, the later versions have an option to tap these off or tie them high. Full details here. Like all of the other modules here, there is no decoupling on the boards, only on the backplane. I'd like to see the traditional 100nF on each chip, I think that has happened on the later modules.

Clock Module

The clock generator comes on a small separate board. This generates a buffered 7.3728MHz clock. I would have thought it logical to place this on the Z80 board, but I guess there are reasons to separate them. There is also a position for a reset switch, but I deviated from the normal build here and added instead an RC circuit to give a power on reset. There is a reset button on the backplane anyway. Here I found a 74LS04 wasn't up to the job, but a 74HCT04 was fine. Full details here.

8K ROM Module

The Z80 needs some code to run, so it gets that from the 8K ROM module. This has a 27C512 EPROM split into 8 banks of 8K, selected by jumpers. Full details here. As supplied, it came with a version of BASIC adapted from the NASCOM computer by Grant Searle - more details on his site. This is fixed 8K ROM decoded to the address range 0x0000 - 1FFF. There is a later module which allows bank paging, which is one of the new ones I have ready to install.

32K RAM Module

BASIC needs some RAM to run in, so here is 32K of RAM, mapped as 0x8000-FFFF. Again, this is a fixed mapping and a newer board has up to 64K and paging capabilities. Full details of the 32K RAM board here. If I remember correctly, this is another one of the boards where I started with a 74LS32 and changed to a 74HCT32 as I found some RAM chips (the Alliance AS6C62256 shown) didn't work with the LS chip, but other 62256 chips were fine.

Serial IO Module

This final module for the BASIC system provides serial IO. This is based on the 6850 (although the 6350 can be used, as can 6xA50 and 6xB50 variants). These are the only part in this system that are out of production, so are old parts, the 68B50 I got didn't work, but I had a 6850 and that worked correctly. The system 7.3728MHz clock is divided down to get the serial baud rate. Divide by 64 gives 115200 baud. There is space to install a MAX232 and a 9 way D connector for an RS232 compatible port, but the easiest option is to use the FTDI header to connect to a PC via a USB serial adapter. The jumper above also allows the RC2014 to be powered via this connector. The 6850 is accessed at address 0x80 and 0x81 (but is also mirrored from 0x80 through to 0xBF) . Full details here.

The RC2014 in use

With all of those plugged in, you can see that two face in the opposite direction to the others. This means the central modules are close, so I have some plastic feet stuck on the back of the RAM card to stop it touching the CPU card. Since all my FTDI cables were bricked by FTDI last year, I am using an Arduino module which does the same job, and that is set to power the whole unit (current consumption is under 200mA, and the USB port can in theory supply up to 500mA).
Connecting up via a serial terminal and switching on, we're into BASIC and away. Without adding any storage, the easy way to get programs onto the system is to paste into the terminal Window. I have had mixed results and usually need to get the terminal program to add a 10mS line delay or a 1mS character delay to avoid corruption when transferring large programs, as there is no flow control in place.
You can then transfer some BASIC programs over to test. It is a pretty generic Microsoft BASIC with most of the usual commands supported. The great thing with a system like this is that if you find there is something missing, go and grab the source for the BASIC interpretor and add your own commands.

RC2014 Mini

Something else I should probably mention at this point is the RC2014 Mini. This is basically all of the above on a single board. It can be used standalone, of there is space to fit a 40 pin connector on the side to add a single module, or a backplane full of modules. This one is also driven via FTDI serial cable, or you can use the RC2014 Universal Micro Keyboard.
That is what that keyboard is meant to be used for, even though I keep using them on my Minstrel ZX80 clones.
So that's the existing modules I have covered, next time I'll be replacing several of those with new ones.

If you want to support this blog, you can donate via Patreon or Paypal, or buy something from my store.

Saturday, 1 July 2017

Z80 M1 signals

During testing of the DivMMC future, one of the aims was that it should work with as many ZX Spectrums as possible. In many cases, the clock line was the most problematic, but we managed to resolve that one (more on that in another blog post).
One thing that we have not been able to address is the M1 line on the expansion bus. This is wired directly to the Z80 and is not used by the internal circuitry of the ZX Spectrum, but is required by the DivMMC circuitry.
The Z80 datasheet describes it above, it is used to indicate specific conditions of IO and Memory request cycles. We have all heard various comments about 'weak M1 lines' etc. being the reason some external devices do not work with some Spectrums. Indeed, this affects not only the DivMMC Future, but things like Sinclair's own Interface 1.
In normal operation, M1 is toggling up and down with all the other signals, between 0V and about 4V, which is well with the specification for a digital pin. In all systems where the M1 line has looked like this, we have seen the DivMMC future work correctly.
I have seen several systems where the M1 line does not look like that. Here it is just noise, floating about 1V. I have tried various options to see if there is any signal there, triggering off IORQ and MREQ instead, but it really is just noise. If it were a weak signal, it could be boosted. But this is just no signal.
Adding a pullup does just that, pulls it up, so it's now floating around 3V, still not doing any good.
I have seen this 'missing M1' on various manufacturers versions of the Z80, GSS, NEC, and even an original Zilog.
When this was replaced with another Z80, the M1 signal was present and the board worked fine.
The same Z80 was then tested in another known working machine and the missing M1 signal had transferred with the Z80.
This isn't like the clock signals, where they are at least present on all boards, albeit barely 1V peak to peak in some cases. There just isn't anything there to work with. I'd be interested in anyone has examples of Z80s with 'weak' M1 line, where there is a valid signal, just running at too low a level, rather than just being noise.
Having seen cases of seemingly identical chips, one with a working M1, one with just noise, I don't think this is a case of corner cutting on Z80 clones. It looks more like these were either manufacturing faults, not picked up as the Spectrum does not need the M1 line, or the M1 line has been damaged in the past. I wonder if this is perhaps due to the ZX Spectrum edge connector:
M1 (marked as M1L meaning M1 - active low), is right next to the 12V AC line (a point tapped off the DC-DC converter). I wonder how many misaligned joystick interfaces accidentally shorted the 12V AC into the M1 line and killed it?
Given this signal is important for the operation of the external devices, if it's simply not present, then the external devices are not going to work, so you need a new Z80. In all cases where this has been seen, replacing the Z80 has always resulted in a working system.

Monday, 26 June 2017

Spectrum 128K +2 Grey Repairs

As part of the multiway programmer for the DivMMC Future programmer for The Future Was 8 Bit, we needed a number of Spectrum boards.
The Grey Spectrum 128K +2 was chosen as these are fairly plentiful, and offer all the things required for the programmer, in a fairly compact format.
To put together a rack like that, you don't want to be taking mint Spectrums out of their tube and pulling them apart, so time to have a look through the 'broken' pile and try to resurrect some boards.
Standby for a bumper blog post.


Before I start, here is an example of a complete, working +2, time for a quick tour. First off, these are referred to as 'Greys' because they came in a grey case. Not be to confused with the later +2A and +2B which came in a black case and had very different boards inside.
This is the issue 3 version of the board. Much the same as the issue 1, with a few issue fixed and more introduced. They are a repackaged version of the 'Toastrack' Spectrum 128K, with the addition of the built in 'datacorder' cassette player and the two (non standard) joystick ports.
The three chips on the top right are the ROM, (Amstrad part number 40054). This is a 32K ROM chip, the lower 16K of which is the same as the 48K Spectrum ROM (apart from the Amstrad copyright message and a rew relocated routines because of that). The upper half is the 128K version of BASIC. The pinout is the same as a standard 27C256 EPROM. Next is the Z80 CPU, they were mainly using original Zilog parts on the +2. The last is the upper RAM multiplexor (Amstrad part number 40058), the same part as the PCF1306P / ZX8401 introduced in the issue 5 48K Spectrum, and also used on the 6A Spectrum and the 128K Toastrack. This is basically four 74LS157 style multiplexors and some glue logic. It replaced 6 chips in the Issue 4 and earlier Spectrums. Finally of note is a PLD chip, maked HAL10H8 (Amstrad 40061). This is some glue logic for the bank switching etc. This can be replaced by a GAL16V8 style chip, such as an ATF16V8 with appropriate programming. (more infomtion here, including an updated version with some bugfixes).
The 128K has two sets of eight 4164 DRAM chips, giving 64K each. This is split into 8 banks of 16K. The top set (labelled in green) form banks 0,2,4 and 6. The lower bank (labelled in red) form banks 1,3,5 and 7. Note the chips run in different orders, with D0 and D7 at opposite ends. Bank 5 replaces the lower 16K of RAM in 16K and 48K Spectrums, this is 'contended' RAM using by both the CPU and the screen RAM, so banks 1,3 and 7 are also slower and the uncontended banks in the top set of chips.
Some of the diagnostic tools give fault reports based on the 48K Spectrum IC numbers, so the upper set, IC17-IC24 map to IC15-IC22 on a 48K Spectrum, and the lower set, IC25-IC32, map to IC13-IC6 (note reverse order).
The right hand side of the board contains the audio visual side of things, I won't be going into that much further. The AY-3-8912A provides 3 channels of audio effects in addition to the standard Spectrum ULA audio. As with all of the 128K range, the level mixing of these four sources is not well balanced, and ULA sounds are usually much louder. The AY chip also provided bit banged serial IO. The TEA2000 is the colour encoder, and the Amstrad 40057 is the dual joystick port IO chip.

Here are a selection of boards that should be able to be patched up to do the job. I numbered them as I took them out of the box, to keep track of things.

Board 1

Board 1 appears to have become a spares board. The ULA, ROM, RAM and CPU have been removed from sockets. The RAM multiplexor and power socket have been desoldered and the lid of the modulator has been nicked.
First step is to repopulate the missing bits. With all of those back, we've got a working machine. Or at least so it seems. It seems to work for a while, and then fail, sometimes with an intermittent error usually on line D4 on the lower RAM (IC28 for those of you following along at home).
It had run several tests successfully before this one, and then after this failed. This repeats if you leave it to cool down for a while. Nothing is getting particularly warm though.
After a while, it just goes to a state where it shows this half white half black screen. I've checked all the connections as far as I can see, and replaced all the relevant parts with multiple known working parts, and still it seems to start OK then deteriorate each time it is powered on. I think there may be some unseen damage to the board, or hairline cracks somewhere, or a bad connection triggered by thermal expansion. Unfortunately I think this one is going back into the 'broken' pile.

Board 2

Board 2 is fairly intact. The RAM multiplexor has been removed and socketed, as have several RAM chips. The ROM is missing. There is a ULA present (the only one in this pile), but is missing the heatsink. Lets hope we have better luck with this one. Again first step is to insert working parts to fill the gaps.
I am swapping between two test ROMs here, both burned to 27C256R chips and fitted in the system ROM socket. Firstly Brendan Alford 's ZX Diag V1.28. This is good at testing the lower 16K RAM, and does well to indicate the problem even with the faulty display RAM. It doesn't test the full 128K RAM unless you go through the menu, and I don't have a keyboard connected at this stage.
Here there were several RAM faults. The screen cycles around and you can usually make out the message, even though the screen RAM is faulty, it also gives several beeps to indicate the good or bad bits. Here it is saying bits D2 and D7 faulty, also indicated by the red bars on the side. It gives the IC numbers for a 48K Spectrum (IC8 and IC13). Translating those to IC30 and IC25 on this board, I swapped those chips out.
It later indicated a further error with D4 (IC28), which I also swapped out, and that passed all initial tests on ZX Diag. With the lower RAM working, I switched to Paul Farrow's 128K RAM tester. This retests the lower RAM and also tests all the banks of RAM on the 128K.
No faults here, all looking good. I fitted a heatsink to the ULA since it was missing the original Amstrad clip on heatsink, and left it soak testing for a while, occasionally resetting it to restart the test.
Time to test with the DivMMC future to load some further test software. This initially failed as the edge connector was dirty. A quick rub over with some contact cleaner and a fibreglass pencil and it's gleaming again.
Back to the DivMMC future and it loads fine. Now running the tape version of ZX Diagnostics (loaded from SD card), which will test ROM and system RAM (and other things if you hold down keys - see the link above for full instructions). That ran a soak test for a while and didn't detect any faults.
Important tests like JetPac and the 128K version Spellboard also passed. So that's one success.

Board 3

Board 3 is also fairly intact. The ULA and modulator lid are missing. The board appears to have been 're-capped' at some point as all the capacitors look new. The coil looks to be damaged, but it turned out to just be the heatshrink covering that had come off.
The RAM is all socketed, and only one is missing. There is a mixture of 12ns and 15ns A and B parts which is not ideal (and the one which is missing won't help much either).
When testing, I am using a current limited bench power supply, set to 1.5A maximum. That should be enough, a working +2 seems to vary between 800mA and 1.2A depending on the type of RAM chips.
This board went into current limiting straight away, the ROM and several of the RAM chips were getting hot. I removed the hottest and it took a couple of goes to get three bad chips that were apparently shorting out the 5V rail. I filled the gaps with some matching RAM and tried again.
This is doing the same black and white thing as board 1. Tried with two sets of working parts, but to no avail. Seems to be some kind of addressing issue, but all the parts which do the addressing were swapped with known working parts, which worked fine on other boards?
The RAM test also seems to pass, you can see the eight green bars down the side. I am putting this one to the side as well, but stealing the remaining working RAM chips for the other boards.

Board 4

Board 4 was only missing the CPU and ULA, and one RAM chip had been socketed. The most complete board so far. So far, it is the most complete board, lets see if that continues.
On power up, it was drawing lots of power, I had to nudge the limit up to 1.6A to stop it limiting, several chips very warm, lots of RAM faults detected. Given 5 of 8 had failed, I decided to replace the whole bank.
I also replaced one of the transistors in the power section which had been replaced with a part with a lower current rating. I fitted a ZTX651, which is the same as the ZXT650 normally fitted, just with a higher voltage rating. The original ZTX213 was still present, so I left that alone. These transistors form a similar power circuit to that used on the 48K Spectrum to provide the +/- 12V for the RAM. Here it is used for video output and the psuedo RS232 drivers.
That passed the lower RAM tests, but lots of faults were detected in the upper bank as well. I ended up socketing and replacing all the RAM.
I fitted a ZIF socket on one of the lower RAM sockets and went through all the chips from the previous boards, retesting all the removed ones, the desoldered (presumably faulty) one, and retesting my test chips.
The Spectrum Test ROM is great for this because you get an immediate indication of the state of the lower RAM on the first image. When there are lines through it, like this, you've got a problem.
Out of that I just about managed to get a set of 16 matching KM4164B-15 chips, and another working Spectrum 128.
Another dirty edge connector cleaned and the DivMMC was up and running. You can see the marks from where something was plugged in over a long period of time.
That passed all the tests and was left on soak.
Another Spectrum 128K back in action.

Board 5

Board 5 is missing only the CPU and ULA, so does that bode well based on how board 4 turned out? At first it did nothing, which turned out to be a bad power connector. With that replaced (or rather temporarily bypassed), I can test the rest. That's bound to be OK, right?
Initial testing showed a few errors, starting with D0 on the lower RAM. The RAM faults then continued to multiply on soak testing, failing one after another. This board has KM4164B-12 parts, 12nS access time rather than -15 as the others. I've matched those were possible, but had to switch to 10nS parts for the upper bank.
At this point, I have run out of RAM chips, 16 pin sockets and patience. This probably needs all the RAM removing, sockets fitting and a full new set of RAM.


The results of this is 34 faulty RAM chips (and plus another dozen still on board 5) and one bad ROM chip. History does not recall whether the parts originally missing were removed as they were faulty awaiting replacements or more likely removed working as the rest of the board was deemed faulty. These boards all date to mid 1986, and all the failed RAM chips are Korean made Samsung KM4164B. Is this just a bad batch that start to fail after only thirty years?
All Spectrums are broken. If you're Spectrum is broken, don't send it to me. If you want your Spectrum repaired, I suggest you sent it to Mutant Caterpillar.

If you want to support this blog, you can donate via Patreon or Paypal, or buy something from my store.