Thursday, 3 August 2017

Commodore PET 2001 Repair - Keyboard only some keys responding

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

A common problem with the Commodore PET (and indeed many computers of it's generation) is one or more keys not responding.
With the PET, most of the time, well, almost all of the time, this is down to bad contacts on the keys and can be fixed by cleaning the keyboard matrix. I'll repeat that, in bold.

Almost all the time, all that is required is cleaning the key contacts. This post is an unusual case where it was more than that, but that rarely happens. Please try cleaning the contacts first. 

With the 'chicklet' keyboard on the PET 2001, this is just a case of removing all the screws on the back and cleaning the contacts on the PCB. Full size PET keyboards are much the same - see a previous post on cleaning PET keyboards.
This is my test keyboard, and you can see from the sticker that the contacts were last cleaned a year ago and are still working fine, however, I've opened it up for two reasons. Firstly, I wanted to have some pictures of cleaning a keyboard in the post to reinforce the point that most of the problems with the keyboard can be solved by cleaning it.
Secondly, last time I picked this up off the shelf, one of the wires fell off - and by the time I took this photo, a few more had gone and the rest were looking decidedly dodgy.
This keyboard gets moved around a lot, so I thought I had better replaces the wires soldered direct to the board with something more sturdy. I removed the remaining wires and soldered on a 0.1" header.
I made up a temporary test cable and plugged the keyboard into a PET USB keyboard adapter, and all keys were working correctly.
Now that's back together I can get back to this board and confirm the problem with this board. It appears only the bottom row of keys is responding, along with a few others keys which are doing odd things, many appear shifted when shift is not pressed and most do not respond.
I ran my PET diagnostics board, and it was showing two of the ROMs were giving invalid checksums. I thought it might have been a ROM fault where the keyboard scan code or lookup table were, so I tried using a ROM/RAM board to bypass the onboard ROM and RAM, but the keyboard fault was still present.
I had already replaced the 6520 which drives the keyboard (with a W65C21N), which had got the machine booting again. I did try temporarily replacing the other IO chips on the PET, and also using an original 6520 chip, but it was behaving the same.
The problem turned out to not be too far away, the chip below is the 74LS145 BCD decoder, being used here as a 3 to 10 decoder to drive the 10 row lines from three outputs of the 6520.
That was faulty, all the outputs were low, hence the problem reading keys. With that replaced, all was well and the PET was reading the keyboard correctly again. For once, it wasn't a case of just cleaning the keyboard.
I have since made up a new cable from the 18 pin connector to the 20 way header on the board. The header on the board has a polarising pin at pin 19, and an unused (but connected to ground) pin at pin 20. This makes it easier to get it the right way around.
I made this longer than the original, to give me more space on the test bench.
Update:
I have now built some Commodore PET replacement keyboards which can be used to test in situations like this, to see if it is just bad contacts.
They are also useful on a test bench, or can be fitted to a 2001 case as a direct replacement for the chiclet keyboard.