Sunday, 24 June 2018

Amiga 500 USB keyboard with Raspberry Pi 3

Here we have a Commodore Amiga 500.
This one's not working, showing only a green screen.
The green screen usually indicates a RAM fault, sometimes Gary or Agnus or their sockets.
In this case it could also be due to corrosion. This look like it's had one of the A501 upgrades installed which leaked into the machine.
That's fine because I want to borrow it's case, I'll repair the board later.
I have been sent a kit of 3D printed parts designed by MattSoft to allow a Rapsberry Pi and one of my Amiga 500 USB keyboard and dual joystick boards to be fitted into an Amiga case in a reversible way with no cutting. These were kindly sent to be by Matt, who had written a forum post about it.
This consists of four parts. First is a bracket which takes a micro USB extension lead and an HDMI extension lead.
The second takes two USB extension leads.
The extension leads are attached to the brackets, which are designed to fit through the existing holes in the Amiga 500 case.
Inside, they fit around the existing mounting pillars, this is the third bracket, the one for the USB keyboard controller.
That attached to the bracket with 4 screws.
The fourth bracket is for a Raspberry Pi to be mounted.
The Pi is thoughtfully positioned by the expansion slot cover, so you can open that to access the microSD card. Shame they cheaped out on the Pi 3 and lost the push push microSD socket, so it's a bit more fiddly that it could be to change the card.
With all that put together and wired up, you have an Amiga 500 Pi 3.
All the connections are accessible on the rear, microUSB power, HMDI video,
Two USB ports and the two 9 way D joystick ports.
The two audio out jacks are blanked off, however, I have a new version of the Amiga 500 USB keyboard and dual joystick controller which has audio pass through.
With a slight modification to the bracket, the two phono sockets are now accessible from the rear.
These are connected to a 3.5mm jack socket, so with a plug to plug lead (supplied in the kit), you can connect that up to the audio out on the Raspberry Pi.
It's then just a case of configuring the Pi to output audio via that jack rather than (or as well as) HMDI.
That completes the Amiga 500 Pi 3 build.
All that remains is to plug in the Amiga 500 keyboard and test it out.
In the original post on the 3D printed kits, the Amiberry DietPi distribution was suggested, so I gave that a go.
This does a lot of downloading and updating when first booted, not very clearly shown here as the overscan was set a bit high for my monitor. (I later removed the card and edited config.txt to correct the overscan)
After about 10 minutes, it rebooted, straight into the UAE 'Universal Amiga Emulator', all the hardware was detected, and that ran nicely.
And of course, I had to test Lemmings.
I have been asked a couple of times about the LEDs on the Amiga 500 keyboard. The top one is configured as a power LED, so is always on.
The other is numlock. UAE can be configured to flash this for disk activity, which is just how it would have looked.
Alternatively, if you are running a desktop setup, you use the numlock LED to show disk activity on a linux system. Anything with a 4.7 or later kernel (such as Raspian Stretch) you should be able to type something like
echo mmc0 > /sys/class/leds/input0\:\:numlock/trigger
It may be input 1 or higher, use tab completion to check what your system is showing. This does not appear to be persistent on Raspian, so it would need to be added to a startup script.
The Amiga 500 USB keyboard and dual joystick boards are available from my Tindie Store, with and without audio pass through.
And also in a version with a USB connector on the rear in case you want to use the Amiga 500 as a massive USB keyboard.

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

Sunday, 17 June 2018

ZX Spectrum+ mystery repair

Here we have a ZX Spectrum+, and it's broken, but that's not the unusual bit.
Looking around inside, everything looks good, apart from two things. Firstly, this capacitor appears to have blown itself apart, those black things should be inside the aluminium shell.
Secondly, this resistor is seriously fried.
This board is an issue 4S, which is a Samsung produced board, and is closer to the issue 3B than the 4A or 4B (which is definitely a good thing).
Being a Samsung model, it also has a clear membrane, which are usually still working fine these days. These clear membranes don't seem to suffer from the brittleness that affects the others.
The two parts that failed are parts of the legendarily flaky power supply section. Indicated here on the schematic. (this is actually the 3B schematic, C7 is labelled as C78 on the 4S board).
This is where it gets confusing. Answer me this please anyone. That resistor should be 2K2, and at a guess would be rated 1/4 Watt. So doing some maths, there should be around 7V across it, so the current through it would be 3mA, dissipating around 22mW, well within its capability. At the rated power of 250mW, the current would have to be 10mA, which would only happen if the voltage across it were over 23V. This is unlikely given the power supply arrangements.
However to damage the resistor that badly and char the board underneath, it would need to be several times the rated power, which would mean the voltage across it would have had to be maybe into the hundreds of volts. There just doesn't seem to be enough power around in these circuits to have caused this. Anyone care to suggest how that could have happened? Spontaneous Resistor Combustion?
The worst case I can see would be if the zener diode had failed short (as I had seen on a previous repair of a ZX Spectrum with no -5V). It hasn't, I checked, but even then, that would have put about 12V across 2K2, which is only 5mA. No way would 5mA do that much damage, would it?
The same is likely true of the capacitor, the end has clearly blown off, which would have taken quite a bit of overvoltage. But the rest of the board is apparently unscathed?
With any problem with the power supply on a Spectrum, TR4 is the first thing to blame, and sure enough, that was now acting as a resistor.
Samsung used a different part here, a BC2236A, which has a different pinout to the ZTX650 part Sinclair used.
I replaced that (using the alternate set of pads with the correct pinout) with the slightly uprated ZTX651 I normally use. I had removed TR5 to test that, it did pass, but I decided to replace it anyway, also with an uprated part, a ZTX751. I still can't see how failure of these parts would have caused the damage though.
A new capacitor completed the replacements, ready to try it out.
Success, we have a worker. The voltages all measure correctly, so time for some soak testing.
It looks like the RAM has all survived, no problems detected.
One thing I did notice during testing was the power connector was a bit flaky.
I reflowed those, but it was still intermittent, so I fitted a new connector. That's the usual sequence of events, the connector gets a bit loose or corroded inside, so the user finds if they wiggle it about, it works in certain positions. This continues for a while, with more and more wiggling, until the solder joints start to crack and the connection becomes even more intermittent.
I also found two columns of keys weren't responding 5 down to V and 6 down to N, which is actually the same connection. On the Spectrum+ the membrane is 4 player (to achieve the magic of the " key pressing Symbol Shift and P at the same time) and the two clamps at the top of the keyboard need to be tightened to ensure good contact between the layers. That fixed the missing keys.
More testing, with the divMMC future and all appears well. Nothing is running hot (other than the ULA, but that's to be expected), and the voltages all check out. But I still don't know how it failed. Those components feed the 12V and -5V rails which are exposed on the edge connector, could some external voltage have got on there?
I've got some vague idea that the power supply connector might have lost it's 0V and somehow got a path back to ground via the TV lead and ended up with half mains voltage across it, but I can't quite make that add up. Answers on a postcard please.

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