Sunday, 11 May 2025

Minstrel Input Monitor (Revisited)

About a year ago, I designed a one of a series of new modules for the Minstrel Expansion Bus (which has yet to catch on, but you never know).

This was a simple module that was meant to show keyboard and tape input activity with LEDs and a sounder to click when a key is pressed (like a Spectrum) and relay the tape loading noises.

As I was writing up the original blog post, I worked out that I had made a mistake, but the boards had already been ordered by that point.

They arrived and as expected, did not work as expected, and were consigned to the rejects pile.

The problem was one of timing of the Z80 read cycle.

Let me try to explain......

The Minstrel and ZX81 have a single input port. This is used to read the keyboard and tape data from the earphone socket.

The Minstrel 2 / ZX80 input port is shown here as that is the simplest version.

When the Z80 makes an IO read request and the address is even, the Port Read signal will go low (A0, IO_RQ and RD are low).

The 74LS365 has until the rising edge of which ever of those rises first to place the appropriate data on the databus in time for the Z80 to read it (shown as "In" in the diagram above).

The Minstrel Input Monitor duplicates that decoding and a 74HC74 flip flop is triggered on the rising edge of the port read signal to read the data from the bus.

At this point, it samples D7, the data from the tape as the Z80 will see it, digital data, rather than the analogue tape input signal.

That is quite useful to set your tape volume correctly, and also if the load fails, the IO reads will stop, so the LED will stop flashing.

When loading is complete, the display cycles resume. At the top of each frame there is an IO Read (actually the keyboard scan) that starts the vertical sync pulse, and an IO Write which ends the vertical sync. (from http://blog.tynemouthsoftware.co.uk/2023/10/how-the-zx80-generates-video.html)

That IO Write pulse is used to clear the flip flop in case the last data sampled was a high and would have left the LED on.

That all works fine, both the Z80 and the new latch are sampling on the rising edge of the Port Read signal.

The problem was the keyboard scan.

The keyboard is read once at the top of each screen draw cycle. For that first scan, the keyboard rows are setup so that if any keys are pressed, one of the data lines will read as low.

If that is detected, then each of the 8 rows are scanned separately to determine which key or keys are pressed (making the 9 IO Read pulses shown above).

You would think that you could do something like this, when any of the data lines are low on the rising edge, the Key Pressed signal will go high.

The problem is when the subsequent rows are scanned, if no key is pressed on that row, the signal will be cancelled and the pulse would be very short.

To get around this, on the first version I thought "if it is an IO request and one of the lines is low, then trigger the flip flop". Which seems reasonable?

But of course it isn't. That is triggering the flip flop if "any of the data lines are low during the IO read cycle". But the data is not valid for the entire IO read cycle, only on the rising edge at the end. So of the data on the bus happens to have any of D0-D4 low at any time during the IO read cycle, then it will trigger the key press unintentionally.

I must have been having an off day when I put that together.

This is what I should have done.

Here a second AND gate combines the keyboard scan data with the previous state, so if a key is pressed, or a key has been pressed, Key Pressed will remain high even if a row is scanned with no keys pressed.

If a key press is registered, the Key Pressed signal will remain high until the vertical sync pulse ends with an IO write, which will clear the flip flop so Key Pressed will go low.

This sequence happens at the start of every frame, so this will create a 50Hz tone on the piezo if any keys are pressed.

The two signals generated will be high when active, one if there is a key pressed, one when the tape data is high.

Two LEDs are used to show the state of those signals. I have used green for a key press and red for tape data.

Audio indication of the two signals can be provided by a piezo sounder.

The OR gate mixes the signals to drive the piezo sounder. (I had previously used the spare AND gate as the mixer, but I had to switch them around and now I have the spare OR gate).

Jumpers are provided to disable either signal before the mixer, in case the sound becomes annoying.

The board is designed to be used with the Minstrel Expansion Bus, either the socket on the back of the later Minstrel 2 and 3 boards.

Or in the backplane with other cards.

You could also fit an edge connector and use it with a Minstrel or a ZX81. (joystick module show here as an example)

Or you could use the backplane with the ZX81, lots of options.

The schematics above use ideal arrangement of gates, but it is not possible to easily get a 5 input AND gates, or the other assortment of 2 and 3 input AND and OR gates on just a few chips.

The actual design uses a quad 2 input OR gate and a triple 3 input AND gate to implement the same logic, as shown in the complete schematic.

I don't really like those "all on one diagram" type schematics, but it seems everyone else does, so I have made that a full page at the end of the manual. Landscape to make it most readable. Posh.

The new version looks almost identical to the original, other than a few traces have been rearranged.

This is available in kit form or assembled.

Adverts

I have listed this and all the other Minstrel Expansion Bus modules and backplane on Tindie (including the full size Minstrel ZXpand).

Last week, (yes, on May the 4th), I relaunched the Minstrel 4th.

The new version is available now form my Tindie store, and soon from Z80 kits, home of the RC2014.


Patreon

You can support me via Patreon, and get access to advance previews of development logs on new projects and behind the scenes updates. New releases like this will be notified to Patreon first, if you want to be sure to get the latest things. This also includes access to my Patreon only Discord server for even more regular updates.

Sunday, 4 May 2025

Minstrel 4th Returns

May the 4th be with you. 

Five years ago today, the Minstrel 4th was launched with that bad pun. 

And now it's back, with the same bad pun.

Yes, the Minstrel 4th is back, and available now from my Tindie store.

What is it?

It is a Z80 based single board computer with 49K of RAM, 2K of video RAM and 4 banks of 13K of ROM, running at 3.25MHz or 6.5MHz (or an external clock up to 8MHz)

It is compatible with the Jupiter Ace.

What is that?

The Jupiter Ace was a Z80 based single board computer with 1K of RAM, 2K of video RAM and 8K of ROM, running at 3.25MHz.

Unlike it's contemporaries like the ZX81 and the ZX Spectrum which ran BASIC, this runs Forth. (hence Minstrel 4th, do you see what I did there?)

Forth is a very fast and powerful language, although not as easy to pick up as BASIC, it is well worth investigating.

More info on Forth can be found here:

No post on Forth would be complete if it didn't show the result of the vlist command.

This shows the current vocabulary list, all the build in functions.

The default for the Minstrel 4th is black text on a white background, as it was for the ZX80 and ZX81 etc. I prefer this (it is also easier to take pictures of).

The Jupiter Ace used white text on a black background, so the inverse options is available if you wish.

The video on the Jupiter Ace was generated by a lot of logic chips forming counters and decoding logic. To simplify things, the Minstrel 4th uses a microcontroller to do the counting. The produces a more correct composite video signal with a backporch that was originally missing, and PAL or NTSC support via a jumper.

There is a 2K dual port video RAM chip to avoid multiplexing circuitry (the Ace had contended and un-contended memory access via two different address ranges, both are un-contended on the Minstrel 4th)

There is a lot of software available for the Jupiter Ace which will all run on the Minstrel 4th.

As well as some modern titles.

You can load using a standard cassette recorder, such as my favourite Sony TCM-818.

Or you can play the audio files into the ear port.

Not all PC sounds cards can cut it (low output level and fancy audio processing), but these cheap USB dongles usually work fine.

This is a great port of David Stephenson's Tut-Tut by George Beckett.

RC2014

One of the best features of the Minstrel 4th is it has an RC2014 expansion slot. This means it can use RC2014 modules to add whatever new functionality you want.

Most modules should work, apart from any that contain ROM, RAM or CPUs. The only IO port used on the Minstrel 4th is $FE. All others are available. Interrupts are used, generated by the video circuitry and used for timing, display update and keyboard scanning etc.

Minstrel 4th is designed for RC2014.

But don't just stop at one module, add a backplane and you can have loads.

The backplane 5 is a good starting point.

A lot of standard modules and backplanes can be used, some of the ones shown in the photos are:

Many more are available, see also:

This is my current fully loaded setup.

Made up of the following parts.

ROM options

There are four ROM options available with the Minstrel 4th

1 - The standard Forth ROM

This is the standard Forth ROM, to be most compatible with the Jupiter Ace.

2 - Enhanced Forth ROM

This is a patched version of the Forth ROM by Aleksandr Sharikhin (with some extra code from George Beckett).

This adds various features, see the github for details.

This works well with a 68B50 serial card, I have designed one with a separate clock, so it can run at 7.37MHz to divide down to standard RS232 baud rates, and the Minstrel 4th can run at a different speed.

With such a card installed, you can use some of the extra words it added to access the serial port.

If you use a standard FTDI serial cable to connect this up to a PC, you can run a file server from a Python script.

On the Minstrel 4th end, you can use commands like ls to show a directory listing or tapin to open a tape file and then use the modified load command to load over serial in a matter of seconds.

There I was loading 4D Monster Maze, a modified version of George Beckett's Ace version of 3D Monster Maze with some extra features.

If you press R when the first screen appears, you will be invited to select a DIO port. I like a bit of Ronnie James Dio. Oh wait, no.

If you have one of the RC2014 Digital IO modules, then it will function as a "Rex detector" and show you how close Rex is getting.

It also support my RC2014 Joystick module so you can use a standard 9 way D joystick in various games.

Another module you might want to pick up is Ed Brindley's YM2149 sound card.

This is supported by several games, including George Beckett's updated version of Centipede.

It works with the built in speaker, but sounds great with the extra AY-3 sounds.

There is a lot of software out there, including many new games:

3 - MPF-1

The Micro-Professor MPF-1 was a single-board computer, made by Multitech in the early 1980s. It was intended as a teaching aid for learning to program the Z80.

This used a 36 key keypad and 6 digit LED display and a simple monitor program, which allowed a user to enter small machine-code programs as hexadecimal object code, and then debug and run those programs.

George Beckett has ported the MPF-1's monitor to run on the Minstrel 4th so you can try out Z80 coding with the built in assembler and disassembler to help you debug your code.

Full details can be found here:

4 - ZX80 BASIC

What?

Yes

This is a port of the 4K ZX80 Integer BASIC that runs on the Minstrel 4th.

It is compatible with most BASIC programs, but is not fully hardware compatible for obvious reasons.

I have replaced the standard ZX80 screen draw routines with a routine to copy the ZX80 display file into the Minstrel 4th video RAM. It does that every frame so this display works pretty much as it did, although there is no flicker as the display continues to be drawn by the microcontroller even when the Z80 is busy.

I have written new LOAD and SAVE routines, which show a countdown rather than wavy lines.

They keyboard matrix is slightly different, as is the load hardware, so any games that use fancy display techniques, or their own keyboard scanners or load routines will not work.

But it works well enough for Paul Farrow's ZX80 versions of Kong and PacMan for example.

(but sadly not the recent port of Rock Crush or Rocket Man - for those you need the full ZX80 compatibility of a Minstrel 2)

Options

The Minstrel 4th is available as a kit or assembled. With sockets for the main chips, but optionally for the logic chips as well.

The standard version comes with a built in keyboard, but it is also available without a keyboard, should you want to use your own, or do something else.

I did create a sticker to fit over a ZX81 membrane, if you want to do something like that.

And the board is ZX81 size, so.....

But you won't be able to use an RC2014 modules, unless you are very creative with a Dremel....

Or there is a USB keyboard interface from Shiela Dixon:

So you can use a standard USB keyboard (doesn't it look small in comparison?)

Or even a non-standard USB keyboard (yes, they are back as well)

But most people will want the standard version with keyboard.

Whenever I pack a new kit, I like to build one to test.

As always, they work first time.

Oh wait,

That's not right.

Hmmm.

About 95% of the issues come down to things like incorrect jumper settings, shorts, dry joints, missed pins, etc.

Ah, there it is.

Sorted.


I think that's enough for now. I don't think I have included as many links in a blog post ever, and I think I must be pushing the number of images as well.

The only link you really need is this one:


Patreon

You can support me via Patreon, and get access to advance previews of development logs on new projects and behind the scenes updates. New releases like this will be notified to Patreon first, if you want to be sure to get the latest things. This also includes access to my Patreon only Discord server for even more regular updates.