Sunday, 1 December 2024

Minstrel 3 Repair

As far as I am aware, the majority of the Minstrel kits that are built work first time, or are quickly fixed due to the wrong jumper settings, a missed solder joint or solder bridge, or misplaced component etc.

When there are problems, I try to troubleshoot via email, and usually get things working.

Every now and then, despite the best efforts of the builder, one doesn't work.

This is the case here, a Minstrel 3 was built (quite a while ago I think), and unfortunately didn't work.

They have now sent the Minstrel to me, along with something else for repair.

At first glace, all looks well.

I think this was sold as a Minstrel PCB only, the builder sourced their own parts. (Minstrel PCB only options now available on Tindie - https://www.tindie.com/products/tynemouth/minstrel-2-or-3-pcbs/)

It is good to see a nice set of Texas Instruments logic chips. Whenever I see a photo of a board with a random assortment of vintage logic chips, my heart sinks as I have seen too many times where one or more of those is broken or a fake, remarked etc, or is just old and tired and not running to spec any more.

For example this Minstrel 2 that came in for repair a while ago.

On that board, the 74LS08, 74LS10 and 74LS86 were all bad - http://blog.tynemouthsoftware.co.uk/2017/08/minstrel-zx80-clone-troubleshooting.html

I did note that on today's board, the three big chips, the Z80, RAM and ROM, were all vintage, so my suspicions will fall on those first.

A Z80 from 1983, a Sony CXK58257P RAM chip (from 2008?), an apparently pin compatible with the 62256 required, and finally an unknown EPROM, probably a 27C64, probably of similar vintage.

Before I do anything, I will fire it up and see what it does.

What lovely wallpaper.

Seems an appropriate point to mention if you ever see a screen like this:

This can be caused by the wrong ROM settings. This is what happens if you have the ZXpand ROM without the ZXpand connected. The ZXpand ROM has it's extra code in place of the character bitmaps, hence the display corruption.

You need to move the A15 jumper to the right (or the A13 on some older versions).

I did try a different ROM chip with the correct jumpers, but it made no difference, it is probably just a ZX81 ROM image on the EPROM.

I also looked at the Z80. I have seen quite a few vintage Z80s with bad M1 lines, almost entirely on Spectrums - http://blog.tynemouthsoftware.co.uk/2024/09/divmmc-troubleshooting.html

I have never seen one in a Minstrel, but unlike the ZX Spectrum, the ZX80/81 does need the M1 line to function properly.

The ZX80 based designs need the M1 line to know when to enable the NOP generator, so if you have a Z80 with a bad M1 line, you will get a white screen or just nothing. If you are using a vintage Z80, one good place to check is the Z80 M1 pin.

If it is just a flat line wiggling around ground, you need to get another Z80.

It should look like this, with a low pulse whenever the Z80 is reading an instruction.

This Z80's M1 line was fine.

I did try replacing all three big chips with known working versions, but it also made no difference.

I checked the usual culprits as well, power, clock, reset. All doing what they should be. Nice clean 3.25MHz clock, one of the benefits of 74HC series logic is you always get nice strong, clean traces like this.

I looked around address and data lines, and all seemed to be wiggling appropriately, no bus conflicts as far as I can see.

Hmm .... Scratches head.....

The design is such that pretty much everything needs to work to get a display, since that is mostly what it does.

I had an all socketed Minstrel 3 board on the bench, so I thought it would be a quick way to divide and conquer the problem if I took out all the chips and tried them in the known good board. I would then move onto trying a known good set of chips in the bad board and seeing where the problem was.

I removed all the chip and trued them on the known good board with, and it all worked fine, so the problem was on the board.

The builder was very critical of their soldering and suspected that. Before I put in a set of known working chips, I had a good look over the board and it all looked perfectly fine to me, I couldn't see any issues. They have done quite a neat job.

I probed around for a bit looking for shorts or other issues and then something caught my eye.

Hello, what's going on there.

Did you spot it?

Oooh nasty.

I thought I would dig out the USB microscope and get some closer shots for the blog post.

Definitely damage to the solder mask, the copper is showing through.

The tracks damage on the right doesn't seem to have actually broken any traces.

However on the left, it does look like a break in the middle of those five traces. The one highlighted in blue below.

I had to search around for the V3.5.2 PCB layout, that was quite a while ago.

That trace carries A14 from the diodes on the right to the 74HC251 on the left.

Or rather, it should. In this case there is no continuity there. The others test out fine, just that one trace.

Not the neatest bodge wire. I'll tidy that up later, just wanted to test it out.

And there we are,  K  prompt, ready to go.

I attached the owners keyboard to test it further (they didn't send the overlay PCBs).

They have the parts to build a Minstrel ZXpand, but have not built that yet, so I tested with one of mine to make sure everything was working.

All looks good. Rex says Hallo.

One final thing I had to do was swap out the 74HC04. For some reason (probably share holders and accountants), Texas Instruments make some ICs with a fraction of a gram less plastic, and they just don't look right. I have generally managed to avoid those, but I do have several tubes of 74HC02 and 74HC165s that I won't use in kits because they just look wrong).

Ah, that's better.

I also swapped out two of the 74HC257s for 74LS257s, as per the latest Minstrel 3 design, to improve loading from tape.

And that's all done, ready to go back.


Advertisements

Minstrel 2 and 3 kits are available from my Tindie store, with worldwide shipping and 5% off for the next month. Order soon to beat the usual postal slow downs in December, and avoid impacts of the GPSR regulations that come into force on the 13th December, and whatever happens in the USA when the new administration takes over.

Versions are available for ZX81 case:

Or standalone with keyboard:

And also Minstrel 3 with ZXpand microSD card interface:

I have listed the Minstrel 2 and Minstrel 3 PCBs with and without keyboards or overlays on Tindie. Just in case you want to source your own parts and don't like the ease and simplicity of having them all supplied in neat little bags and a foam pad with all the ICs in order.

I am in the process of moving things over there from my SellMyRetro store, so if there is anything that you want, let me know and I'll add it.

I have recently added lots of PET repair and upgrade parts, more to follow.

Bluesky

For those interested in such things, I can now be found on Bluesky, and I expect to be posting more there.

Patreon

You can support me via Patreon, and get access to advance previews of posts like this and behind the scenes updates. These are often in more detail than I can fit in here, and some of these posts contain bits from several Patreon posts. This also includes access to my Patreon only Discord server for even more regular updates.

Sunday, 24 November 2024

Five years of the Minstrel 3

Five years ago to the day, I put up a blog post announcing a new kit for sale. The Minstrel 3, a Z80 based, ZX81 compatible computer kit.

Today it is back, and for sale on Tindie again, and there is 5% off all Minstrel kits for the next month.

Shipping is only going to get slower as we move into the holiday season, so the sooner the better if you want to be sure to get your order in time.

Remember 2019? Lots of things have happened in those five years.

In that time, I have tweaked the Minsterl 3 design a bit, and added things like the Minstrel Expansion Bus header, so you can now add a microSD disk drive via the Minstrel Micro ZXpand that plugs directly into the board.

I have brought it back with two PCB options, one of which is a single board design, with the integrated keyboard.

I still have the versions without the keyboard for use with a ZX81 membrane or other keyboard, in a ZX81 case or whatever you can dream up. Still ideal as a drop in replacement for a dead ZX81.

During that time, the Z80 has also been discontinued, but fear not, I have secured a lifetime supply of Z80 chips, so these kits will be available with some of the last genuine Z80 chips ever made, date codes shortly after the last time buy deadline.

As usual, I have built one up to test the new PCB.

Whilst doing that, an idea for a change has occurred to me.

(actually, it was shortly after I had soldered in the bit that needed to be changed, but lets not mention that)

Yay, significantly past the last minute update.

Although it is something I have tried to address several times before - loading from tape on a Minstrel 3 isn't always great.

It works fine with my modified TZXduino / master tape creator, and some of the time with my Sony TCM-818, but I know people have problems with PC soundcards and phone apps and cassette recorders with lower level outputs

The problem stems from the logic chips used on the input port. On the ZX80 (and Minstrel 2), this was a 74LS365, a hex tri-state buffer.

The ZX81 ULA implemented something similar internally.

This operates in two states:

  • Reading the port
  • Not reading the port

When the port is being read, the input signals are transferred to the CPU databus. When the port is not being read the chip disconnects from the CPU databus and lets other things drive it.

This is a 74LS series chip, which means the input voltage thresholds are as follows:

  • Logic 0: 0 V to 0.8 V
  • Logic 1: 2.0 V to 5.5 V

That means the tape signal needs to reach 2V to be considered a 1.

When I designed the Minstrel 3, I moved to 74HC series logic for all the chips, these are faster, lower power, cleaner signals etc. However, one problem is the input voltage thresholds are now higher:

  • Logic 0: 0 V to 1.5 V
  • Logic 1: 3.5 V to 5.5 V

That means the tape now needs to be over 3.5V to register as a 1.

I have looked at various options over the years, different ways for boosting or biasing the signal. Transistors, op-amps, comparators etc. but none of them were quite right. Most of them helped in some situations, but not all.

For the Minstrel 4D (still available from TFW8b - https://www.tfw8b.com/product/minstrel-4d-turbo-jupiter-ace-compatible-computer-kit/), I used a microcontroller with a built in op-amp, and comparator with configurable references, so I was able to add a menu option to select a threshold voltage to suit various inputs and that worked quite well. I would like to use something like that with the Minstrel 3, and maybe one day there will be a Minstrel 3D that can use similar technology.

Testing the problem

Revisiting this problem afresh with this update, I have been trying things out.

I setup a Minstrel 2 (also back with optional integrated keyboard), and a recently refurbished Sony TCM-818 cassette recorder and tried to load some tapes.

I chose a selection of tapes ancient and modern, and tested the ones that would work on a ZX80 with the 8K ROM and most of them loaded reliably at about 3/4 volume.

I then switched to a Minstrel 3 and found that most of them didn't load.

I have been testing out a new module for the Minstrel Expansion Bus, the Minstrel Input Monitor.

(that is something else that changed, I created the Minstrel Expansion Bus and started to add a series of modules, but it seems no one was interested in that, so I haven't listed those on Tindie yet. Anyone interested? - http://blog.tynemouthsoftware.co.uk/2024/05/minstrel-expansion-bus.html)

The new module, the Minstrel Input Monitor shows when a key is pressed or data is being loaded from tape on two LEDs and also optionally via a sounder.

On the Minstrel 2, I could clearly hear the data being loaded.

On the Minstrel 3, the data just wasn't getting through as well.

I tried with the TZXduino, and that was fine, as expected.

How can I fix it?

Well, this was something that worked with 74LS input levels, but not with 74HC input levels.

So, why don't I use a chip with 74LS style inputs, either actual 74LS serise chips or 74HCT.

The 74HCT series has 74LS style inputs, and 74HC style outputs, so should work?

Well, it is not a good idea to mix logic families, a 74LS output will not generate a high enough logic 1 output to drive a 74HC input. However, a 74HC output can drive a 74LS input.

So I need a 74HCT365?

Well not quite, the design evolved a bit.

In designing the Minstrel 3, I tried to reduce the chip count where I could, and I found a way to save a chip or two.

There are only two things which drive the CPU side of the databus directly. The 74LS365 input port, and two 74LS05 chips which form the NOP generator.

This forces the CPU side of databus to all zeroes so the Z80 executes a NOP instruction whilst the rest of the circuitry on the other side of the 1K resistors is generating the display.

The 74LS05 is an open collector inverter, so if the input is high, it pulls the output low. If the input is low, it does nothing. (if you want it to read as a logic 1, you need a pull up resistor, for example, the first 74LS05 gate on the left).

I need to consider three states here

  1. The input port is being read
  2. A NOP is being generated
  3. Everything else

When the input port is being read, the 74LS365 is driving the Z80 data bus with the input port of the tape and keyboard signals.

When the NOP is being generated, the 74LS05 chips are driving the bus low to mimic a NOP command op code ($00).

When "everything else " is happening, the 74LS365 outputs are high impedence and the 74LS05 outputs are off.

I didn't want to use the 74LS05 chips in the Minstrel 3 as there was not a 74HC05 chip I could use in it's place.

The 74LS05's did actually survive until version 3.5 of the design.

Version 3.5.1 went to a 74HC244 to replace the 74LS05s.

I thought since I was using that, I may as well use the same chip for the 74LS365 input port.

The 244s didn't last long, I don't like those as the outputs and inputs are on alternating pins which makes routing more complicated.

I had already tried a pair of 74HC245 tri-state buffers in an earlier version, as the inputs are all on one side and the outputs on the other, which is much neater.

That was the very first red V3.0 prototype which was still using 74LS logic, I went back to the 05's for V3.1.

After seeing that, I remembered I didn't like the row of 20 pin chips, they didn't seem quite right.

I already had 74HC257s in the design, so I wondered if I could use a pair of those to replace the pair of 74HC245 buffers?

The 74HC257 works in three modes

  1. Inputs A are connected to the output
  2. Inputs B are connected to the output
  3. The output is disconnected, high impedence.

That fits with the requirements of the input port and the NOP generator. I just need a "NOP or Input port" signal to control the output on or off, and a second signal to select between NOP and input port.

The result is two 74HC257s replacing the 74LS365 and two 74LS05s.

I looked at two options here, the logical move would be to replace those two 74HC257s with two 74HCT257s. Those have TTL level inputs, but output the same as the 74HC series.

However, I have decided to go for two 74LS257s instead.

The output stages are different. the HC and HCT series use two FETs to drive the output strongly high or low.

Where as the LS series have a strong drive low via a transistor, but the drive high is via a pullup resistor, in this case nominally 100Ω.

The way this is used in the overall design is this feeds the Z80 directly, whilst the ROM and RAM are being used to generate the video signals. The two sides are connected via 1KΩ bus isolation resistors.

ZX81 External Keyboards?

I was hoping this might help with the issue of external keyboards (http://blog.tynemouthsoftware.co.uk/2022/05/zx81-external-keyboards-and-the-minstrel-3.html).

The problem is external devices are connected to the isolated side of the databus. The ZX81 external keyboards rely on driving the bus at the same time as ZX81 ULA, so either can indicate a key is being pressed. They do not work on a ZX80, or the Minstrel 2 or 3.

On the ZX80 and the Minstrel 2, you end up with a situation something like this, the external keyboard on the left trying to influence the Z80 on the right.

When neither keyboard is pressing a key, you end up with the datasbus seeing a logic 1 due to the 100Ω pullup on the right. The one on the left is also pulling it high, but via the 1KΩ resistor, so you effectively end up with 1100Ω in parallel with 100Ω, which means the bus is pulled up by a bit less than 100Ω. (N.B. I am assuming ideal transistors here just to make things easier).

When the 257 drives the bus low due to the internal keyboard or NOP generator, no pullups are involved. It is directly driving the databus low, so it does not really matter about the 1100Ω combined pullup on the external keyboard side.

The problem is the reverse does not work.

When the external keyboard tries to drive the bus low, the 257 is trying to drive it high, so you end up with a potential divider, 1KΩ to 0V and 100Ω to 5V. That gives a voltage on the Z80 data pin of about 4.55V, which still very much counts as a high and the external key press does not register.

In order to register as a logic 0, the bus isolation resistor would need to be dropped to something like 50Ω, which does not sound like a good idea as that would put a load of 100mA for each bit on the bus.

In order to make this design work with an external keyboard needs an open collector drive, which is probably what the ZX81 ULA does. I have tried to find a way of doing that, ideally an open collector version of the 257, but I cannot find such a thing. It would either need a couple of 74LS07's or 74HC125s or maybe diodes on each of the drive signals between the 257.

It looks like changing to a 74HCT257 or 74LS257 will help with tape input, but neither will help with external keyboard situation unfortunately.

The control signals are both generated from 74HC outputs, those can drive LS style inputs, so that is OK.

The input port signals are from the keyboard, which is a matrix of the Z80 address lines, via diodes with pullup resistors. That should be fine. The tape input, as discussed, is better feeding a 74LS input.

The 365 is a hex buffer, so only drives bits D0-D4 (the keyboard) and D7 (the tape input).

There is also one extra pin which is cheated on the ZX80. If a diode is fitted, D6 reads as a zero to indicate NTSC, without the diode, it floats up to a 1 for PAL. That can be replaced by a 0V or 5V jumper to select PAL or NTSC.

Bit 5 is not used, so that is set to high, so that it could be overloaded externally if that were ever required.

The NOP generator inputs are just tied to 0V, so that's fine.

The outputs are wired direct to the Z80 databus, and that is the same Z80 chip as I use on the Minstrel 2, so it is fine with 74LS outputs. Nothing else drives the databus directly, so there is nothing to conflict with.

Sorted.

The extent of the changes required is updating the silkscreen from "257" to "LS257".

That was easy.

Let's give it a go.

And yes, it works perfectly.

OK, it works as well as the Minstrel 2 does. As well as a ZX80 would. And probably about as well as a ZX81 would do, since the ULA inputs would have been modeled on the 74LS TTL chips they were replacing.

The only ones I couldn't get to load were things like 3D Monster Maze, where you can clearly here the tape is worn out in places and is never going to load again. (blog post to follow.....)

I will continue testing, but I think that's a given now. I will leave the other 74HC257s as is. They need to remain as they are, so I will just need to be clear where the 74LS257s go on the board. The 74HC257s are marked "257", and the two non-HC chips are marked LS257.

The next batch of PCBs will have this marked, the last of the current ones will get a white paint dot on this two chips.


Advertisements

Minstrel 2 and 3 kits are available from my Tindie store, with worldwide shipping and 5% off for the next month. Order soon to beat the usual postal slow downs in December.

Versions are available for ZX81 case:

Or standalone with keyboard:

And also Minstrel 3 with ZXpand microSD card interface:

I am in the process of moving things over there from my SellMyRetro store, so if there is anything that you want, let me know and I'll add it.

I have recently added lots of PET repair and upgrade parts, more to follow.

Bluesky

For those interested in such things, I can now be found on Bluesky, and I expect to be posting more there.

Patreon

You can support me via Patreon, and get access to advance previews of posts like this and behind the scenes updates. These are often in more detail than I can fit in here, and some of these posts contain bits from several Patreon posts. This also includes access to my Patreon only Discord server for even more regular updates.