Showing posts with label Minstrel Expansion Bus. Show all posts
Showing posts with label Minstrel Expansion Bus. Show all posts

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, 27 April 2025

Minstrel ZXpand V1.5

I think I should re-introduce the Minstrel ZXpand.

This is a special version of ZXpand which has been designed for use with the Minstrel 3 computer.

It overrides the BASIC LOAD and SAVE instructions to allow fast loading from a full size SD card or serial. It also adds a 9 way D joystick port.

ZXpand was originally designed and produced by Charlie Robson (sirmorris). Those are now out of production and difficult to get hold of.

The Minstrel ZXpand was produced with his approval and assistance to work only with the Minstrel 2 and later Minstrel 3. I have simplified the design to reduce size and cost, making use of the 32K RAM already present in the Minstrel 3. A replacement ROM is provided for the Minstrel 3, and a wire link attached to the ROM jumper block to select the ZXpand ROM when required.

This version does not feature it's own ROM or RAM.

So it cannot be used with a real ZX81

(I am only going to mention that once, but hopefully it is in big enough letters to sink in)

When you power on, you will be greeted by a banner.

You can now use the Minstrel 3 as normal, the Minstrel ZXpand will be waiting until you need it.

You can also configure it to load a menu program at power on, such as ZXpand Commander.

See here for more information

Three new commands are added to BASIC when the Minstrel ZXpand is active:

  • CAT (to get a directory listing)
  • DELETE (to delete a file)
  • CONFIG (to change options)

Those commands replace three lesser used ZX printer commands (COPY, LPRINTLLIST). They are already marked on the Minstrel 3 keyboard overlays.

If you press Z, you will now see CAT in place of the ZX printer COPY command.

When you want to load a program, just type LOAD, with the program name (e.g. LOAD "3DMM" - the .P is optional on LOAD, and is only required for the DELETE command)

And in no time at all, the ringmaster will be greeting you.

The joystick port supports standard 9 way D Atari / Commodore joysticks, and can be read in three ways:

The ZXpand protocol

This is a way to read the port directly from assembly language code, which is supported directly by several games.

A replacement INKEY$ function

When the ZXpand is active, the INKEY$ function will also return joystick movements. These are normally set to be the cursor keys, so when you move the joystick left, it will look to any program calling INKEY$ as if you are pressing the 5 key. The keys can be changed using the CONFIG command, if you want WASD or any other combination. Any BASIC game should use this without modification.

Kempston compatible interface

Joystick movements can also be read form port $31, compatible with the Kempston joystick interface, also supported in many games.

The Kempston port and the ZXpand can be disabled by jumpers. The ZXpand can also be disabled in software

3D Monster Maze uses the INKEY$ function, so you can run away from Rex using a joystick without any changes to the original game.

When loading, you can also add a path to the load command, e.g. LOAD "REVIVAL/DOWN"

I know I always load 3DMM, but Down is another of my favourites, and supports the ZXpand joystick.

It detects it automatically, so you need to use it to press fire to start the game.

If you don't want that, you can set the Minstrel ZXpand to be disabled after load by adding ;X to the command. eg. LOAD "25THANNI;X"

The 25th anniversary demo is great, and needs every spare bit of RAM and the original ROM. If you run it with the Minstrel ZXpand enabled, there is some screen corruption.

With the ;X option, it runs fine.

There are a few differences between these V1.5 boards and the previous V1.4.

The logic chips on the side were originally lined up with the Minstrel 2.

The new version has been rearranged to line up with those on the Minstrel 3.

Yes I know that makes no difference to the functionality, but I think aesthetics are important, and I can waste my time relaying a perfectly functional PCB if I want to. So there.

One new feature is a 6 pin FTDI header has been added. This can be used to load files into the Minstrel 3 via serial from a PC.

A standard 6 pin FTDI serial cable can be connected, ground (usually the black wire) is marked with a "-" and is closest to the edge of the board. (I think I might even have got direction arrows correct, < out of the FTDI connector, > into it)

The PC program can be downloaded here - 

This works as a server. You need to wait until the Minstrel 3 is at the K prompt, then run the server with two parameters, a .P file and a the com port your FTDI cable is on, e.g. COM1. Don't worry about the speed settings, the program automatically configures this as 38400,8,N,1.

The server is written in C sharp (Charlie has provided the source on the github). You can use it on linux with the mono framework and the port would be in the form of /dev/ttyS0.

Once that is running, type LOAD "$" on the Minstrel 3.

When you press new line, it will begin to transfer blocks over the serial connection.

It is a lot faster than loading from tape, and can be useful during development to avoid having to keep copying updated code to the SD card.

Once complete you can run your program (if it hasn't already started).

As above, you can add the ;X to the LOAD command to disable the Minstrel ZXpand after loading if that is required.

Don't do the maths, the 25th anniversary was 2006. But that was only a couple of years ago, right?

The Minstrel ZXpand is available as a kit or pre-assembled, ready to plug in and go.

An SD card is required. The older, slower and lower capacity the better. Avoid microSD in adapters if you can, the adapters are not very reliable.

The SD socket is supplied pre-soldered onto the PCB. The remainder of the kit is standard through hole parts.

None of these versions will suit anything inside a ZX81 case. The ROM jumper needs to be connected to the Minstrel 3 jumper block, on either the front or the back of the board, so it is only suitable for open stand-alone SBC style systems.

Jason at JLProjects has designed a 3D printed enclosure for the Minstrel 3 and Minstrel 3 + Minstrel ZXpand.

The STL files are available here:

Minstrel ZXpand options

There are three options to suit your system:

Vertical pin header

This version is designed to mount vertically, either in the Minstrel Expansion Bus backplane, or in the Minstrel Expansion Bus socket on later Minstrel 3 boards. This is the recommended configuration.

The jumper wire connects to the Minstrel 3 jumper block. The reset button is not fitted here as the one on the Minstrel ZXpand is used in preference (long press = reset ZXpand, useful if previously disabled).

It will sit neatly on top of the Minstrel 3, even if you used IC sockets.

Horizontal soldered

This version has a pin header which is soldered directly to the Minstrel 3 edge connector, or the pass through connector on the Minstrel Expansion Bus. (here showing the older version, but the newer style will be supplied)

This provides a very reliable connection, but is not reversible.

Horizontal edge connector

This version is as above, but instead uses an edge connector. This can easily be removed, so is more adaptable, however the edge connectors are not as reliable as the pin headers or soldered connections.

The two horizontal versions include 10mm nylon pillars and screws matching those used on the Minstrel 3 kits, so it will sit level behind the main PCB.

The standard kit comes with a socket only for the 40pin microcontroller. Optionally sockets are available for the logic chips. (the ROM goes into the socket already present on the Minstrel 3).

Kits are available from my Tindie store

There is also the Minstrel Micro ZXpand, which takes up a lot less space, but does not include the joystick or serial interfaces.

I currently have none of the Minstrel 2 style boards. If anyone is interested, let me know and I will get some ordered with the new serial header.


Adverts

I have listed this and all the other Minstrel Expansion Bus modules and backplane on Tindie.


I understand now is not the best time to be selling on an American site, but I am from the UK. All products are designed, built and shipped by me, here in the Tynemouth in the north-east of England.

And now isn't the best time to be English either, but please don't penalise me or other small businesses that are just trying to do their thing.

I don't think it is going to help anyone by boycotting businesses because of the actions of those that run the countries they live in, or where the platforms they operator on are based.

My listings are on Tindie, but if you prefer, DM me or use the contact link above to order direct.

All international orders may be subject to local tariffs, taxes or duties, and handling fees etc. Please be aware of this before ordering.


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.