Sunday, 28 August 2022

Testing PET ROM/RAM Boards

This is a reworking of two Patreon exclusive posts from last year. I was building a large batch of PET ROM/RAM boards for The Future Was 8 bit, and I wanted to update my test kit. I am currently building another large batch of boards, so it seemed fitting to revisit these posts.

The current design of the PET ROM/RAM board has evolved quite a bit since the first ones I produced back in 2014, but the concept is the same. Plug into the CPU socket of a PET to bypass and/or upgrade the onboard ROM and RAM.

Since this was also acting as a piece of test equipment, it was important to me that I tested each of the boards I built to make sure they were working correctly. So that the buyer can just plug the PET ROM/RAM board in and be confident it will work.

In the early days, I would test these in my 4032, although that complicated things slightly as this generation of boards drive the display with a CRT controller chip which needed to be initialised by the ROM before it would generate sync signals, so I had to remember to boot up to a 4032 or 8032 ROM image or the onboard ROM set first.

This meant the CRT had to be run all the time the board was being tested, which is not ideal, I try not to overuse nice tube based monitors for trivial tasks when a disposable LCD display would be sufficient.

I used various other boards, including a 2001N board from a 3016. That had the advantage that an adapter could be used to generate a composite video signal from it, so it didn't need the CRTC to be initialised or the CRT to be run during testing. It did however still need the big PET power supply to power the 4116 RAM chips.

When I got hold of a broken 2001 board, that became an ideal test harness.

The board originally ran from a centre tapped AC transformer, and only used the 9VDC that generated to power the datasette motor drive circuitry, everything else on the board being 5V. With a suitable cable, this could be run from a 9V DC bench supply. It did run at over 1A due to all the LS TTL logic on there. (A Mini PET for reference runs at about 100mA due to the use of HC logic).


This had several failed 6540 ROM chips (no surprise there), unfortunately including the character ROM, which is in a different circuit and cannot be replaced by the ROM/RAM board. It was also low on working 6550 RAM chips, so I put the remaining working ROM and RAM safely away and made replacements.

With the 6520 and 6522 chips replaced with WDC ones, this became a nice stable board with no MOS parts to worry about wearing out.

This could also drive a composite signal with no programming, in fact the PET's party trick is that it will still drive the display if there is no CPU installed due to the completely separate video circuitry.

Add to that an SD2PET to load test software and it's pretty much sorted.

The final element was a replacement keyboard, one of the first ones I mad, which had the nice white switches (before TFW8b insisted on those less than ideal blue ones).

The was supported on a second PCB to prevent it scratching the bench.

Most of the time, I was using a BASIC RAM test program I had adapted from one in a book or a magazine many years ago, adding bit wise testing and address bus testing.


This was  deliberately slow and deliberately written in BASIC as it means lots of ROM and RAM accesses, but did take about an hour to complete. That meant that whilst a board was on test, I could get on with labelling and packing the previous board and then cleaning, checking and programming the next one ready for test.

That has been working well for a many years, building these in small batches for my store (now at https://www.sellmyretro.com/store/tynemouth-software) but since TFW8b is now ordering these in larger quantities, I think it is time to retire the 2001 board and look for something new.

I set out a few requirements:

  • Single 9V DC supply
  • Composite video output
  • Long term reliability
  • SD card loading
  • Compact size

You might think the obvious solution would be a Mini PET. After all, they meet all the above requirements, and I might have one or two of them lying around here.

And yes, that would be an obvious choice, particularly one of the development builds that would not be saleable, such as the Mini PET Stealth created from one of the batch of PCBs with no silkscreen.

However, there is one problem. As the marking indicates, the socket on the Mini PET is not suitable for a 6502 CPU. 

The W65C02S used there has a slightly different pinout and different timing requirements to the original 6502. A couple of pins need extra pullup resistors, and one input is now an input/output pin which means it should have an inline resistor if used (which it isn't). The most notable changes though are one of the ground pins on the 6502 that has to be connected to ground is now an output on the W65C02S. Secondly, I found during development that the clock out on the W65C02S was not suitable for driving the rest of the system as it is on the PET. Instead, it has to be driven based on the input clock rather than phi1/phi2 output as on standard 6502 systems.

Before I knew the clock out was unsuitable, and how different the timing had to be, I tried on the first Mini PET to make it suitable for either type of CPU.

That is PCB V1.00, the very first Mini PET. I did get that working in the end, and it was mostly right.

As with many early prototypes, I used GAL chips for things like address decoding to allow me to change that without needing to change the PCB.

Inevitably, there are changes, as you can see, the Mini PET once had a 555 timer based reset circuit, but that function was taken on by the CRTC microcontroller to save space on the next board....

This was the second board produced, V1.21 (I was clocking through revision numbers for each change made to the design).

This one still had a few features which were eventually dropped, including selectable CPU clock. This seems like a neat idea, but in the end not. Datasette loading didn't work over 1MHz as it was asynchronous and had to match the clock timing. IEEE-488 failed over 2MHz (also due to timing based on cycle counts). Changing the speed after loading often failed due to contact bounce on the jumpers, which could have been resolved with a 157 or a 4066 or something like that, but the feature was dropped to avoid causing problems. (I did go for this on the Minstrel 4D, which now has a turbo button to switch clock speed - http://blog.tynemouthsoftware.co.uk/2022/08/minstrel-4d-overview.html)

This board had the GAL replaced by logic chips but still needed some extra mods trying to get the timing right.

This version of the board did have one important difference, I had added a jumper to select the clock source between a WDC chip or a MOS (or Rockwell etc.) standard 6502. This did not address the pin 1 ground / output pin issue, and left that pin unconnected, which some 6502 chips were not happy with, they do seem to need both pins connected.

It almost worked, but memory access timing to fit both chips was right on the edge, and would occasionally fail. I could never get it properly reliable with both CPU types, and to support both would have needed two different memory timing circuits selected based on CPU type. That would need a block of four jumpers to change CPU type. I decided that since this was going to be a kit, and going to be supplied with a W65C02S, it was best to just tune it perfectly for that and remove 6502 support - hence the warning on later boards.

I did look into building up another V1.21 PCB to use for testing, thinking I could miss out the parts I didn't need, but when I looked into it, all I could leave off were the datasette motor power circuits. Pretty much everything else was required if I was going to access the IEEE-488 bus.

There didn't seem much point in duplicating the whole thing, so this board will become the test rig. This one was already modified to 6502 timing, and with a ground wire attached to pin 1 (underneath) it was ready for use. It just needed a few extra sockets to rise above the 'vertical modifications'

It does need a keyboard. I could have used the one from the previous rig, or build another of that type, but I decided it would be better mounted to a solid board. I had a look through the scrap PCB pile, and found some boards from the Mini PET 40/80 development.

This was the first design with the build in keyboard. I had spaced the keys out wider and added the extra keys for power / reset / menu in a vertical row above the keypad. I didn't like this, so on later revisions, I went back to the closer spaced keys and had the four function keys down the right hand side instead.

With nothing populated on that board, I can use only the keyboard, via a plug and socket arrangement. I also added pillars through the boards for support, including an extra one directly under the 6502 socket for extra support.

The nice white light touch key switches I use on these are expensive, so I didn't want to allocate a full set to this. Instead, I used up some of the yellow hard touch keys we received in error one time. They aren't as nice to type on, but I am not expecting to type on this keyboard much.

In fact, the only keys I really need are Shift and Run/Stop.

The testing software is carried across from the old rig. I alternate between the old hour long BASIC test program and a shorter test using a modified version of the Mini PET self test ROM.

These are the only programs on these SD cards, so can be loaded with Shift + Run/Stop.

The display is a little bit wavy there as the CRT controller on the V1.21 Mini PET board was an early development version, and by the looks of it had a few extra instructions on the 8th line that were not being offset in the other 7 correctly. This was all fixed in later versions, but I think some of the pin allocations are different on this board, so I have just left the microcontroller on there with whatever version of code it last had as it works well enough for the RAM tests.

Add an SD2PET and the new PET ROM/RAM board test rig is ready.

I was going to wire up the soft power on circuitry on the V1.76 board, but that was an early version and it was improved in the later boards. The inline power switch works fine, so I will just stick with that.

The test procedure I normally follow is to have the onboard RAM disabled, and the onboard ROM set to something different (in this case, there is a development version of Mini PET BASIC on there. Just needs to show if it is using the onboard ROM or the replacement ROM.

I start with the PET Tester ROM which does the B/G test on the first 1K of RAM, then shows the character set and repeats. The screen of 'B' characters when no RAM is enabled really shows up the development video controller timing.

Following that, I enable the replacement RAM and it should go to G's. Then go through the ROM images, quickly checking it will boot to BASIC 1 and BASIC 2 and finally I select the CRTC BASIC 4 ROM which should boot up on any PET, I leave them set like that. Once booted, I use SHIFT+RUN/STOP to load one of the test programs and leave that running for a bit.

If I am packing a batch of these, I will run the modified Mini PET System Test and let that loop 10-20 times whilst I pack the previous board and prepare the next one.

I occasionally switch to the slower BASIC memory test if I am taking a break, and let that run through it's hour long test.

I could probably dispense with all of these tests, since every single board in the last batch passed, (full disclosure, one was rejected before testing as I noticed one pin had not been soldered, but when soldered it tested fine). I still test them all I regard these as test instruments, and want to be confident that each and every one of them is tested and working well.

Since starting to sell these via TFW8b, I have upped the game a bit, and these now come in their own little boxes, complete with their individual serial numbers.

These stack quite neatly in the larger boxes, ready to ship down to the Pink Windmill for distribution:

Advertisments

PET ROM/RAM boards are available from The Future Was 8 bit:

https://www.thefuturewas8bit.com/shop/commodore/pet/petromram.html

As is the SD2PET

https://www.thefuturewas8bit.com/sd2pet-future.html

I am a bit surprised the PET ROM/RAM boards are still very popular, I sort of expected that when we launched the Mini PET 40/80D that would have been the end for the PET ROM/RAM. The Mini PET 40/80D is a drop in replacement for any PET board, so not only fixes any problems, adds 40/80 column mode, upgrades the ROM and RAM, and adds a built in SD2PET.

https://www.thefuturewas8bit.com/shop/tynemouth-products/minipet4080d.html

Patreon

You can support me via Patreon, and get access to advance previews of posts like this and behind the scenes updates. This now also includes access to my new Patreon only Discord server for even more regular updates.

https://www.patreon.com/tynemouthsoftware

Sunday, 21 August 2022

Power supplies of the 8 bit generation

During the development of the Minstrel 4D, I started looking at the options for it's power supply. This started off as a short introduction to a post about that. However, once I sat down and started typing, it grew into a significant Patreon post in its own right. The actual article followed in a separate post (or two). I have now expanded this one even more, and also the second part which will follow next week.

As part of the research for an upcoming project, I wanted to look a bit deeper at the various methods of supplying power to 8 bit computers.

ZX80/ZX81

A good starting point is the ZX80 and ZX81.

These both use the same nice and simple power input. A 3.5mm headphone jack is used to take 9V DC. This is then regulated down to 5V with a 7805 and a heatsink. The unexpanded board draws about 200mA (depending on the ROM and RAM chips used). The 9V is not use for anything else but is provided on the edge connector for expansions to use to get their own power.

I don’t know it is was officially specified, but there seems to be a general understanding that if you weren’t using too much power, say less than 50mA, then you could just use the 5V on the edge connector, and the internal 7805 would get a bit warmer. If you needed any more power, you should use your own regulator to generate the voltages you need from the 9V DC. This became more important with things like the 16K RAM packs that used DRAM which required 12V DC and -5V DC, which were generated from the 9V.

The simple 7805 approach works well, and I used the same method on many of the early kits. One thing I changed was the power connector. It can be a bit of an issue as it is right next to two other identical 3.5mm jacks, one for ear and one for mic. It shouldn’t do any damage as there are resistors and capacitors in series with the input, but it will cause confusion when it doesn’t work.

Another issue is the 3.5mm jack will short the two contacts when inserted and removed, so is not ideal for a power supply. I went with the 2.1mm DC jack, centre negative. As used on the ZX Spectrum and Commodore 16 etc. (I will discuss polarity and related issues in the next post)


There is no power switch here, so you either rely on turning the external supply on and off, or you plug and unplug the cable, hence why the 3.5mm jack is a bad idea.

A common upgrade is to replace the 7805 with a switching regulator. This removes any issues with it running warm.

Pros: Simple, cheap, allows for some expansion

Cons: No power switch, shorts on removal / insertion, runs a bit warm.

ZX Spectrum

The Z Spectrum continued with only a Few changes to the ZX80/ZX81 approach. First was the 2.1mm DC jack as previously discussed. The second was to become the Achilles heel of the Spectrum. It had 16K of 4116 dynamic RAM onboard. Like the 16K RAM pack in the ZX81, this needed 12V and -5V. And so, the saga of the Spectrum's switching regulator began. The design of this changed on every revision of the board, and sometimes several times between with mods applied at the factory or recommended to service engineers. Transistor TR4 and TR5 were notorious for failing and losing the +12V and -5V rails which is a good way to kill 4116 DRAM.

The 32K of additional RAM in the 48K models was 5V only. It would have made sense to have switched to using those chips in the lower bank, or the 5V only versions of the 4116 such as the 4516 used in the Atari 5200. (You don't normally see green silkscreen on chips. I wonder if these turn red when they fail?)

I expect they would have considered options like that, but as the edge connector had -5V and +12V, they had to provide those to support add ons that had already been developed. When Amstrad came along, they were less concerned about backward compatibility, so finally dropped those rails from the last generation of Spectrums.

As with the ZX81, a switching regulator can be fitted which will reduce the heat generated (just leaving the ULA to heat the room).

Pros: ….anyone got any ideas?

Cons: unreliable and the cause of failure of a good proportion of Spectrums (+ no power switch)

Commodore PET 2001

In a slightly different direction, going back to the original Commodore PET 2001. This was a fairly straightforward power supply arrangement. A centre tapped transformer provided 9V AC which was rectified by two diodes and fed to a large smoothing capacitor that was not on the mainboard. The 9V actually goes to the capacitor on one red wire, and comes back on another.

From there, it feeds a few 7805 regulators to generate 5V DC for all the logic on board. These had huge vertical heatsinks on and would often run warm, particularly in older machines where the 6540 ROM and 6550 RAM chips slowly fail and start a war of attrition with each other seeing who’s output transistors can win the bus contention argument as they slowly cook themselves.

The 9V DC is also used to power the datasette, giving it a switchable 6V (ish) supply – see a previous post where I go into a lot of detail on the various circuits used for that.

http://blog.tynemouthsoftware.co.uk/2022/06/powering-commodore-datasette-drives.html

Pros: Bomb proof simple chunky design. These things will outlive the cockroaches. Mains powered with mains on off switch.

Cons: Bomb proof simple chunky design. Weighs an absolute ton.

Commodore PET 2001N - 8032

The Commodore PET 2001N onwards also jumped on the 4116 bandwagon, with all the additional complexity that brought. The 9V supply was now full wave rectified to provide a lower current -9V supply which fed a 7905 to generate the -5V rail. An additional secondary winding on the transformer, more diodes and a smaller onboard capacitor provided a 15V supply which was regulated down to 12V with a 7812.

The 5V regulators were swapped out for even beefier TO3 packaged LM340K regulators which could handle several amps at 5V. There were initially two, but later revisions of the board had just a single one of those.

Pros: A more reliable multi rail supply with even chunkier 5V. Mains with power switch

Cons: As before, bulky and heavy, and now additionally complicated

Commodore VIC 20

The first version of the VIC20, referred to as “2 pin” because it had a two pin power connector. This was fed 9V AC from an external transformer. As simple as it could be. On board there was a power switch and the chunky TO3 version of the 7805 with a big heatsink. Like the PET it also used the 9V to generate the 6V for the datasette, and like the Spectrum, it complicated future designs by providing 9V AC for external devices, in this case via the userport.

Side note, they used at least two different connectors, the US version is different to the UK one, not sure about the VIC1001.

Pros: Simple and cheap. Reliable design. Mechanical power switch.

Cons: Even with the big heatsink it does get warm. Takes up a lot of board space.

Commodore VIC 20 CR

The second version of the VIC20 moved the 5V regulator off board into the power supply. This brought with it two problems. Firstly, because of the need to provide 9V AC to the userport, the supply now has to provide 5V DC and 9V AC, so they chose for some reason to use 4 pins of a 7 pin DIN plug. (aside I haven’t really thought about that before, I wonder if there was some lost interim plan to provide -5V and +12V on the same connector, hence the unused pins?)

The second problem is they just seemed to do a bad job with the 5V. Not sure specifically why, there is a resistor in the ground wire on the regulator, and that makes it a lot more susceptible to a failure mode where it passes all of the input voltage to the output. This feeds much more than 5V onto the 5V rail and fries the board. Not to be recommended. Don’t use these supplies folks.

This is such a common problem that there are a few solutions around. One I am not personally keen on is the inline protectors, I am not convinced they would operate fast enough to protect the machine. Another solution is complete after market power supplies which are generally a safer bet.

Another option with the VIC 20 CR (“7 pin VIC”) is to feed it with 5V only. The 9V AC is fed direct to the userport and it’s only use on board is to provide power for the datasette. If you aren’t using anything on the userport that needs 9V AC, and you don’t need a datasette, then a single modern 5V supply is a good way to go. (you can also use a 5V and 12V disk drive type power supply as the 12V DC can be fed where the 9V AC would go and will power the datasette. The TIP 29 will get a bit warmer when the drive is in use, and it may not be suitable for any userport devices, so be wary).

Pros:gets rid of big heatsink. Mechanical power switch

Cons:Danger Will Robinson. Do not use.

Commodore 64

The C64 used the same supply as the later VIC20, but made more use of the 9V AC. Here it was rectified to get 9V DC for the datasette, on some models, an additional 7805 provides a dedicated 5V rail for the video circuits. There is also a voltage multiplier circuit and a 7812 to generate 12V for the SID and the VIC.

Most of the standard C64 power supplies were glued shut and fully potted inside. Making then not only unreliable but also unserviceable.

Some later versions were screwed together, but still partly potted inside.

Pros: Mechanical power switch

Cons: Danger Will Robinson. Seriously, do not use!

Commodore 64C

They simplified things a bit with the C64C, they got rid of the voltage multiplier and lowered the supply voltage to the updated SID and VIC to be 9V.

Commodore plus/4

This uses the same supply (with the same issues) as the C64, but much to the annoyance of the designer, has a square 4 pin DIN instead of the round 7 pin (although early PCB revisions could fit either socket).

This is another of the reasons why this post kept growing. I have converted several of these in the past, but couldn't find any photos, so I ended up converting another one. I took enough photos that it justified a post in it's own right - http://blog.tynemouthsoftware.co.uk/2022/07/commodore-plus4-7-pin-power-conversion.html

Commodore 16

There are various things wrong (or at least less than ideal) with the Commodore 16, but actually the power supply is one of the best.

Nice and simple, 9V DC in, centre negative. Mechanical power switch, 7805 regulator and 6V for the datasette. No external access to the 9V DC, so no issues there.

The external power supply is very much the same as the Sinclair ones, nice and simple, and screwed together so it is full serviceable and even fused.

As unexpected as it might be, I think the Commodore C16 has the best power supply of any of the 8 bit computers. There I have said it. Do you agree?

Pros: Simple reliable design. Mechanical power switch, external supply, serviceable.

Cons: None that I can think of.

Commodore 128

There were a few variations of this, but they basically started to get things right with internal or external switch mode supplies with proper regulation and reasonable efficiency.

The same thing continued into the 16 bit Amiga range.

More on this in an old post on repairing that PSU

http://blog.tynemouthsoftware.co.uk/2014/10/commodore-128-repair-part-1-psu.html

Pros: Internal or external versions, mechanical power switches

Cons: external version for flat C128 is a bit bulky, but worth it for a better quality supply

Atari 5200

I will include this here just because it is very weird. The 5200 used a combined RF cable and power supply.

Let that sink in.

There was a single cable that provided the power and also the TV signal.

In the wider world it’s not that usual, the same thing is used to power the LNBs on domestic satellite dishes etc. But in the 8 bit computer world I think it is unique.

Here the power is combined with the RF signal in a box at the TV end (unpowered switch boxes like that appear to have been more common in the US, I don’t recall seeing them in the UK).

The single thick coax goes to the box where it is split and powers the unit. It does have a nice soft power on circuit. This has a soft touch power button (i.e. not a clunky mechanical switch, but a push on, push off digitally controlled switch), which switches two separate 7805 regulators. One of which is disabled when there is no cartridge plugged in, which is a nice touch that might have saved a few 2600s.

More details in a repair blog from a few years ago

http://blog.tynemouthsoftware.co.uk/2019/01/atari-5200-not-powering-on-repair.html

Pros: Remote power, soft power on, safety cutout on cartridge removal

Cons: Over complicated. Fixed, thick, inflexible RF cord.

The BBC Micro - Early models

Early models of the BBC Micro had a nice linear power supply. This was a toroidal transformer feeding a number of linear regulators. I think there were 7805s. I don't know as all the ones I have are both riveted shut and still working.

I think these were used on the Model A, which had no disk drive, so no need for the disk drive power, which was not present on these models. 

More about the BBC Model A - http://blog.tynemouthsoftware.co.uk/2019/06/bbc-micro-issue-2-model-a.html

Pros: Nice simple solid design. External power switch

Cons: Messy internal wiring with several spade connectors scattered around the board. No disk drive power.

BBC Micro - Issue 3 onwards

The power supply was changed to a nice switch mode supply in most models. Mains powered, on off switch. All very good.

But, they use RIFA filter caps. And they go bang. They always go bang. If they haven't yet, they will. Don't think "I'll give it a quite try first". No, always replace them before powering on, or you will regret it for the next day or so until your house stops smelling of burned capacitors.

There is also another capacitor which is a bit close to a heatsink that has a tendency to fail as well and stops the power supply starting up.

More info here

http://blog.tynemouthsoftware.co.uk/2017/05/bbc-micro-power-supply-repair.html

Pros: Switch mode supply. Power switch.

Cons: The grim Rifa.

Amstrad CPC 464


This one starts well, 5V DC in. Nice and easy.

But dear old Sir Alan didn't just want to sell you a computer. Not happy with gluing a tape deck to the side of it, he wanted to sell you a telly as well.

So the power for the CPC464 comes from the TV, with a two wire arrangement, one plug is for the RGB video out of the computer, and one is for the 5V power.

If you aren't using the Amstrad monitor / power supply, you can use an external 5V supply.

Pros: Neat if you are using the whole system

Cons: Messy if you are not using the whole system, expensive if you already have a TV you could have used.

Amstrad CPC6128

The success of the CPC464 was followed up but the slightly more complicated CPC6128. This had a built in disk drive, which also needed 12V, so as well as the two existing wires the came from the TV, there was a third which came from the computer and plugged into the TV.

This was messy when used with the Amstrad monitor, and when trying to use it without the monitor it's just plain silly.

Pros: Not as bad as the GX4000

Cons: Messy either way

Amstrad GX4000

I don't actually have one of these, but I understand they had two DC jacks on the back, two power supply options, 5V from one of the CPC464 tellies, or 9V DC from a power supply. In theory, one is 2.1mm and one is 2.5mm, so you can't plug the supplied power cable into the wrong jack, but guess what? People will use anything that fits, and plug the cable into the wrong one and bang.

Pros: Any fans of the GX-4000?

Cons: Two power input jacks. Nice idea.

Oric 1 / Atmos

This is unfortunately one of the most problematic. For no good technical reason that I can see, and possibly due to cost or supply, they used a 7905 -5V regulator to generate the +5V DC.

I will go into the issues with this in the following post. Like many of these system, it is fine if used in isolation with the correct supply, but if you change things, it gets complicated.

Pros: There must have been one at the time

Cons: Potential problems with voltage offset of the 0V rail.

What have I forgotten?

Congratulations if you made it this far. Quite a lot going on there, and there are many more I could have included. What have I forgotten? any other weird and wonderful options? Should I have split this up? I did start to add schematics to some of them, but then it gets a bit silly.

Next Up

I will leave it there. The next stage is to look at the modern versions on the Minstrel and Mini PET and what options to consider for a future project, including USB power, input polarity, bridge rectifiers and the whole Oric thing.


Advertisements

Spoiler alert - the Minstrel 4D did not end up being USB powered (although one of the prototype boards was).

http://blog.tynemouthsoftware.co.uk/2022/08/minstrel-4d-overview.html

The 4D is available for pre-order now from The Future Was 8 bit.

https://www.thefuturewas8bit.com/minstrel4d.html

Patreon

This post is an updated and extended version of a post from my Patreon. If you want advance previews of posts like this and behind the scenes progress on new projects, you can follow along and support me on Patreon:

https://www.patreon.com/tynemouthsoftware