Sunday 17 March 2024

Mini PET Kit Build Troubleshooting

Hopefully, when you build your Minstrel or Mini PET kit, it will work first time. Most of them do based on the feedback I get.

Occasionally, there can be problems, so I present a bit of a guide to the process of troubleshooting if it doesn't work first time. 

This can also serve as a guide to follow before you power on for the first time, if you want to take things slowly and carefully.

Test Procedure

First thing to do before putting any of the ICs in is to give the board a thorough visual inspection.

You are looking for missed solder joints, there are over 800 pads on a Mini PET, so it's easily done. You are looking for components that are missing or in the wrong place, solder bridges, any loose bits of solder or any scratches or other damage to the PCB.

Once you are happy, it is time to double check the polarity jumpers and plug in the power. 

The LED will not light at this stage, so don't worry about that.

I have indicated all the places you should be able to measure 5V. I normally check on the top left 74LS07. There should be 5V between pin 7 (black) and pin 14 (red). You can check a few of the other places if you like, but that chip is the furthest away, so if it is OK, it should all be OK.

The same procedure can be followed on any of the other kits. Most of the ROM, RAM and logic chips have 0V and 5V on those opposite corners (apart for the 74LS93 on the Minstrel 2 for some reason). However, the 40 pin IO chips and microcontrollers are anyone's guess, check the included schematics..

If you don't see 5V, check around the power input (you did fit the jumpers? and you did set them correctly for your power supply? and you did plug it in to the wall? and you did switch it on). Look for 9V on the left most pin on the 7805.

If you have 5V, you can turn off and start to fit some chips. 

With the CRTC microcontroller and the four logic chips next to it, you should get a video display. Set the DIP switches appropriately for your display. 

The Ready LED should light a few seconds after powering on.

At this stage, it should have video sync, but just a blank screen (note the important difference between no video output and a black screen with sync).

(do you really need me to take a picture of a black screen? OK, like this  but larger)

If you install the character ROM and the video RAM you should see random characters.

That is the same thing you will see on a real PET just before the display appears. This is the contents of the uninitialised static RAM.

At this point you have a working display, showing the contents of the video RAM. Now we need something to write to the video RAM.

The minimal configuration to get some code running is as follows: the 6502 CPU, the ROM, reset buffer, read/write signal control and address decoding.

Set DIP switches 1, 2 and 3 on to enable the PET Tester ROM.

It should cycle between a character set and a page of letters. There is no RAM, so it should all report "B" (for bad).

Next, install the RAM, and you should now see a page of "G".

That's better, all good (well, at least the first 1000 bytes anyway)

In order to run BASIC, add the 6522 and the lower 6521 and the 74LS145. That should be everything to get the PET running and reading the keyboard. Set the ROM selection to 1, 2 and 3 off to boot to BASIC.

You can attach the keyboard and test things out. The datasette should be working, as should the sound and everything apart from the IEEE-488 port.

All being well, the final step is to install the remaining things that are only needed for the IEEE-488 port, and then you can plug in your SD2PET (you did order an SD2PET, didn't you?) and test that.

What if it doesn't work?

If any of these stages fail, you should be able to narrow it down to the bits added since the last stage. Check around the IC sockets and related components.

The standard process I follow in this sort of situation is to go through the following list, checking each in turn, looking for anything which isn't there, or where the signal is not right.

  • Power
  • Clock
  • Reset
  • Data lines
  • Address lines
  • Chip enables
  • Read / Write
  • Interrupts

In a circuit like this with CMOS logic, all the signals should be nice and sharp 0V or 5V, nothing in between.

The power has already been checked, so first on the list is the clock.

There we are, nice and clean, 1.000MHz. A bit of ringing, but that is due to non-ideal measurements conditions (I am clipped onto the ground on the other side of the board).

Keep going through those signals, checking the operate as expected. E.g. Reset, this should be low for a second or so (at the same time as the LED is off) and then stay high.

Extended Testing

Once you have BASIC running, you can go on to test the rest of the features.

Starting with the datasette ports.

No spikes, just checking.

Although it isn't used much, I did check out the second datasette port. Changing the jumpers so that the rear edge connector becomes device 2.

I start with the tape stopped, so I can see it detects that correctly, and starts when you press play.

And there is Tut-Tut as well.

To test the userport, I used a dual joystick module.

Testing that with my TFW8b special black and white joystick (which I thought was top secret, but Chinny has done a video on them now, so maybe it isn't).

I suppose if you want the fully loaded Mini PET, I should add the SD2PET power tap and a datasette drive.

As a side note, I wouldn't normally use the PET Diagnostics with a Mini PET. It works, but it shouldn't really, so is not listed as supported. The clock arrangement is different; on the Mini PET it is generated by the CRTC and fed to the CPU, the output clock from the CPU is ignored. The PET Diagnostics uses the output clock to drive the system during testing, so the read and write timing is not going to be right.

It will detect things such as lines stuck low though.

All the ROM and RAM tests pass.

It doesn't have checksums to compare for the self test ROM or Mini PET BASIC 4.0, but then I never planned to use it with the Mini PET boards.

Advertisements

The through hole kit versions of the PET Dual Joystick have now been listed on SellMyRetro:

(this replaces an assembled surface mount version that I had designed for TFW8b, which they are not selling anymore)

The full range of Minstrel and Mini PET kits and accessories are available form my SellMyRetro store.

This post was written last month, and was put live for my Patreon supporters. Since then, I have run out of the original Mini PET V1.48 boards as shown here. I am now shipping the slightly updated V1.49 boards. More on those in a future post.

All the links can be found here:

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 10 March 2024

Why don't you use a bridge rectifier?

This question has come up again, so I thought I would finish off a blog post I started quite a while ago.

The humble bridge rectifier.

Four diodes arranged to take an AC signal and convert it to DC.

A simpler circuit with only a single diode gives half wave rectification. The negative half of the waveform is cut off. It does give DC, but only half the power.

The bridge rectifier solves this problem by reversing the polarity of the neutron flow negative half wave and flipping it to be positive, giving a DC waveform with two positive peaks for every AC cycle.

That is not the application here.

The power input to the Minstrel and Mini PET kits use a 2.1mm DC jack. This then goes to a jumper block allowing the user to select centre negative or centre positive supplies.

In theory, the jumper blocks could be replaced by a bridge rectifier. No matter what the input polarity, the bridge rectifier would flip it to be positive.

Sounds great, but why then do I not do it?

"Why don't you just fit a bridge rectifier?"

Well, I have put together an example of why this is a bad idea.

Let's start off with the simple solution, you have a 9V DC power supply, and a Minstrel 3.

Power comes in, goes through the jumpers and to the circuit.

With the jumpers set for centre negative (the preferable option), that looks like this.

The alternate configuration is with the jumpers vertically, for a center positive supply.

Several people have suggested that fitting a bridge rectifier in place of the jumper block would be a better solution.

Two of the diodes in the bridge will be always conducting, and two will always be reverse biased and not conduction. But it would allow DC of either polarity to be used. (or in theory AC if a much larger reservoir capacitor was fitted)

A bridge rectifier is traditionally drawn as four diodes in a diamond shape as above, but I have rearranged that into four parallel diodes, the circuit is just the same.

If the centre negative 9V DC supply is attached, two of the diodes conduct and power flows into the circuit. No current flows in the other two diodes, so they can be ignored. Redrawing the circuit shows the two active diodes.

Again for simplicity, I am showing the voltage drop as 1V, in practice it depends on the diodes and the current flow. I normally use 1N4001 diodes. The voltage drop across those varies from 0.6V off load, up to 1.1V at 1A.

From a 9V input, the circuit gets around 7V. This is enough for the 5V regulator, but only gives a 2V dropout voltage. On the positive side, some of the heat is dissipated in the diodes, reducing the heat generated by the regulator.

On the Mini PET 40/80 and Minstrel 4D, I got rid of the jumpers and just added a protection diode in case someone plugged in the wrong polarity of supply. That adds a single diode voltage drop, around 1V.

That all seem fine, so why don't I just use a full bridge rectifier?

Well, the problem comes when you have two or more things connected to the same supply. You get the same issues with two mains referenced (or actively earthed) power supplies. For simplicity, I will consider the more obvious problem of a Y cable being used to power both the Minstrel 3 and a monitor.

That should be fine, they both get 9V DC in and do what they want with it. (OK, so I have drawn centre negative on all the diagrams, but the monitor is centre positive, so I swapped the jumpers on the Minstrel 3 to centre positive to make it work, but I am not going to redo all the drawings)

There is no problem with the polarity jumpers, but if there was a bridge rectifier, there is an issue.

I have added the video jacks to the drawing. In both cases connected to the internal ground rail.

If the Minstrel 3 has a bridge rectifier, it's ground rail is actually at 1V relative to the power input.

If the monitor is wired directly (as most things are), it's ground rail is at 0V.

Not a problem if they are running in isolation, but if you then connect a video cable between them, you tie those two ground rails together you effectively short out the diode drop.

"That's fine", you say, "all the more voltage for the circuit".

Well, no, because the video cable is providing the short circuit path.

The Minstrel has two paths to back to the power supply ground to chose from. One is via the diode, but there is a 1V drop that way. The other is through the video cable to the ground rail of the monitor and then on to the power supply. OK, there is a bit of resistance in the video cable, but not as much as 1V, so it goes that way.

Here I am just showing the ground rail, you can see the two options.

That diode is doing nothing, so what you actually have is this.

You didn't like my drawings of ammeters? Or you don't trust my workings?

OK, I have tried to model that, this is the Minstrel only powered via a bridge rectifier, with a small resistance added for it's power leads.

Now when there are two paths, the current is split. In most cases, most of the current with flow through the power cable from the Minstrel. In the worse case with a bad power cable (say 0.1Ω) and a really good video cable and power lead on the monitor is (say a total of 0.2Ω), you may still get some of the current flowing down the video lead (the amount depends on the relative resistances of the video cable shield and the power cable negative wire)

However, the big problem is when a bridge rectifier is used and this adds a diode drop in the negative side via the normal power cable. Then suddenly the video cable is a more attractive path for the ground return, and it all flows down the video cable and not the power cable. 0mA down the power cable, and 82mA through the video lead.

So, in conclusion, in this situation, if you have a bridge rectifier, then there is a significant current flow through the video cable to the monitor, and back to the power supply via it's power cable. This is not a desirable situation, and should be avoided.

"Yes, there are two paths you can go by,

but in the long run,

there's still time to change the road you're on"

This is the same issue you sometimes get when you plug in cables to live AV equipment and you get a tingle as you touch the plug and socket at the same time, just before connecting them. Sometimes you may see a tiny spark. If you put a meter there, you will often find half mains voltage between the two devices. This is why sometimes when you have lots of AV equipment connected between devices you can unexpectedly fry video leads or power supplies etc.

Addendum

Remember the Mini PET 40/80 input that has a single diode and capacitor at the input?

Would that work with an AC input? In theory, the diode will block the negative half of the AC waveform and charge up the capacitor to give a DC rail. The capacitor is only 100uF, so that may not be enough.

I got a 9V AC supply and tried it out.

The yellow line shows the input, currently around 14-15V, so that looks promising. The green line shows the 5V rail, currently inactive because the soft power switch is off. Both are relative to the bottom line on the scope.

When powered on, you can see the 5V rail comes up and looks good for a bit, but eventually the voltage across the capacitor drops too low, and the 5V starts to drop out. The decrease continues for a few more cycles, until it drops too low to hold the soft power on, and switches off. It then goes back to looking OK.

I have separated the waveforms, so you can see that the yellow one does indeed take bites out of the green one.

So, as expected, 100uF is too low. Let's try 470uF.

It starts OK. And looks like it would be a good option, as there is now less overhead, less excess voltage to convert to heat.

However, add a heavy load, such as rewinding a tape that is already at the start, and it can't cope.

I increased this to 1000uF and tried again. That reduced the ripple quite a lot.

That does drop a little, but there is now a lot of headroom over the 5V rail, and even the 6V rail with the heavy loads.

If anything it is a little too high, might be a little too high, the 9V DC supply normally only has 4 V dropout to convert to heat, now closer to 8V.

If you can find a suitable 1000uF 25V, or larger capacitor that will fit under the perspex (max 13mm diameter), you can run the Mini PET 40/80 on AC.

That does indeed work. A bridge rectifier would halve the ripple, so would help, but then what if someone plugged in a DC supply.........

Adverts

The full range of Minstrel and Mini PET kits (none of which have bridge rectifiers) are available form my SellMyRetro store.

All the links can be found here:

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.