Saturday, 31 December 2016

Minstrel ZX80 Clone

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

Here is a new ZX80 clone that I have called the Minstrel. It is a fairly accurate clone electrically to the ZX80, using the same chips and the original schematic with only a few concessions to the modern world. All the parts are the same, the part numbers and pins are the same, other than the ROM and RAM, I've only added a few extra decoupling capacitors and a one resistor / one transistor composite video amplifier.
The first thing is that is not the same size as a ZX80, but has been designed to be the same form factor as the ZX81, with the same mounting points and connectors. The big silver box of a UM1233 UHF modulator is missing. I have replaced that with the single transistor composite video buffer. The phono connector is composite video out in the same location as the original UHF out.
The four connectors are in the same positions as on the ZX81, with the two ear and mic audio in and out jacks. In this case these are stereo with the signal taken from the tip, so either mono or stereo jacks can be used. The power jack has been replaced with a 2.1mm DC jack, with jumpers to select centre negative (ZX Spectrum style) or centre positive (everything else). This is more reliable than the 3.5 mm jack originally used.
The two 2114 RAM chips have been replaced with a single 62256 chip. This is wired for 16K. 32K is possible, but would require changes to the decoding logic, 16K just needed additional address lines wiring up. The 24 pin mask ROM or 2532 EPROM used in the original has been replaced by a 28 pin ROM socket which can accept a 27C64 up to a 27C512. Upper address lines are tied high, but two 8K ROM images can be selected by a jumper, allowing original 4K ZX80 ROM or 8K ZX81 ROM to be selected.
In the first build, I used a 7805 linear voltage regulator, but this can be replaced with a switch mode version to reduce heat and current consumption. The heatsink borrowed from a ZX81 barely gets warm, current draw is about 200mA with a 7805, 110mA with a switch mode unit. The board was designed to accept either a 6.5MHz ceramic resonator or a 6.5MHz crystal, I started with a ceramic resonator to stay true to the original.
On first power up, this is what I got. Sometimes this, sometimes no video sync at all. The ZX80 design requires the Z80 to run appropriate code to generate the screen, and that is what it does about 95% of the time. But in this case it wasn't. Logically either the original ZX80 schematic I had used was wrong (unlikely as it came from Grant Searle's excellent site), or I had transcribed it wrongly in my PCB design (possible), or messed up the build (also possible).
After an extensive check of every connection on the schematic, I finally found the bit I had missed out. There is a direct connection from A6 to INT (part of the display generation system). That was a simple fix just wire the pins together on the back of the board.
It's not perfect, there is a moving diagonal line of interference, but I finally had an inverse K on the screen. I've built a computer from a bag of TTL chips and a Z80!
The distortion seem to come and go, and on some occasions I had a really nice clear picture, although the alignment was a bit off.
I did a lot of probing around and found the frequency of the ceramic resonator was drifting around, and the closer it got to 6.5MHz, the better the picture. I swapped that out for a 6.5MHz crystal and the distortion went away.
The brightness does vary a bit on this LCD monitor, but that's due to the video signal from the ZX80 missing some parts which a modern TV needs to set the black and white levels. (Update - this is much improved in the Issue 2 Minstrel boards)
The chips used are all 74LS TTL chips. I have tried this with 74HCT parts, and it does work, but the signal isn't as strong, the design does rely on the analogue properties of these chips, so best stick to 74LS. (and no, don't use 74HC. Ever. For anything. Please). These chips are still available, as is the Z80 and the selected ROM and RAM, meaning this can be completely constructed with new modern parts.
I've tried to keep things neat with all the passives lined up neatly. One thing I was pleased with, which will only please me and people like me is I used all Texas Instruments chips, and they use the same moulding for 14 and 16 pin chips, so all the chips look lined up and matching, even though the second column has a mix of 14 and 16 pin chips. The top two on the right hand side are 14 pin 74LS05 chips which are are centred so they line up with the 16 pin chips below. No? Only me? Well at least I'm happy.
The original plan was to use a ZX81 membrane, and the connectors were setup for this. However, it didn't work out, the wrong keys were pressed. Unfortunately, it seems I messed up the pinout of the keyboard connector. Both the ZX80 and ZX81 schematics lay the connections out in one order (the one I used), but this is not the one used on the membrane, so I had to build up a small bodge board to fix the order of the rows connector.
I did get a ZX80 replacement keyboard, that uses the same ZX81 style pinout, so I will need to build a suitable board for that as well. The ZX81 keyboard has the same letters and numbers, but the keywords are on different keys  (PRINT " is O shift+Y on the ZX80, P shift+P on the ZX81. The ZX80 originally came with a 4K BASIC ROM, but later on they offered an 8K BASIC ROM and a keyboard overlay which was pretty much the same as the ZX81.
For testing, I fitted pin headers and used an RC2014 mini keyboard. It turns out that has the same pinout I had on my board, only with both the 5pin and 8pin connectors reversed. So with some twisted leads, I can use this keyboard.
A jumper on the board selects the 4K ZX80 BASIC or 8K ZX81 BASIC ROM. So this can become a ZX81, albeit with the screen flicker on every key press like a ZX80.
The ZX81 has additional hardware to generate a 'slow' mode where the CPU can run a small amount of code during the screen draw cycles (whilst the CRT beam is moving back from bottom right to top left). The ZX80 does not have that so has to stop drawing the screen when it needs to think what to do with your keypress.
ZX81 ROM, ZX81 membrane, ZX81 sized board. Guess what's coming next. Yes, the plan is this board can be installed in a ZX81 case and makes this a ZX81 replacement. This means you can take a dead ZX81 where the ULA has failed and drop in this board as a replacement. (in later versions, hopefully a superior replacement)
Anyone who has taken a ZX81 apart, or more importantly put one back together will know there are 5 screw holes on the board, but only two are screwed in from the back of the PCB, so you need to remember who two to fit and which ones to leave and screw it from the back of the case. I've put white silkscreen around the two important ones to make it clear. The membrane should connect direct, but my little bodge board is underneath.
I've fitted a reset switch on one of these as it's quite useful. I was planning to add one to the board, but decided not to. On reflection it is useful, so I will at least add pads to fit one. There is a jumper to select PAL or NTSC mode (on the original ZX80 a diode was fitted for NTSC mode and a resistor on the ZX81).
As on a ZX80, you can also select normal or inverse video. Inverse video is sometimes better if the LCD doesn't detect the black level too well, so you get white on dark blue / grey which can be more readable.
I haven't found much ZX80 software out there, but I did find some on Paul Farrow's website, including PacMan and Space Invaders.
Not all the games I tried worked. PacMan loaded successfully, but didn't run? (Update - this was due to bad audio files - read more in the Minstrel Issue 2 blog post)
Time to load some ZX81 games. You even get the old loading stripes. Simple games loaded, but anything relying on slow mode (including 3D monster maze) will not work until I add in the NMI slow mode for full ZX81 compatibility.
I've checked the RAM, although I had to switch to ZX81 mode, as I couldn't find PEEK on the ZX80 keyboard.
UPDATE:
Thanks to Geoff Wearmouth for reminding me these are typed directly on the ZX80, as per the label on the case. I've added that list to the silk screen on the next revision of the board.
Back to the 8K ROM ZX81 mode.
PRINT PEEK 16388+256*PEEK 16389
Yes, the top of RAM is 32768, meaning 16K is working. Not sure if these simply won't work without the ZX81 fast/slow mode NMI changes? I need to investigate further.
The plan for this was always for several versions of thise board. This first run is pretty much following the original ZX80 schematic. Now that's working and I've ironed out a few little issues with the keyboard connector etc. I can get on with the next phase. I plan to rearrange the logic to use more common TTL chips (some of these are a little obscure these days), and add the ZX81 style NMI functionality. This is the current list of planned changes:
  • ZX81 fast/slow mode NMI circuit
  • Full 32K RAM (at 8K-40K for high resolution graphics mode compatibility)
  • Fix composite video with back porch black level setting by changing line counting logic
  • Reduce chip count and replace less common chips
  • Add input amp to improve tape recorder input
  • Add reset switch
  • Consider edge connector, probably not.
  • May look at joystick connector instead - but is there any software support?
There are a few things I probably won't be doing
  • Surface mount at this stage, at least one more through hole revision before size reduction
  • FPGA, lets stick with real chips for the moment
  • Jupiter Ace / ZX Spectrum video generation - the ZX81 timings would change too much
  • SD card disk drive - maybe?
  • HDMI output - probably not
  • AY3 sound chip - again, is there any software that would use it?
  • 3D monster maze in ROM - hmm, possibly.


As it stands, if anyone is interested in one of these boards, I have (now only a few) left. They take a while to build up due to all the passive components and IC sockets, so I'll probably just sell these as PCB only, rather than assembled or kits. Note the keyboard connector issue and the bodge wire on the Z80. If there is enough interest, I may respin this version with those things fixed before I progress to the optimised ZX81 design.
UPDATE:
The issue 1 boards are now sold out. Issue 2 is available now. More issue on the issue 2 board.
I have fixed the two PCB errors on this board, and also added a back porch video circuit which gives a much better video output
I have also addressed the problems loading games, which was down to the software I was using to generate the audio files to play into the ZX80.

2022 Update: This is where the Minstrel kits all started. This one was picked up early on by Hackaday, and got something like 50,000 views. It's a shame it was this early test post that go all the attention, rather than the later ones where I had a working board (and kits for sale). These days I keep the early posts to my Patreon and only post a blog when something is ready (and in stock). 

The kits are no longer available, but there are PCBs for the Minstrel 2 (ZX80), Minstrel 3 (ZX81) and Minstrel 4th (Jupiter Ace), as well as the Mini PET available from my SellMyRetro store. (also a few built units, while stocks last!)

Friday, 23 December 2016

VIC20 Penultimate CartridgeV5.0D

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

The new batch of VIC20 Penultimate Cartridges are now on their way to those who preordered them.
This new batch is a darker shade of brown and has the right textured finish. Less shiny and less orange that the first run.
It is now a slightly milder brown than the Commodore utility cartridges that it replaces.
The code inside remains at V5.0D, packed full of assorted game and utility ROMs and as much RAM as a VIC20 can handle.
As usual, I'm testing this with an SD2IEC
This combination works well as the file browser can be automatically loaded from the Penultimate Cartridge menu,
You can also use it was cassette, here it is loading 'Pentagorat' recently released on cassette. That needs 32K of RAM, which the Penultimate Cartridge can provide.
Update:It looks like the current batch has sold out, so these are back on preorder and there will be another much larger run of cartridges in the new year. You can order one (and an SD2IEC and a copy of Pentograt) from thefuturewas8bit.com.

And incidentally, a Merry Christmas to all of you at home.

2022 Update: The production version of the Penultimate Cartridge is now available from  The Future Was 8 bit

Sunday, 18 December 2016

Commodore 1571 Power Supply Conversion


I don't normally do unboxings, but here is a nice boxed Commodore 1571 disk drive.
Inside it's all very clean and everything seems to be there.
Including a mains lead. Hmm, that's not the right mains lead.
It is confirmed by the label on the bottom, this is not the UK model, it is US 110 V (or 117V as marked).
Nice looking drive, but massive.
Even though it might look like a 1541-II (top), it's very much the size of a 1541 or 1570 (bottom).
It's also slightly wider than all the others.
The reason it's larger than the 1541-II is they have returned to having an internal power supply. On the back is AC in, power switch, IEC connectors and address selector switches. No sign of a voltage selector switch though.
Inside, I was hoping there may be a jumper to select 220-240 V operation, or a transformer tap that could be switched around, but no sign.
The large metal box at the back is obviously the power supply, nicely modular with the mains connector and power switch on one side and a 4 pin power connection to the mainboard on the other.
Underneath the power supply, the main board dates the drive to late 1985. This is the same board which was used (slightly modified) in the 1570, a single sided version of the 1571, in a 1541 case.
Inside the power supply cage is quite neat, just an off the shelf TDK switch mode power supply. Looks a good quality unit, no signs of capacitor leakage or worn out parts.
This is rated 1.0A at 5V and 1.2A at 12V. It also confirms it's not a universal voltage model, 100V/115V only.  I always think of the US as 110V, but I guess these are all approximate figures, it says 117V on the label on the bottom of the case, which seems unusually specific.
Doesn't look like there's an easy way to switch it to higher input voltage, at least the main capacitor would need to be upgraded as it's rated 200V. It's a discrete switching circuit, so the timing may need to be changed to cope with a higher voltage / lower current input.
Or I could just swap the whole power supply board with a similar one.
The one on the left is the new board, this is a Mean Well PD-25A power supply, which is 100-240V input. It's new and unused, from a box of these I picked up 10-15 years ago, so doesn't look that out of place in the 30 year old drive. (UPDATE: apparently this is still a current model)
It is rated 2A on the 5V line, double the old one, and is the same 1.2A on the 12V line, so there should be no problems there. It's physically smaller, but should be a fairly easy swap as there is a lot of space inside the cage.
The mains filter is rated to 250V. I don't think these are the type that explode, so I'll leave that in place. [Update: actually I think they are, I will change this for a standard socket at a later date] Likewise the power switch is suitably rated, so no change on the mains input side.
As the board is smaller, I've made some brackets out of earth tags soldered together and bolted it in. The screw in the far corner is the one connected to mains earth, and is the one directly mounted on the original pillar.
The mains in connector is the same as the original, but I needed to make a new DC out cable as the connector was larger on the new board.
With the cover replaced and it back in the 1571, you would hardly notice the difference.
As the new PSU is 100-240V, it will still work in the US, so the original label is still valid, but I've added a sticker to indicate it is also suitable for use in the UK or Europe.
Time for some testing. The test setup is officially too bit to fit in the frame.
Looks like a very nice drive, passed all the diagnostics tests, track alignment is good.
Speed couldn't be better.
Passed all the read / write tests.
I seem to have several 1570/1571 test/demo disks, but no CP/M disks.
I've written a set of CP/M disks from disk images using CBM command. That's also a good test of the drive, seems to be working nicely.
I've got a couple of Commodore 128's to repair, so I thought it would be good to have the matching 1571 drive ready to go with those.