Commodore CBM 4016

4016 Arrival

The Commodore PET (branded CBM in some markets) computer is an icon of early microcomputer history.  There are very few in Australia and the only ones I have seen in South Australia was the one in the Adelaide Uni Physics labs back in 1983 and one imported from the UK.  I am aware of one other that was for sale on gumtree about 5 years ago. 

It was some surprise then that I spotted this image on facebook marketplace. I was further surprised when I contacted the seller and he said he had a second machine covered in pigeon poo.

Presentation is everything, so i was interested of course. We came to an arrangement for the first machine and i drove (with my wife for company) up to Snowtown (a town with a story) where it was located. 

The site was an ex Telstra maintenance site, long since abandoned to the pigeons and probably a myriad of other undesirables. Just walking into the building was a health risk and the smell was unbelievable.

I paid a smaller sum for the filthiest computer ever, and another small donation got me a very disreputable 2031 disk drive.  The other drive is not related to these machines.

I pondered my sanity as I put them on a drop sheet in the back of the car.

I do have some standards about what comes into my “clean” shed and both machines were well below the threshold, so they went into the “dirty” shed first.

Opening the covers proved confronting.  The first was not too bad but very dirty and corroded.  The second machine and the drive almost made me gag. They were full of some combination of pigeon fluff and pigeon manure, which I suspect just blew in over a long period.  I donned rubber gloves and a face mask and began the ugly task of removing the debris, first in handfuls and then with the vacuum cleaner.

It was clear that I needed to disassemble the second machine and the drive unit if I was to get all of the offending material out – and that was a necessary first step to just being able to stomach and store the machines.

Having got most of the innards clear of crap, I started washing down the cases.  This was an unpleasant task, but was not difficult.  Pigeon mature seems to wash off fairly easily, and the largely plastic construction seems to have been unaffected by its coating.  Some stains remained, and the metal parts had some corrosion, but I was happy with the improvement.

The second keyboard was set aside for the moment.

At this point the machines were allowed into the clean shed, although they were far from clean.  Remarkably, though, they both seemed to be complete – not even a missing keycap.  The condition of the mainboards was poor, though.

These machines are both model 4016-N which means that originally they would have had 16k of RAM and 40 column text.

They both seem to have been upgraded to 32k of RAM and 80 column text.

I thought initially that they must have been used by Telstra, and perhaps they were, but they clearly once belonged to TAFE.

These machines were produced late in the PET’s product life.  They were obviously under cost pressure, eg there are a lot of places where rivets were used instead of screws.

80 columns is handy for things like word processing, but a lot of the games were produced for the 40 column models.  It is possible to put the machines into a 40 column mode, but the characters are still narrow and the proportions changed.

These machines use universal boards so they can be reconfigured to 40 columns – this would require several links to be changed and a new edit ROM.

There was a lot to be done before any reconfiguration would be on the agenda.

4016 ROMs

Both boards have the same set of ROMs.  Some of the ROMs on the first board are soldered in but all of the ROMs on the second board are socketed.  The Proteus programmer was able to read the EPROMs, but the ROMs are a little more difficult.  The program pin on the EPROM is a chip enable on the ROMs so it was necessary to make up an adapter socket for the ROMs to pull this pin high.

BoardTypeLabelSocketedLocationAddress  ConditionDescription
2EPROM YUD120x900036864-28672   Word Processor
2EPROM YUD110xA00040960-24576 Toolkit / Extramon
2ROM901465-23YUD100xB00045056-20480VerifiedCharacter ROM
2ROM901465-20YUD90xC00044152-16384VerifiedBasic 4
2ROM901465-21YUD80xD00053248-12288VerifiedBasic 4
2EPROMUnlabelled. YUD70xE00055344-8192Looks plausible but doesn’t exactly match any candidatesProbably an edit ROM of which there are many.
2ROM901465-22YUD60xF00061440-4096VerifiedKernal
2ROM901447-10Y    Verified – file size is incorrect but data is good8 10 file size is incorrect but data is good
1ROM Y    First 2k is the same as ROM 2Probably an edit ROM of which there are many.
1ROM Y    VerifiedToolkit / Extramon
1ROM Y    First 2k is the same as ROM 2Text Editor
1ROM901465-20N    UnknownBasic 4
1ROM901465-21N    UnknownBasic 4
1ROM901465-22N    UnknownKernel
1ROM901465-23N    UnknownBasic 4
1ROM901447-10N    First 2k is the same as ROM 2Character ROM

4016 Processor Boards

Both cards have significant corrosion and were very dirty.

The process was as follows:

  1. Wash in soapy water. Scrub with toothbrush. Blow off and allow to dry.
  2. Inspect and gently remove socketed ICs (one had corroded on to a socket).
  3. Apply soapy vinegar, rinse.
  4. Apply soapy vinegar, rinse. Blow off and allow to dry.
  5. Apply de-oxit to corroded legs and leave for 24 hours.
  6. Clean legs with wire brush on Dremel.
  7. Clean with soapy water. Blow off and allow to dry.

Most ICs have oxidised legs.  The legs on socketed ICs can be easily checked for integrity – in some cases, a small nudge was sufficient to make them fall off.  It’s harder to check those that are directly soldered.  It appears that in many cases the plating has been penetrated and is prone to flaking.  I attempted to re-tin some ic legs, but the solder would not take even with lots of flux – I suspect the material required electroplating and that’s not happening.  De-oxit is probably the only practical way to protect them.  Of course, they could all be replaced, but that will be time-consuming and will risk damage to the PCB.

The MC3446 line drivers (for the IEEE-488 bus) are located near one of the case openings.  One had legs corroded through.  The others were in poor shape.  They have been replaced with new ICs and sockets.

The PCBs are in generally good condition.  The edge connectors had lost some plating, but the oxide has been removed with deoxit and the copper re-tinned.

On the second board, a damaged socket was replaced.  I favour machined sockets, but this board never used them and the sockets that have been added in the past are either zero insertion force or dual wipe (the originals are probably single wipe).

The wire to the piezo was missing, so it has been replaced.

The configuration links in the middle of the board were untidy and used the wrong gauge wire.  They have been replaced.

Other links have been made with wire wrap.  The wires were unnecessarily long, making them vulnerable to breaking.  The posts were too high, so they were prone to bending.  The posts were cut down and the wire wrap redone.

4016 Keyboards

Process was (tedious):

  1. Remove the keyboard from the bottom of the computer cover.
  2. Remove the cable.
  3. Remove the metal clip grounding the foil cover to the keyboard.
  4. Wipe over the foil cover and set it aside.
  5. Blow out the keyboard.
  6. Remove the key caps with puller.  The spacebar requires two sturdy pairs of long nose pliers
  7. Store springs.
  8. Wash keycaps in warm soapy water using a soft toothbrush to scrub and allow to dry.
  9. Once dry, wipe over once more with a damp cloth.
  10. Blow off the residual loose dirt from the keyboard assembly
  11. Desolder the caps lock switch.
  12. Remove the pcb screws.
  13. Clean the pcb with paper towel and IPA.
  14. Remove and store the caps lock switch (2 little levers).
  15. Store the barrels and keypads.
  16. Scrub the key frame in warm soapy water.  Blow off and allow to dry.
  17. Wash the barrels in warm soapy water and allow to dry.
  18. Scrub the cable in warm soapy water, blow out, and allow to dry.
  19. Put the rubbers in a container and shake off as much dust as possible.
  20. Clean both sides of rubbers with cotton buds and IPA.
  21. Put the barrels back in the key frame and insert the rubbers.
  22. Clean them again.
  23. Re-coat rubbers with conductive coating.
  24. Inspect carefully for lint and remove.
  25. Reassemble.
  26. Test with harness and meter.

The conductive coating has to be mixed and then used within a couple of days so it makes sense to do both keyboards at the same time.

I did start with the second keyboard because it was in an awful state.

This is the first keyboard (from the cleaner machine).

The contacts were coated using a CircuitWorks Rubber Keypad Repair Kit.  This kit is quite expensive and a bit laborious to apply, but it does the job.  It looks like it’s using a silver paint.  The key resistances were very low.  There was enough in a kit to easily do the 140 or so keys.

The shift lock keys was not working.  While looking for a replacement online I found a video where the author had worked out how to open the switch by twisting the terminals, so I thought it was worth having a look inside.  It was filthy – I’m not sure how this much ick could get inside a switch with no significant orifice. 

It was built like a puzzle.  Cute little mechanism with lots of pieces.  After a clean, things looked better.

There is a spring as well – fortunately it was still in the parts container!

It took a while to reassemble it.  The pins screw through the contacts to create a hole and contacts at the same time.  I added some aluminium foil to make sure the contact was still good.  I was relieved to find that the switch was working.

Testing just requires a keyboard cable from the computer and a jig which joins all the columns to all the rows.  Then each key can be tried.  This can be done before putting all the key caps on by turning the keyboard upside down and pressing upwards.  Otherwise, without the caps and springs, all the keys are activated at the same time.

4016 Metalwork Unit 2

The process for the base was as follows:

  1. Drill out rivets holding feet on
  2. Wire brush to remove as much rust as possible
  3. Apply rust converter and leave for 24 hours
  4. Wire brush clean
  5. Apply rust converter and leave for 24 hours. 
  6. Wire brush clean
  7. Apply metal filler, wait to dry, and then sand smooth with detail sander
  8. Sand the remainder of the paintwork
  9. Apply etching primer to all bare metal
  10. Mask the labels
  11. Apply 2 coats of satin black paint on both sides.
  12. Reattach feet with screws.
  13. Remove paint around the ground stud.

The process for the monitor frame was similar, but the colour is a pale green and, because it was gloss, I had to coat it with a satin clear coat.  I messed this up in a couple of places by applying too thickly – it’s very hard to see how much is on!  The colour match is not great, but only a small section of the frame is visible, so I didn’t get too concerned.  I removed paint at the earth point.

The transformer baseplate was similar again, but it was originally galvanised and only partially painted.  I used a zinc paint where it was previously unpainted, and then masked and used satin black for the other areas.  I removed paint around the two inside screw holes to allow for a solid ground.

Wire brush

Rust conversion

Just prior to fill

Filled, sanded, and primed

Finish coats

With transformer base

CRT frame

4016 Power Wiring Unit 2

The power wiring is buried under the transformer mount.  It includes:

  1. Line filter
  2. 3 way terminal block
  3. Power switch
  4. Fuse
  5. Power Cord

Generally, the mains wiring was in good condition.  It all had to be removed for painting, though.

The power cord was unsightly, and I replaced it with a new-ish power cord that included a modern moulded mains plug.

I added heatshrink over the high voltage transformer leads just in case the insulation had become brittle.

The DC wiring had a few nibbles that were covered with heatshrink.  I missed one and applied liquid insulation tape to make do.

The capacitor was reformed using a bench supply.

Rust on the transformer was treated with deoxit and wire brush.

Voltages were checked initially at 24V and then at 240V.

4016 Set to Work Unit 2

I powered up with sockets empty and checked voltages.  All good.

I added socketed devices.  Three legs fell off one 6520 so that had an impact – particularly on the keyboard.  I replaced the 6502 which had a weak leg and one 6520 which had lost three legs.

On power up there was a chirp which suggested some life.

I added the monitor and was relieved to get a picture, although clearly it hadn’t booted.

I tried the card from the first unit (also with a replacement 6502 for the same reason).  It was less successful – no chirp and no picture, so it wasn’t getting as far.   For now, I’ll stick with Board 2 – at least the ROMs have checked out.

My joy at the monitor working was short-lived, as it stopped working within 30 minutes.  It produced quite horrible squiggly lines on the screen.  I was unable to find any posts that described the effect and therefore the cure, so I checked the board over as best I could.  All the transistors looked ok.  The yoke coils seemed to be good.  The flyback seemed ok.  The usual suspect resistors were ok. 

I was looking for a video that showed testing of the board without CRT connection, and in the process found a repair that involved diode D754 and the adjacent capacitor C754. 

I found diode D754 was a 10 ohm resistor, and when I checked D253 one leg fell off.  The faults may be related, or maybe not.  I replaced the original VO6E diodes with 1N4004, which have the same voltage rating and slightly better recovery.  I checked the capacitor and it seemed ok.  I see a recap in this monitor’s future, though.

Following the replacement, the monitor was back working.  I turned it all off and called it a night.  It worked for a while the following day, but D754 then became a 2 ohm resistor.  This time I replaced it with a diode with a higher reverse voltage limit 1N4007 (1kV rather than 400V) and I also replaced the C754.  I had a 400V cap rather than the original 250V.  I checked the voltage at the diode.  It seems ok.

Back to the original problem …

I made up a PETTEST rom using a 2732 EPROM.  This requires an adapter because the pinout does not quite match the ROM pinout.  Three pins cut (from a socket): 18,20,and 21, and two wires added: pin 20 of the ROM socket to pin 18 of the 2732, and pin 18 of the ROM socket to pin 20 of the 2732.

I put it in the Edit Rom socket. It didn’t work at all so I read the instructions and in this post: https://forum.vcfed.org/index.php?threads/pet-4032-blank-screen.1239174/:

Look at the part number your PET EDIT ROM.

Then look at this website
http://www.6502.org/users/andre/petindex/crtc.html and scroll to the bottom. You will find a spreadsheet called PET_CRTC.xls. Open this up and you will (hopefully) find a match for your EDIT ROM.

Use the values from the spreadsheet.

The CRTC registers are numbered from 0 through 17 (decimal) – a total of 18 numbers. The numbers in the spreadsheet are already in hexadecimal.

The CRTC initialisation table starts at byte offset 5 in my PETTESTER EPROM image. Hand-edit the 18 bytes using your EPROM programmer tools and burn the EPROM.

By adjusting the parameters you can set the PETTESTER to initialise the CRTC for 40/80 columns, 50/60 Hz frame refresh rate and for the number of raster lines per character displayed.

Just one problem – I don’t have the part number for the edit ROM because it’s an EPROM and the label was illegible.  I do have an oscilloscope though, so I measured the vertical and horizontal scan frequencies – 50Hz and 20kHz respectively.

That makes it look like the last 6 lines in the spreadsheet, but I have not been able to match my edit ROM with any of the candidates.  Tricky.  This may take some experimenting.  I started with the first one, and it worked – well, the video worked – but the video ram test failed.  Using the scope, I could see it looping the video ram.

Several video RAM chips seemed not to be working – again, using the scope I could see variation between bits written and bits read. 

Two 74LS244s also seemed to be bad because the input didn’t match the output for reads and/or writes.  I replaced the ICs using sockets.  They are FCT parts for now.  The board is not easy to work with – difficult to remove solder from holes. 

What I did notice was that having replaced the socketed video rams (two are unsocketed) and the 74LS244s, I was able to get every second character of the sign-on message using the normal edit ROM.

I replaced all the VRAM including the sockets and this resolved the missing characters.

But, I still didn’t have a cursor.  Also, the pettest still didn’t seem to operate as expected – I never resolved this.

I tried swapping over the other PIA and the VIA with spare parts but no joy.  The first PIA had already been swapped over due to corroding pins.  A general poke around showed that a lot was going on, but I eventually found some indeterminate outputs on the bottom PIA and this turned out to be a poor connection at pin 1 VSS.  I bent the pin in to put a bit more pressure on the single wipe contact and joy was had.

The full 32k of ram seems to be detected.   There is one socketed chip in each RAM bank.  Pulling the chip from the first bank causes the machine to not start.  Pulling the chip from the second bank causes only 16k to be reported.   Presumably there is at least a simple RAM test that has determined that all the RAM is OK.

At this point I wished that I had a working keyboard, but I had been putting them off because of the tedium involved in painting the contacts.  Instead, I put a little piece of foil on a cotton bud and used it as a stylus.

This is positive, but the IEEE-488 drivers need to be replaced and the remaining single wipe sockets could easily cause problems in the future. 

This gave me the necessary motivation to finish the keyboards.  Which now work well.