Sunday, 5 June 2016

VIC 20 Cartridge PCBs

This is an old post, preserved for reference.
The products and services mentioned within are no longer available.

When I design PCBs I usually try to add as many options as I can, to cover all the configuration possibilities. This often leads to jumpers or DIP switches.
This isn't too much of a problem on a large board, but on something like a ROM adapter, it makes the board larger than it needs to be a can overlap adjacent sockets.
Most are implemented with a pull up resistor or resistor array and a jumper or switch shorted to ground. This is fine as it allows all the different configurations to be tested, but once they have been tested, they are just taking up space. The resistors are also drawing a small amount of unnecessary current. Not a major issue, as they are usually in the order of 10K, so at 5V 0.5mA. You can get around this by using a link to select 5V or 0V, but you shouldn't change this on the fly as it will leave the input floating.
One the VIC 20 diagnostics cartridge I was looking to add an option to select a ROM image, but didn't want to add an unnecessary resistor. I had been programming a larger ROM with either the PAL or NTSC version of the diagnostics software, depending on where the order was for. I have now added a link to select the version. 
There is no ground plane inside the jumper block, and there is a hard wired link in the PCB layout for PAL, so for a PAL cartridge, just leave it as it.
For an NTSC one, just cut the link between two of the pins and install a wire link between the other two. This can be done when supplied, or at a later date by the owner.
It is also spaced suitably to install a header. The track is cut and the jumper installed where it was for PAL, or on the other pins for NTSC. A switch can also be fitted, but it is not ideal as the address line is floating when the switch is changed. 
That all looking to be working, so I added a few more options and removed the RAM to create a VIC 20 ROM cartridge. Not on the scale of the ROM and RAM cartridges I have previously made or Penultimate Cartridge I am working on, just a single ROM chip with a few options. I was thinking this could replace a damaged PCB or failed mask ROM in an original cartridge.
These were 8K or 16K. The example above is a dual 8K board with a single 8K ROM fitted (VIC 1922 -Comic Cruncher). This one was fairly badly corroded, but the contacts should clean up. The jumpers in the centre selected the ROM block. There is space for a second 8K ROM with it's own bank select jumpers.
Some also used a single 16K ROM and some additional logic. This was a dead Pirate's Cove. (let's not start that again, it's not the Cove of the Dead Pirates, but a dead cartridge which used to play Pirate's Cove). The Dead Pirates Cove cartridge actually used a 16K ROM, and a 74LS00 which converts the two block address select lines to the chip select and A13 address line. That could probably be fixed by replacing the faulty ROM with a 27C128 would probably fit, but there are a few unconnected pins which would need to be pulled high.
I've designed a new PCB along with same lines as that. There are the same kind of solder jumpers as used on the diagnostics cart to select the block address for each 8K half of the ROM. 4 way this time as blocks 1,2,3 and 5 are available. I've hard wired on the PCB links to blocks 3 for the lower half and 5 for the upper half, I think the most common setting. These can be changed as before by cutting the track and adding a wire link
I've setup one cart with jumpers and a ROM socket to test various options. Pirate's Cove is one of the unusual ones that use blocks 2 and 3 and you have to start with a POKE command. I have fitted jumpers to this board to select blocks 2 and 3 and programmed up a suitable EPROM.
There are also pads to select the high bits of the ROM, hard wired to 5V which suits smaller ROM chips where these pins are VPP or other things rather than address lines. A 27C256 could be programmed with two 16K ROM sets, or a 27C512 with four 16K ROM sets and the appropriate one selected using jumpers or wire links.
This can be used for 8K cartridges, with both links set to the same address. 
I will probably make a separate PCB for 8K carts as the 74LS00 is not required for a single 8K block. It will almost always be block 5, so that is hard wired, but the link can be changed if required.
Here I have made a replacement for a Donkey Kong cartridge which uses blocks 1 and 5, so only one link is changed.
The PCB is designed to fit into the original cartridge case.
It can also be used directly in the VIC20, the finger grips on the side allow easy removal.
That seems to have worked out, so I have designed some ROM replacement PCBs using those sort of jumper links. Those can now hide under the ROM chip, reducing the overall size of the board. I expect those sort of preset jumpers to appear on various other boards now.

UPDATE: I did make the 8K versions:
I now have a selection of these boards available, contact me if interested.

2022 Update: More recent versions of the VIC 20 cartridge PCBS are available from  The Future Was 8 bit

Thursday, 26 May 2016

Vintage Computers - an ebay buyers guide

Ebay is a good source of old computers, and I buy quite a lot from there. I usually go for the unwanted, unloved, un-bid-on items that need a bit of TLC. Over the years you get to see patterns in what is listed and what actually arrives.

I was pointed at a listing last week which stated:
Does not power on - item was working then one day it just stopped.
Everything was probably working one day, the day before it broke for example. It doesn't change the fact that it is currently broken. It was probably working before they tried to power it from the wrong mains adapter. Probably working before they tried a composite video mod with a plumbers soldering iron. Probably working before it got put into the washing machine. Probably working before the all night Donkey Kong session with the ventilation holes covered. Probably working before it had beer spilled on it. Probably working before they opened it up to see how it worked and damaged the membrane tails etc.

Elvis was fine, then one day he just stopped working. No, Elvis is dead. Sorry to break the bad news, but you should have heard by now.

For reference, here is a translation of what many of the terms used on ebay listings actually mean:

  • "Tested and working"  - the light came on. 
  • "Untested"  - the light didn't come on.
  • "Probably a simple fix"  - probably won't be a simple fix
  • "Could be the fuse"  - I tried the fuse and it wasn't that
  • "Working when put away"  - Now broken
  • "Can't test as I don't have the power supply"  - Tested and broken (the power supply will be listed next week)
  • "Sold as seen" - Broken, probably with bits missing inside or damage carefully cropped out of the photos.
  • "Will be well packed"  - Will be wrapped in a black bin liner and thrown at the cheapest courier service.
  • "Rare" - Common as muck
  • "UK Seller" - Chinese Seller

You see the pattern developing there? Caveat Emptor. I hate to go all Fox Mulder, but Trust No One. I buy a lot of stuff from ebay (this is me now, not Fox), and usually approach it with the expectation that it is going to be bad.
Certainly be wary of power supplies, I've had several Atari 2600's both ebay purchases, and ones sent in for repair (that were probably ebay purchases) which came with the wrong mains adapters, and worked fine with the right power supply. Mains plugs are definitely worth checking. They almost always have 13A fuses fitted, the screws inside loose and sometimes the odd wire reversed.
I've also had Spectrums, and recently an Oric-1, where the internal regulators had been bypassed. Always worth a look inside, you never known what you are going to find, or not find in the case of this Spectrum +2 which was looking a little short on the RAM front. This was listed as 'was working when put away'...
To balance those out, sometimes you do get extras. I found a nice selection of springs inside a Commodore PET 8032-SK. Very kind of the seller to include them, but not the best for the address bus drivers.
I had a guitar amp in for repair that I think had come from ebay. The lights were on, but only a loud buzzing sound. As well as a lifetime supply of cat hair, inside I found a bonus free guitar case key wedged between a MOSFET and some wire links. Worked a lot better with that removed.
On the plus side, it's always a bit disappointing when you buy something and it is in perfect condition and works first time. It is much more interesting to fix things, so I prefer the broken ones, and I am rarely disappointed.

Sunday, 22 May 2016

Oric-1 Repair Part 1 - Reset circuitry

This is an old post, preserved for reference.
The products and services mentioned within are no longer available.

This is the first part of an Oric-1 repair. I'll describe it's initial condition again, and cut down that section in the previous article. The repair starts after that.
This Oric-1 was 'untested' in ebay terminology - i.e. broken. I never plug anything in before checking it out. This is a case in point as to why that is a good policy.
Inside there is a 3 terminal regulator missing. Not the usual 7805 I was expecting, but for some reason the Oric-1 uses a 7905 regulator. The 7905 is designed to take -9V DC and generate -5V. Here it's wired slightly oddly to take +9V and generate +5V. Why they didn't use the normal version I don't know.
This arrangement means that in normal operation the 0V rail inside the Oric is about 4V above the 0V rail of the power supply. If you happened to have a power supply where 0V was tied to mains earth (which is not unreasonable), and you plugged it into a TV or monitor with it's ground referenced to mains earth (which is quite possible), it would short out the 4V differential and the board would be running at 9V?
Anyway, it turns out a previous owner had bypassed the 7905 making it a 5V DC input  That would make more sense, as long as it is clearly labelled, which it wasn't. There are also a few other suspicious mods, various extra capacitors scattered around the board, and some strange resistor and capacitor mod to the power feed to the modulator.
The Oric-1 originally had two 8K ROM chips. Later models had a single 16k chip. The board was designed for either arrangement, it was fitted with either two 8K ROMs and IC11, a 74LS00, or a single ROM and LK2 jumper link. This looks to have started as the two ROM version and been modified to a single ROM. The ROM fitted is an Oric-1 BASIC 1.0 mask ROM, so another machine has been involved. That may now be running with the two original ROM chips from this board.
The CPU is also not original and I'd hazard a guess it came from a mark 1 VIC20, as it is a 1980's date code MOS part, and I've seen blue stickers like that on many VICs. Looking again at these pictures, the date codes are all over the place, from 1980 to 1984. Many of the chips look to have been replaced at some point.
Feeding the board with 5V directly, it is not working, there is a nice pattern on the TV though. In these sort of situations, I tend not to trust previous repair work, when there is flux residue on lots of chips on the back of the board, you know someone has been messing around in there.
When chips have been removed and resoldered without sockets, it is sometimes difficult to know if any tracks or through hole vias have been damaged. These is some damage around where the 74LS00 was removed and not replaced, so I decided the best option was to remove the other chips which had been replaced in the past and check out the board.
Once the board was cleaned up, it was actually in reasonable condition, so I fitted sockets for the larger chips. I tested and replaced the TTL chips that had been removed, all were fine. I also removed the two ROM sockets and fitted a single socket since I would never be using a pair of 8K ROMs.
There were only meant to be a few electrolytic capacitors on the board, so I replaced those. I may install a 7905 (with additional heatsinking) or a switch mode replacement, but at this point I just tidied up the 7905 bypass. A large label will be attached to the case if I leave it like that.
I installed a set of known working set of chips (thanks to @futurewas8bit for the ROM images).
Retesting again it was still just showing the black and white boxes.
Back to first principles, power, reset, clock. The power is OK, 5V getting to all the chips, a bit of ripple, but not much. I tried adding some additional capacitance, but it didn't change that much and still showed the black and white bars. Slightly better now, with a temporary composite video modification.
The clock was also fine, 1MHz into and out of the 6502. The reset pulse didn't seem to be there, it was going high too fast and the CPU was not resetting. I shorted out the reset pin and it booted up!
I tried many times, but could not get it to start up itself without forcing a reset. The reset circuitry on the Oric-1 is as basic as you can get, a capacitor is charged up by a resistor and the voltage across it should initially be low enough to start the reset cycle, and after a second or so be high enough to complete it and start the chip running.
This wasn't working. I had already replaced the 1uF capacitor, but that and the original had tested fine. I did manage to get it partially working with a 10uF capacitor, sometimes it would start after about 5 seconds, other times it wouldn't. I tried several versions of the 6502 and with both the 6522 and AY-3-8912 removed as they both have reset connections, but it wouldn't start up without a kick.
Most of the other 6502 based systems I can think of use a 555 timer based reset circuit. The same RC circuit is used to trigger the 555 and generate a clean reset pulse of a defined period. As far as I can see all the Commodore 65xx based systems from the very first KIM-1 through to the Commodore 128 all used a 555, or half of a 556 to generate a clean reset pulse.
The BBC micro also uses a similar circuit. It is only the original Atari 2600 I can think of that used the RC circuit. In the later 2600 Jr and 400/800 series at least they use a logic gate to buffer the R/C signal.
Apparently the original design for the Commodore 264 series (plus/4, C16 etc.) used an RC, but the 555 circuit was reinstated when Bil Herd took over that project. Given the 555 one shot timer circuit had survived through so many machines and cost reduction exercises in Commodore, a company not known for extravagant additional circuitry, it must be necessary?
But the Oric-1 only has an RC on the reset pin. It seemed the thing to do was to fit a 555 based one-shot time circuit to generate a reset pulse. The output of the 555 is high during the pulse, then low, so the plan was to use a transistor on the output to pull the reset line low, connected where the capacitor was, leaving the resistor in place to pull it high in normal operation.
I tried to think of a way of adding that neatly. but one 8 pin chip, three resistors, three capacitor and a transistor are a little difficult to hide. I then decided to cheat.
It's still an 8 pin chip, an ATtiny25 microcontroller, but doesn't need all the other items, I've added a decoupling capacitor, force of habit. That will be setup to enable pin PB1 as an output, and drive it low. Wait 100mS then set it as an input. The existing 2K2 pullup resistor will then pull reset line high, the CPU will start up and the microcontroller will go to sleep. I've set it as an input rather than driving it high so that reset can still be pulled low by an external add on or reset switch.
I think it took longer to write that description than it did to write the code itself. With the chip programmed and the fuses set for brown out detection and the low power internal 128KHz RC oscillator divided by 8, it shouldn't draw much power or create any noise. To fit it to the board, I looked to the pads left when IC11 was removed.
IC11 was a 74LS00 quad two input NAND gate used to derive the chip select for the ROM chips when two 8K ROMs were used. It has 5V and ground, and several connections that just connect to other gates in the same chip. Only three pins on the microcontroller are need. The two power pins, pin 4 is ground, pin 8 is VCC, are fixed, but of the remaining six, any could be used as the output, and the rest set as high impedance inputs.
Ground is in the right place with the chip aligned to the right and the other two pins are connected to pads that were wired only to other pins on IC11. No tracks to cut, just 5V to apply to pin 8 and I can use pin 6 as reset, which I wired directly to pin 40 on the 6502. I added the decoupling capacitor on the back, directly across the chip.
I did try to use a ATtiny44, a 14 pin chip that would have fitted the original footprint, but the pins were in the wrong placed and I didn't want to cut any tracks. I don't think you would spot it unless you were looking for it, fits in quite nicely. The original capacitor on the reset circuit (C21) is removed.
With that fitted, it is now starting up every time. I initially used a 1 second delay, and dropped it down to the 100mS shown above, and it still seems fine. That is about what the BBC used, the Commodore PET had 1 second, and the C64 500mS.
Next step is to try to reinstate the original chips, fix the power supply and improve the video output with a permanent composite video modification or RGB to SCART.

Update - see Part 2.