Tuesday, May 26, 2015

A review of the CPUville Z80 computer kit

I was introduced to computers in era of the C64, so the nostalgia is strong for 8-bits. I love the way you can understand them and programming them is fun in a sort of 'real programming' sense where you don't feel so isolated from the hardware. I don't get any of that from modern computers, no matter how cool the hardware. I'm just not smart enough to do OpenCL programming, or even shaders.

So about a year ago I tried to design my own minimal Z80 based system but could never get it to work beyond free running NOPs on a bread board. I gave up on it but then made the mistake of looking at EEVblog and Hackaday again recently and now I'm back having another go.

I decided not to spend the time trying to bring up the CPU myself and look for a kit so I could be sure the minimal computer worked before playing around with making add-ons and software.

There are very few kits around you can actually purchase. The only two I found were the N8VEM and the CPUville. The N8VEM seemed too much hassle to figure out what to buy and how to pay for it, plus it had more on the basic board than I wanted. So the CPUville and its expansion boards were ordered. I haven't found anyone writing about this kit online, and only one person who says they've even built it but without any details except to say it's cool. So I thought I'd write a review in case anyone else is wondering if it is any good.

You can read all about the kit on the CPUville website so I won't go into details. Being able to order the bare boards or the boards plus all components is excellent and I decided to order the CPU, IDE/memory, and UART board with components and the bare bus display board. The kit arrived quickly and was well packed in minimal space to keep the international postage cost down, which I appreciated.

I started with the bus display board to get my hand back in. Oldest son soldered in most of the resistors before getting bored (I was hoping to trigger an interest in STEM there) and I finished it off with the sockets and LEDs. I ended up using some LEDs with a clear housing which are annoyingly bright so used 980R resistors to dim them a bit. Then I went looking the 74xx240 bus driver ICs in my stash from when I was trying to build my own computer... and found I didn't have any because I'd not used them in my design. I had so many types of 74xx IC I just assumed I'd have them :( If I'd thought to check I could have ordered them while waiting for the kit. So no display board yet.

Next I tackled the CPU board. I used sockets for all the ICs and recommend this approach - it turned out to be crucial while debugging. There was a lot of soldering but that's to be expected. It still only took an afternoon and evening. Once I had the slow clock and crystal installed I did a quick check with my OpenBench Logic Sniffer to see they were putting out pulses, which there were, then I plugged everything in.

I powered it up and, of course, nothing happened. I was genuinely surprised by this. I really did expect it to just work given it's a proven board and all you have to do is solder everything on. The kit's designer, Donn Stewart, says more than 100 of the kits have been sold and I'm certain most of them have just fallen together and worked first time.

But I wasn't that lucky. And I'm pretty lousy with electrons. I can understand the design of the CPUville computer quite easily and the schematics hold no mystery but electricity in real (or even simulated) circuits is mostly beyond me. I was proud of myself when I was able to mostly predict what the output of a voltage divider would be - that's how bad my understanding is. The Logic Sniffer seemed to show activity on the CPU control lines so it wasn't completely dead.

I didn't know what to do, so I start looking for shorts with a continuity tester. I decide to start from the I/O port switches and LEDs and go backwards. And before too long I find a short between two 74LS02 pins where there should not be one! I take the IC out and test the socket - no short. I test the IC pins, and the short is in the IC itself. I go looking for the same IC in the IDE and UART kits but they don't use this one. I have a single similar IC, but it is a HC, not a LS. Not even a HCT which would have been better suited to the all LS design. I plug it in anyway and still nothing. But at least it was socketed so I could do this easily.

I also noticed the Z80 and a few of the surrounding driver ICs were getting way too hot. Almost too hot to touch.

I wrote back to Donn, more in disappointment than any expectation he could help me from half a world away and let him know I'd got a bad 74LS02. He wrote back with some general advice and an offer to get the kit working himself if I paid the postage, or to walk me through the tests he would do. I thought this was more than fair but decided I'd like to sort it out myself if possible or I'd feel like a bit of a fraud.

I suspected none of the ICs should be getting hot and Donn confirmed this. So I decided the next step was to take out all the ICs (those sockets pay off again!) and do some more continuity testing, this time from the Z80 out. I had a piece of luck here as I still had the power supply cable plugged in to the board with the PSU (a repurposed ATX power supply) on standby. I was getting a short between the Z80 VCC and ground pins! Surely that's not right. Then I try it with the PSU properly off and still get a short. I take the power cable out and the short goes away. I put in a cable from a different PSU (wall wart type) and there is no short. It seems my ATX PSU conversion is dodgy and there is something I don't understand about how it should be done or how it works. It's been fine powering lots of other things but it certainly doesn't play well in this case. It's beyond my understanding so I just start using the wall wart even though it can only supply 1A rather than the 2A Donn recommends.

I also checked the driver IC which was getting hottest by powering it up in isolation on a breadboard. It does not get hot.

So, plug in the Z80 with nothing else and power it up. The Z80 gets hot. I have a couple of other Z80s from my experiments last year so I try one of them and it doesn't get hot. This seems like progress. I plug one IC at a time in moving from the bus drivers to the address and I/O decoding and finally the I/O latches. Power up between each IC and see if anything heats up. It's all good this time, with just the '02 missing because I don't know if replacing a LS with a HC will work due to the different logic high voltage threshold. When all but the missing '02 is in some LEDs light up. That is better than before at least. I take a punt on the 74HC02, put it in, and things look like they're working!

I go through Donn's test programs and the counters, port reflector, and peek all work :) I'm pretty pleased with this result and call it a day.

At this point I'll say I would not be surprised if both the Z80 and the '02 were OK when I received them but were damaged by my PSU.

Nostalgia is great, but I'm not interested in programming by toggle switches so I build the UART board next. The short version is that it worked as expected and I luckily had a USB to RS-232 cable with a 9-pin plug on it that actually worked with Windows 7 and the CPUville kit. The only tricky bit was the first time I tried it it was obviously working but the output was unreadable. It was trivial to get the hex codes of the characters I was seeing and compare them to what I should be seeing, and notice there was some problem with the high bits. This was simply due to the cables between the boards not quite working with the connectors I'd put on the CPU board. I was able to work around this.

I wrote a couple of tiny programs to flash the LEDs and accept keystrokes and it looked I had a working CPU and a way to talk to it!

So my overall impression of the kit is "fantastic!" It was easy to purchase, contained everything required, and arrived well packed. Donn was very helpful with his advice and offers to help get going. So any criticism below has to be taken in that context

Pros:
  • The CPU board is well designed for the hobbyist. It can run on it's own, and the UART board can connect straight to it to give a much easier to use interface. The best thing is that you can disable the on board memory and I/O ports by removing two jumpers, leaving just the clock, CPU, and bus drivers. Perfect for someone who wants to design their own system starting from the base of a known working CPU and clock subsystem. I think this one area where it wins over the N8VEM. The N8VEM board seems more complex and powerful, but less flexible. If you want a CPM system it is great, but that isn't what I wanted. Donn's design seems to be exactly what I was looking for.

  • Easy to build. I'm willing to believe all my problems came from my PSU cooking the ICs. To make building easier, all the ICs face the same way. All the LEDs face the same way. Very simple to put together.

  • Well documented. Donn's kit instructions are comprehensive and contain all the schematics and lots of other info. He's really put some work into them.


Cons:
  • The expansion headers on the CPU board are not a multiple of 0.1" apart! I just assumed they would be. They are 0.05" off and that is incredibly frustrating. Worse, the UART board headers are at the standard spacing so you can't connect them together with stackable headers! Of course I only discovered this after I'd soldered the headers in. Which was after I'd soldered the standard DIP sockets to the UART board, then removed them when it was clear jumper cables wouldn't reliably stay in them. The expansion connector area is an unfortunate flaw in an otherwise great design and it really makes it much harder than necessary to try and add things on.

  • The I/O address decoding of all the boards is too open. They just check the minimum number of low address lines so if you address anything higher you still get the LEDs and UART responding. The IDE board does some messing around to handle this but then doesn't actually address the problem properly.

  • Many of the CPU control signals are not exposed and left either tied to Vcc or left unconnected with no easy way of getting to them. This includes the interrupt and bus mastering signals. I'm going to have to either bend the pins up so they don't go into the socket and solder wires to them or create a daughterboard for the Z80 which plugs into the socket on the kit but also exposes these signals.

  • No mounting holes in the PCBs. If you want to securely mount these boards you have to come up with some means of holding them by their edges.

. If you want a Z80 kit I think this one is excellent.

No comments: