The "Junkbox VZ" homebrew Z80 computer

This page follows the progress on the construction of a homebrew Z80 computer using junkbox components.

(please have a look at my youtube video of my attempts to reverse engineer the custom logic of a VZ300 as featured on Hackaday here)

Video, pictures and schematics will be added to this page in due course.

Planned expansion include:

6K video memory for max 256x192 display resolution (Completed see below) 

SN76489AN sound generator (tested on breadboard awaiting inclusion)

Parallel port and joystick ports and colour video output

Reset button (Completed see below)

Serial Interface (Completed see below)

Piezo buzzer (Completed see below)

 ***Latest updates scroll to bottom of page***

 

 

                                                                               

 

I guess some background might be in order, to explain how it progressed to what it became.
at first I built a basic Z80 test circuit on a breadboard with a simple clock circuit to drive it, it just looped through NOP's and flashed an LED to show it was working
- and I could check signals on the scope I had just bought. This was useful to learn the basics of the scope. FWIW, I should have bought a scope decades ago, but they weren't under $300 back then...

At that point I thought, well, let's see if I can expand on that a little and I added a VZ300 ROM out of my junkbox,  simple address decoder and a 6116 SRAM, and a simple reset circuit. Surprisingly this simple circuit didn't crash and burn into a screaming heap, the Z80 seemed to be booting the ROM code at 0000h upon reset and running something. So then this design was moved to the prototype board, soldered and tested.  Wiring all those address and data lines etc. worked first time. Had it required a lot of debugging at this point it probably never would have progressed any further as it would have ended up in the "for later" drawer, where later never comes.

All good to that point then, but what good is a computer without a display?  For that I took a 6847 that I had as a spare and originally it was to be wired where the 40 pin interconnect plug sits with the other logic and RAM piggybacked and bodged onto the one board. I decided against this as it would have been too complex in terms of connections and debugging and really ugly visually as well, not that it's a thing of beauty now but hey think of it as a Picasso.

So the 40 pin socket became the interconnect between the two boards, for all the address lines, VDG I/O, I/O, Clock, blah blah I think I have a few spare pins, but already reserved for future expansion. For the clock circuit I needed a 3.58MHz clock (the VDG needs this as the clock as it's the NTSC clock, so for simplicity the CPU also uses the same clock), but since I didn't have a suitable crystal I had to put together a clock divider circuit so the 14.3x MHz crystal I did have that could be divided by 4 to provide a stable 3.58 Mhz system clock. The clock circuit is a fairly standard 74LS04 arrangement with a 74LS74 as the /4 divider circuit.

I had a 2Kx8 6116 SRAM but my intention is to ultimately give the MC6847 the full 6K for all modes up to 256x192 so I used a 8Kx8 cache SRAM instead which presently is wired to provide the standard 2K video memory as per regular VZ but the provision for expansion is already there. The most important thing was to get this mess to display something, leaving further expansion until it was working in it's simplest form.

On the same board  added the 5V 7805 regulator and refined the design a bit (IOW added some filtering caps).

After wiring the VDG, SRAM and 74LS245, resistors and headers/connectors/adapter it was time to fire it up.

To my utter astonishment, the VDG seemed to be producing a signal at the Y output at the VDG on my scope.
Could it be?

So I whipped up a two transistor composite video out driver circuit, hooked it up to a TV and low and behold there it was...
10 seconds later my Mrs. comes through and asks, are you OK? Apparently the "F#CK!?" I exclaimed in astonishment at 1am was quite loud and woke her up.
Oops.

That circuit needed some debugging though. The display was inverted, which was a wiring mistake and the display was uber-noisy with thick wavy bars cycling through. Turns out I had wired the 5V line to the composite out driver circuit to the 12V unregulated DC instead of regulated 5V. Apparently BC548 transistors are quite tolerant  to such abuse, but they much rather prefer the regulated 5V supply.


No damage done, debugging complete now it was time for some input.

I contemplated making/adapting a keyboard before deciding that I could always do that later, for now a VZ300 keyboard would have to do so I scavenged a suitable header and bodged an adapter.  After working out which pin on the keyboard connector was attached to what signal it was all wired up. Yep, it all worked thus far.

I wanted to see how much RAM the system saw with only 2K RAM, but the modified BASIC2.1+ 27C128 ROM I tried (PRINT MEM is so much easier then typing PEEK this and that whatever) didn't work. The ROM speed was too slow, so I burned another 200ns EPROM and that works fine. I'm sure delays and bus noise et al are a factor in this whole mess, but anyway.

From there I added the tape I/O circuit. After reading through the specs of the original transistor and finding some pretty similar in my junkbox of similar spec, I could not get anything to load. I then swapped out the transistor for an everyday BC548 transistor out of curiosity, and that worked a treat. I could now load stuff, cool.

Unfortunately with only 2K memory, there wasn't much I could load and run to test this thing, but some of the original demo programs were small enough.
So onto memory expansion then. Originally I bodged a stack of 2K SRAMS piggyback style, with an address decoder to give 8K system memory onto the daughterboard that plugs in where the original 2K ram sat. This arrangement worked but was a bit flakey and 8K was never going to be enough. I changed the design to use a single 32K SRAM with memory decoded into 8K blocks, and ANDed. This sorta worked, but because of the 7800h memory arrangement the memory total shown was inaccurate. This could have been fixed with more decoding logic presumably but I thought it would be simpler to simply have 2K at 7800h and then the 32K as expansion memory in addition which is with I ended up doing. I used simple 1n4148 diode/resistor logic AND gating for the chip enables and it works surprisingly well so that stays.

So yeah, that is pretty much it thus far. I still have quite a bit of board space left for expansion.
I always wanted to build my own computer so I'm quite pleased with this VZ made of junk and the learning experience alone has been well worth it.

So, here it is, with all the chips labeled, and as it currently stands, with one exception. I have added a warm reset button to the VDG board so there is no need to turn the Junkbox VZ off to reset it.

The reset circuit was added by simply bridging the capacitor in the Z80 cold start reset circuit. When I get around to adding some schematics this will make more sense.

The labeled chips, screenshot and the pinout for the 40 pin interconnect are as follows;

 

                                                                          

 

                                                                           

 

40 way connector pinout "Junkbox VZ"

Pin    Function                     Notes
1       GND
2       D6
3       D0 
4       D1
5       D2
6       D3
7       D4
8       D5
9       Keyboard D0      LS244 CPU board pin 8
10     N/C
11    CAS IN                audio-in VDG board to 74LS244 CPU board pin 11
12    /DRAM (E)         CPU board LS139 pin 10, LS32 pin 12, VDG board LS245 pin 19
13    A5
14    A6
15    A7
16    A8
17    +5V
18    A9
19    A10
20    A11
21    A12
22    A0
23    A1
24    A2
25    A3
26    A4
27    Keyboard D1       LS244 CPU board pin 4
28    Keyboard D2       LS244 CPU board pin 15
29    Keyboard D3       LS244 CPU board pin 6
30    /WR                    CPU board Z80 pin 22, LS32 pin 9 + 13, CPU-MEM board SRAM
31    Keyboard D4      LS244 CPU board pin 17 
32    Keyboard D5      LS244 CPU board pin 13
33    CLK                   3.58MHz clock circuit VDG board to VDG pin 33, CPU board Z80 pin 6
34    N/C
35    A/G                    CPU board LS174 pin 10 to VDG pin 35
36    IORQ
37    /INT                   VDG pin 37 to CPU board Z80 pin 16, LS244 pin 2
38    VIDRAM /RW  CPU board LS32 pin 11 to VDG SRAM pin 27
39    CSS                   CPU board LS174 pin 12 to VDG pin 39
40   D7

 

UPDATE 27/05/2014

Tired of having to turn the computer on and off to reset it, I added a reset button. This was simple enough, a switch bridges the cap in the reset circuit and discharges it, and on release the system reboots. Memory contents are preserved, but BASIC pointers are reset which means ML programs in memory remain and can be called but BASIC programs are gone unless you reset the pointers correctly, I assume.

I also added the circuitry to enable the 256x192 graphics mode, and enabled the extra 4K (total 6K) video memory. Players at home might have noticed that the W2465AK is an 8K chip and you would be right, but the 6847 can only address a maximum of 6K for all it's modes, so the extra 2K isn't used.

The circuit is basically the one published in the Hunter Valley VZ Users Group newsletter and was submitted by Joe Leon.

The circuit and an explanation on how it works is available here:

http://www.vz200.org/bushy/hvvzug22.pdf 

http://www.vz200.org/bushy/hvvzug23.pdf

Thanks go out to Dave Maunder for making these available and Guy Thomason for his excellent emulator that make the conversion process so much easier.Below are the images of the above hacks and a screenshot of an image in 256x192, 1bit. The image loads to C000 hex and then a short BASIC program flips the 2K pages of the 6K image into video memory.

If interested in the program and the method of converting an image into a suitable format, email me.

 

                                                                                            

 

 

 

 

                                                                                                    

 

 

UPDATE 10/06/2014

 

I added a piezo speaker to the CPU board between pins 15 and 2 of the 74LS174 HEX D flip flop with caps on both sides of the output pins, addressed using the regular sound commands from BASIC or the VZ ML routines. The volume is low which is what I wanted but I did add couple of pins so a better speaker can be added at a later date.

I also experimented with the "Compumuse" addon, which is based on the SN76489 sound generator IC and is designed to connect to the printer port of various computers of the day. I completed a circuit on breadboard which connects the SN76489 directly to the CPU bus and addresses it through a selectable port instead of through the printer port as per the Compumuse design. For those who don't know, the SN76489 is a port addressed sound chip with 3 voices and a noise channel and was the primary sound chip in the Colecovision, Sega Master System and BBC micro, Creativision/Dick Smith Wizzard and others.

I haven't decided if I'm going with that chip or the AY chip, or both, so more details will follow including a schematic.

A kind gentleman emailed me the designs for the Dick Smith VZ serial interface  and RTTY interface which inspired me to add a serial interface to the Junkbox VZ. The design included 555 driven charge pump and used three transistors, 74LS33, 74LS138, 74LS74 and an EPROM for the supplied program. Dirk, a member of the VZemu Yahoo group kindly assembled the source code that was supplied by Leslie and I burned a ROM using that code. I've uploaded the kit information and the ASM and binary file are available from the VZemu group.

However, I didn't go with that design for a couple of reasons. One was that I didn't have a 74LS33, a quad input NOR buffer so I had to find an alternative and secondly the interface only connects at 300 Baud and at that speed a simpler TTL-RS-232 design will do the job, using just a couple of general purpose transistors.

In the end I substituted the 74LS33 with a 74LS32 OR gate and 74LS05 hex inverter, removed the 555 driven charge pump design entirely and added the couple of transistors and changed the 2532 EPROM for a 2764. Tested on a breadboard, it was moved to PCB.

Below are the rough circuit diagrams of the changes: (click on link with apologies for the shitty quality)

Serial Logic

Simple Transistor RX/TX interface

2764 EPROM

 

The Junkbox VZ is now spread across three boards. Without the serial board the current draw was about 300mA  @ 5V (and still under 500mA with the serial addon connected). The 12V 1A unregulated DC transformer (which read just over 13V under load!) was working fine but even the large heatsink on the 7805 would get to over 60C, which is well within it's operating range but was just wasting wattage of energy in heat. I swapped the supply with a regulated 8V 2A switchmode "wall wart". The advantage is that I could swap the heatsink for a smaller one and the temperature sits at around 30C. Beauty.

Update: The 8V supply is pining for the fjords and is no more and was replaced with a 12V 2A supply.

The setup as it stands, spread out for clarity:

Three boards.

 

 

RS-232 serial interface board

 

 

 

 Latest update:

The Junkbox has had the following updates:

Colour added using an MC1372 IC. The output is now in NTSC colour composite.

Added turbo mode Z80 @ 4.33MHz instead of 3.57MHz.

Rewired the matrix on a Toshiba keyboard for use with the Junkbox.

Modified ROM startup routine for correct graphics mode on initialisation (OUT 32,8 on startup IOW)

Rehoused the Junkbox into the BBC Master Compact case above and made a label to suit.  

The disk drive is a dummy, pushing the disk slot just above right of the green LED performs a RESET.

 

 

 

 

 

 

 

 

 

 

 

 












 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This Web Page was Built with PageBreeze Free HTML Editor