Sunday, March 26, 2017

The CPUville Z80 Kit

Donn Stewart's CPUville Z80 kit is another modern day Z80-based microcomputer kit.

You can order just a main board with the processor, monitor in ROM, 2KB of RAM and basic input/output in the form of DIP switches and LEDs. Or you can spring for a serial interface board to load/develop programs. CP/M fans can also go all out and get a disk and memory expansion to run CP/M from compact flash media.

I opted for the main board and serial interface kits but decided to assemble only the main board.

I had started a collection of old Z80 processors; different models (2.5MHz vs 4MHz vs CMOS) from the different manufacturers (SGS, Sharp, NEC etc). However, I had no way of testing my collection. In today's world, one can find almost everything on Ebay but not everything you do find is genuine.

The CPUville kit with it's bank of LEDs is just the ticket for a low cost ($42+shipping) Z80 tester.

The picture below shows an SGS Z80 being run through its paces. Note that I am using a ZIF socket so that I can swap out the 40-pin CPU.

The test program is a basic loop that increments the HL register, then displays its contents on the LEDs. To make this perceptible to human senses, the A register is decremented from 255 to 0 before incrementing the HL register.

So far all the Z80 CPUs in my collection are good!

But what about the CPUville kit itself?

I generally like the concept of the board. The board and parts are of good quality with buffers for the address, data and control lines which the RC2014 lacks (@spencer, hint hint).

Unlike the more "modern" Grant Searle-inspired designs, Donn went with 74LS TTL parts. I, of course, substituted 74HCT parts for lower power. The only downside there is that Donn's low frequency RC clock generator does not work with the 74HCT04. I'll probably put the 74LS04 part back.

Donn did not supply IC sockets for all the chips, but I used them anyway: partly paranoia, partly general hygiene.

Speaking of hygiene, the only thing that disturbs me about the CPUville board in general is the almost total lack of decoupling capacitors!

As someone who actually worked on 70s/80s-era microprocessors and TTL design, I was quite floored by this. So I added a couple of them. At least, one 0.1uF at the crystal oscillator, and one across the power rails of the Z80 itself.

The main board has some of the CPU signals brought out to two 16-pin IC sockets for expansion (the aforementioned disk/memory expansion and serial port card). So there are options available for a more complicated setup. One CPU line missing from the expansion sockets is the interrupt line.

The only roadblock I hit when putting together the board comes from a silkscreen error on the board. The silkscreen footprint for the 2 network resistors was reversed. To his credit, Donn points this out in his very well written manual. To my discredit, I didn't RTFM before assembly.

As a result, the input ports did not work and I wasn't able to use the monitor program. The latter, in a very nice way, uses the input DIP switches as user inputs to select which built-in monitor program to run.

Fortunately, I had a couple of 28C16 EEPROMs (they're a plug-in replacement for the 2716) and so wrote my own test code that by-passed the program selection: upon reset, my code would just immediately run the LED sequencer.

I've a couple of replacement network resistors on order with Jameco and will fix the problem when they arrive.

Otherwise, it was a fun little project!

Sunday, March 12, 2017

The RC2014

Spencer Owen's RC2014 is another Z80-based microcomputer in kit form.

There are two versions of the RC2014: a single board version called RC2014, and the original RC2014 which is based on a motherboard with several plug-in cards.

User interface is via a serial console and supports color text via ANSI terminal emulation. I am using an FTDI USB-Serial cable and a serial terminal emulator software, aptly named Serial, on the Mac OS X.

I bought one of each version of the RC2014 and decided to build the single board one first since it required less soldering and was more compact.

As you can see from the newer picture below, I have been doing "stuff" with it.

The RC2014 comes with a version of Microsoft BASIC in ROM. If you want to do anything with assembly language, you are mostly out of luck: it is rather onerous to upload cross-assembled Z80 code from a PC or Mac.

Enter the monitor program from Lee Hart's Z80 Membership Card. It is written by Josh Bensadon with contributions from various other folks. The monitor is provides a serial console interface and is able to drive the Membership Card hex display/keypad front panel.

I took the source code, removed all the hex display/keypad code, adapted console code to work with the RC2014's 68B50 ACIA/UART, added breakpoint support and voila, we now have a Monitor/Debugger for the RC2014!

The modified source code is hosted on Github.

The really nice thing about Josh's original monitor is that it allows you to upload Intel HEX formatted binary files. So developing on the RC2014 becomes a question of write->assemble->upload->run. And all this without the need for an EPROM programmer or other hacks/workarounds.

I had to make a number of tweaks to get the Intel HEX uploader to work well on the RC2014 and it is robust enough now to upload the whole monitor program itself into RAM for additional development. This is actually how the breakpoint code was developed.

The little plug-in card you see on the right of the RC2014 Mini motherboard is a 16KB RAM card. The original RAM on the RC2014 sits from 8000H to FFFFH. BASIC uses memory in this space. The 16KB RAM sits at 4000H-7FFFH and can be used for further development of BASIC, without colliding with the latter's dependencies.