Showing posts with label PET LCD. Show all posts
Showing posts with label PET LCD. Show all posts

Sunday, 20 January 2019

Commodore PET 8032 Repair - ROMs, Regulators and Rivets

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

A Commodore PET 8032 board in for repair today. This is an early 8032, the dedicated 80 column board, not the usual universal 40/80 one. This one looks interesting, my favourite, a board that has previously been worked on. It's always fun having to retest all the previous work.
Firstly, the 6502 is missing, the owner had removed it before shipping (?). Several of the ROM chips have been replaced with EPROMs, including one shrouded in mystery covered in tape, and another that looks to have had some pins broken and soldered into some stand off pins.
Above are two original mask ROM chips, but it looks like they are the wrong way around. The original sequence was three BASIC ROMs, 901465-19, 901465-20 and  901465-21. Then the editor (various versions depending on screen, keyboard and language). Finally, the KERNAL, 901465-22.  A bug was discovered in the 901465-19 ROM, so all but the very earliest 8032s come with that chip replaced with 901465-23. So the correct order of chips should be 901465-23, -20, -21, editor, -22, so those two are the wrong way around.
The other noticeable issue is that the two 7805 (or LM340) 5V regulators have been replaced, and instead of the original round metal TO3 packages, they are rectangular TO220 versions.
I'm not too happy with that aesthetically, but also the 0V lines appear to be connected to the frame ground connection on the IEEE-488 port. That is different from the 0V rail, and the 56R resistor connects the two together and that is the path to ground.
When bolted into the case, that will eventually get back to 0V via the metal case connection back to the centre tap on the transformer, but that's not the best place to reference it. For the moment, I shorted out that resistor to tie the 7805 ground pins to the PETs OV rail. There is also a track, which is the 5V output, that appears to have been cut on the back of the board, but is still making contact.
I powered on and all the voltage rails were present and correct, nothing was particularly hot, so I'll leave those for the moment and get on with the rest of the testing. On power on, the board chirped as normal and the screen was initialised and blanked, but nothing happened. That usually indicates a fault with the BASIC ROMs or a partial RAM failure - enough RAM for the KERNAL to get so far, but not enough for BASIC to print up the READY message.
Time to get out the PET Diagnostics board and fit that in place of the 6502. That should generate a display and test the system ROM and RAM, even when there are ROM and RAM faults. (these are now available on my Tindie store)
That also got a beep and the display fired up and was filled with text, but it was clear there were some video problems. It looks like the main RAM is OK, but there is a video fault, and some ROM issues. To get a clearer result, I switched to the PET LCD board with PET diagnostics plugged into that.
That showed the ROM chip in socket D10 (marked 901465-20) was faulty, giving an unknown CRC. and the chip in D9 (marked 901465-23) was the working, but in the wrong socket (it is the B000-BFFF ROM so should be in D10). I swapped those around and went back to a 6502 to see if it would boot, just in case it was somehow a different variant of the 901465-20 ROM. That got no further, still a blank screen.
The ROM sockets on the PET do not conform to the standard 2732 EPROM pinout, but it can take 2532 EPROMs, and I have a few of those. Most modern programmers don't support the 2532, but I keep my Stag P301 programmer around for things like that (as a follow up to that blog post, the Fujitsu NiMH batteries are still going strong).
I printed a label for the new EPROM, and decided to also label up the other EPROMs, since the editor ROM was uncovered and should have something over it's window to prevent it being erased. The one hidden under the tape was also a TMS2532 replacement. The editor is the German DIN version of the editor ROM.
Checking those with PET Diagnostics, there was now a full set of BASIC 4 ROMs. I wanted to get those fixed, in case that was contributing to the display issue, but that is still present.
The tests show errors in bits 4 and 5 of the even video RAM. Time for a process of elimination. The 80 column PETs have the video RAM split into odd and even bytes, as apparently they were not fast enough to keep up if they were used sequentially. This means the video circuitry is split into odd and even halves. The odd video RAM seems to test OK, and every alternate character does appear correct, so that rules out the common elements such as the character ROM and the output shift register.
It is only affecting bits 4 and 5, so that rules out one of the RAM chips (UC4), and one of the 244 buffers (UB4), as they only connect to bits 0,1,2 and 3. That still leaves the other 244 buffer (UB5) that allows bits 4,5,6 and 7 of the even video RAM to be written (and also read) by the CPU. It also leaves the RAM itself (UC5) and the 373 latch (UB3) that stores the output of the selected byte of RAM to feed the character  ROM address lines. To narrow that down, it's time to get the 'scope out and probe the pins.
Probing the even data lines, bits 0,1,2,3 and 6 and 7 were changing, but bits 4 and 5 were doing nothing. That points at the input buffer, as nothing is getting into the circuit. With a replacement 74LS244 at UB5, time to test the theory.
Success, also note the previous 'inconsistent CRC' messages are now missing and the empty sockets are correctly detected as empty. When testing the CRC, all bits should read high, but when something on the bus is misbehaving and writing to the databus when it shouldn't, some different values are read. In this case it seems the LS244 was causing some output on the databus when it wasn't meant to be. The border around the screen is meant to be a solid line, but the DIN PETs have a different character set, so don't have the line drawing characters.
The only thing left to do now was sort out those regulators and the damaged track. I have some of the right kind, but originally they were riveted to the heatsink. I could bolt them in, but let's do this properly. It's been a while since I riveted anything, but I still have a rivet gun somewhere.
These 7805s were particularly thick, so I had to get some longer rivets, to fit through the PCB, the heatsink and the regulator flange.
Not bad, I think I did OK there, seems to be making good mechanical and electrical contact, don't think they are going anywhere.
That's better, how it was meant to look, the original 7812 and the two new 7805s.
On the back, I scraped away a bit of the solder mask and flowed some solder onto the track where the scratch was. The rivets look nice and clean, I'm quite pleased with the way they turned out.
That's all back together, ready for testing. It chirped, and up came the ready prompt. It was a little tricky running test programs as the DIN keyboard layout is slightly different to the normal UK/US business keyboard, so it was a little trial and error on some of the punctuation symbols.
All looking good, loading programs from tape and IEEE-488 port, and running a BASIC memory test program. A bit more soak testing then it's on it's way back to it's owner.

Wednesday, 9 November 2016

PET Diagnostics update

I've been repairing a few Commodore PET boards recently, and have been tweaking the firmware in my PET diagnostics boards to add some new features.
I'll start with an important statement, as this board sometimes gets misunderstood. It is not a 6502 emulator, it does not run 6502 code*.  It plugs into the 6502 sockets and tests the memory and other devices inside the PET.
The first is an 8032 board, slightly unusual in that it is the German DIN version with alternate edit ROM and character ROM. This is not producing any output, so time for the PET diagnostics board.
With that in place, there was output on the monitor. Not quite the right characters, due to the alternate character ROM.
I temporarily swapped in a standard 901447-10 character ROM for the purposes of the later screenshots, but you can see from that there are three unknown ROMs and one with an inconsistent CRC. The unknown ROMs were the Extended BASIC Level 1 and 2, and the DIN edit ROM. I checked those with references ROM images and added them to the database.
It still wasn't booting, and the Kernal ROM was still reporting an inconsistent CRC - the value is calculated by reading the ROM through and this is repeated several times. If the calculated checksum is not the same each time, it's likely the ROM is faulty and so is reported as 'inconsistent CRC'.
With an EPROM installed to replace the ketnal ROM, that test passed. Back to the original 6502 chip and, the PET booted fine. I ran through the usual tests in BASIC and no other problems were found. That one wasn't too bad, just the one EPROM to replace.
Next was another 8032 board. When powered on, this was dead, no video output, no chirp. This time, with the PET diagnostics installed, there was still no display, and rather than a black screen with nothing on it, this was a case of no video signal being generated, so the machines has not booted up far enough to initialise the 6545 CRTC and clear the screen. Lots of things can cause that, bad ROM, bad RAM, faulty 6545, decoding logic, power supplies, reset circuit etc. all sorts of things
When the video circuits aren't working, I have been pairing the PET diagnostics with my PET LCD board, this also plugs into the 6502 socket. It has all the features of the PET ROM/RAM board (replacing onboard ROM or RAM for repair or upgrade), but also mirrors the video RAM and generates a pixel perfect replica of the PET display on a 2.2" TFT display.
When used together you can take a dead PET board and work out what is wrong with it. I plugged the PET diagnostics and PET LCD into the 8032 and powered it up.
This showed everything was broken. Now it is possible that everything was indeed broken, all the RAM was faulty, all the ROMs were faulty, but it is more likely that something is affecting everything else. This could be a ROM or RAM chip or buffer permanently pulling one of the data or address lines high or low so that everything reads wrong. If it was a data bit. that would normally show up in the tests above as a whole column of errors but the rest OK, an address bit can cause problems across the board.
I've added some tests on power up. The address and data lines are read when floating. These values are indeterminate normally, but if a bit is stuck, will be fixed high or low. The next test was to enable the weak pullups on the microcontroller, so all lines should now read as high. Any that don't have something pulling them low, which is a problem. In this case, several lines read as low.
The oscilloscope showed the horror story that was the databus. In normal operation, this should be high (4-5V in general), or low (0-1V in general). Nothing should be in the middle as this is indeterminate high or low. This indicates that several devices are trying to write to the address bus at the same time, which usually means there is something wrong with the address decoding logic.
I temporarily added a bit of code to the PET diagnostics to work as a NOP generator and alternately to pulse the address and data lines. In this case, a bit of probing around showed the 74154 was faulty. It is fed with the top four address lines, and it's 16 outputs should all be high apart from the 8K block selected by the address lines which should be low. In this case, all the lines were low, all the time. This means all the devices were enabled, all the time, explaining why the data bus was so busy.
With a new 74154, everything calmed down and came back to life. The CRTC initialised properly, and I got output on the monitor, but still not 100%. Back to the normal code in the PET diagnostics board.
The edit ROM wasn't giving the right checksum. I replaced that with an EPROM and all then everything passed. I tested the removed ROM externally and it was indeed bad.
The final test before returning to 6502 control was the character ROM. I've expanded the test pattern so it fills the screen on 80 column systems. The character ROM looks OK, and the usual BASIC test programs loaded from PET microSD ran fine. Another PET board repaired, still not too bad this time, just one ROM and a bad 74154.
The next PET board was different story. This time a 2001N board, slightly unusual as this came out of a 2001 case with the chiclet keyboard and built in datasette - I thought they were all the 2001 style 5V only boards not the later dynamic RAM type, so this may have been swapped out at some point in the past, presumably with the power supply replaced as well.
This one is going to need more work. It's video output was dead, which is unusual on these boards without the CRTC as the video circuits will generally work with no CPU, ROM or RAM on the board as they just scrape data from the video RAM and send it to the screen, giving the screen full of random characters you often see.
A couple of chips have been replaced around the video circuits, the 74165 looks like the original chip which has been removed and then socketed? I'm usually suspicious of any previous repair as there is always the potential of damage under the sockets, lifted tracks or missing through hole plating.
Time for the PET LCD, this time with a real 6502, to see if the board is running and test if it's just the video circuits at fault. No, I got a screen full of random characters on the PET LCD, which is what I would have expected on the monitor if the video circuits had been working, What it's actually showing is the contents of the 1K of duplicate video RAM. Nothing has been written to this RAM, hence it's contents is somewhat random, although mainly '@' which is 0x00.
Back to the PET diagnostics again. As well as checking the stuck pins on startup, I am checking the reset line to see if it comes up, and measuring (approximately) how long it takes to come up (around 1 seconds is usual), and checking the NMI and IRQ lines to make sure they are not stuck.
Here the reset and NMI lines are OK, but the IRQ line is stuck low, as is most of the data bus. Again the scope showed a bit of contention on the data lines.
This board is still in progress, as I need to get to the bottom of the video problems, more about that in a later post. The IRQ stuck was due to one of the 6520 / 6522 chips, I removed them all, I will replace them one by one later to find the culprit. The data line problems were due to a bad ROM, again to be identified later.
Now those problem chips were removed, it still wouldn't boot, so back to the tester to check on the RAM and video RAM.
OK, lots of faults here. The video RAM is only showing faults on one bit, which suggests the data bus is probably OK, and one of the 2114 chips is faulty. All the RAM is failing. These are 4108 chips, so that's quite possible they have all failed. These are 8Kx1 versions of the usual 4116 (16Kx1), and and also very susceptible to failing if all the supply rails are not there is the right order all the time. However, the ROMs are not returning empty (since the sockets are empty), but random values, which suggests there are still some address decoding problems to sort out, something is affecting the databus when the ROM addresses are being read, so the same could be affecting the RAM, but apparently not the video RAM? More on this board later I'm sure.
More to come with PET diagnostics and PET LCD as well, as these are proving very useful tools. I have been working on a USB version with serial output, and I'm currently designing a more compact version of the PET LCD.

* that should read 'doesn't run 6502 code yet'. I might add that in future, but probably not.

2024 Update:

The PET Diagnostics modules are available from my SellMyRetro store: