I get a lot of emails asking for help with computer repairs. I do what I can to help where I can.
This one was quite an interesting challenge, so lets go through the process I used to deduce the fault.
The owner had initially contacted me saying they had a PET 2001, and there was no video output, and they wondered if bad ROM or RAM could cause that and would a PET ROM/RAM fix the issue?
On a later PET like a 12" 40xx or 8xxx machine, that could be the case, as the CRTC chip needs to be programmed during the boot sequence. If it does not get far enough in, the chip does not get configured to generate the appropriate video sync frequencies, and so the monitor does not show anything.
However, in the 2001 and other 9" PETs, the video circuitry is all hard wired to 60Hz and the appropriate style sync signals for the 9" monitors.
The video circuitry is pretty much stand alone. You could remove the CPU and you should still get a display of random characters, and that is actually a useful troubleshooting step. In this case then, a PET ROM/RAM board won't help until the video is working.
The owner had probed around and found the correct 15.625KHz / 64us HSync signal was present, but 60Hz / 16.67ms VSync signal was missing.
There are a series of counters and decoding logic which generates the sync signals and clock through the video RAM.
It sounds like there was a problem with the VSync generation part of that, so I suggested they trace back through that and see where it stopped.
After some probing around, they found the 74177 at D6 was at fault, and replacing that give video sync and a screen full or random characters.
Time for a ROM/RAM board. One was order and fitted.
Normally that would cure the issue, but in this case, it did not.
I was sent this photo of the screen.
It is sort of working, you can pick out bits of the correct "COMMODORE BASIC" and "31743 BYTES FREE" and "READY" that you would expect to see, but not in the right place, and surrounded by random characters.
The owner was rightly dubious of the video RAM chips. However, substituting any of the system RAM chips made it worse, and swapping the two video RAM chips around made no difference. Given that I was not sure they were at fault, I was not recommending one of my video RAM replacement boards at this stage.
I started thinking through what the problem would could be.
I am not sure about that being the video RAM. Those patterns of 8 character blocks suggest otherwise, particularly if you still see the same patterns with different RAM chips.
I think it is more likely down to the video address generation circuitry.
The RAM chips can develop similar faults, but it is unlikely both chips would fail identically. Each chip is 4 bits, so to correctly display bits of COMMODORE BASIC in the same (albeit wrong) place, both halves of each characters need to have failed identically.
I have straightened up the picture, you can see good runs of "COMMODORE BASIC" and "31743 BYTES FREE" and "READY" and blank spaces. That would suggest the data path (and quite possibly the RAM) is fine.
It is not WHAT it is reading and writing, it is WHERE.
I think at this point it would be good to have a look at how the PET video RAM is used.
The PET video RAM is memory mapped. There is a 1K block at $8000 in RAM which represents 1000 characters, a 40x25 text display (and 24 free non-visible bytes at the end you could theoretically use for your own purposes).
Each of these 1000 characters can be any of 256 fixed characters (there are no user defined characters).
It is actually only 128 characters followed by inverted versions of the same.
There are two different character sets. The PET 2001 BASIC 1.0 has a different arrangement of the characters set, which makes more sense than the later ones to me. Not sure why they changed.
The first set is uppercase letters and graphic characters.
The second set is uppercase and lowercase letters.
The uppercase characters in this version are in the same place for both sets (which seems logical to me).
On BASIC 2 and BASIC 4 machines, the second set has lowercase and uppercase swapped.
Which makes less sense to me, and also leads to incompatibility if you use BASIC 1 software on a BASIC 2 or later machines, or vice versa, you end up with text displayed in the wrong case.
How it works
In an ideal world, the PET would use dual port RAM, with the 6502 memory mapped $8xxx on one side and the video circuitry on the other.
I have used the naming convention of the PET schematics:
- BA = Buffered Address Bus
- BD = Buffered Data Bus
- SD = Shared Data Bus
- VA = Video Address Bus (not named in the PET schematics)
Dual port 1K RAM chips were not available in the late 1970s when the PET was designed. There were available later on, but have now been discontinued again.
The PET gets around that by having one bank of RAM and switching access between the two sides.
When memory at $8xxx is accessed by the 6502, an address multiplexor is switched to connect the 6502's buffered address bus to the video RAM's shared address bus.
The data buffers connect the video RAM's data bus to the 6502s data bus for read and write operations.
When the 6502 is doing other things, the address mux connects the video RAM shared address bus to the video address bus.
The video circuity only ever reads from the video RAM, and is always connected.
When the 6502 is accessing the video RAM, whatever data it is reading or writing is displayed to the screen, resulting in "snow", more or less depending on how much access there is.
You can get this screen by setting the DIP switches on the ROM/RAM board to 1 and 2 on, 3, 4 and 5 off, that should run a test cycle. You should see a screen full of "G", then a character set, then back to the "G"'s.
The "G" screen should be clean, but there will be snow noise on the character set. If you press and hold the reset button whilst on that screen, the noise will go away until you release the button if you want a better view.
Later model PETs got around this by allowing the video circuitry to read the video RAM during the low part of the clock cycle, when the 6502 was thinking about what it wants to do in the high part of the cycle, and so was not reading or writing from the bus.
Video Circuity Block Diagram
Expanding things a bit, shows more of the implementation.
In video mode, the display starts at the top left of the screen and the video address counters (not shown here) start to count up from $0000 in the video RAM (which corresponds to $8000 in the PET memory map).
The character code of the first character is placed on the shared data bus.
Bit 7 controls if this character is to be inverted. It is latched (twice) and the stored value used to switch the video output between the non-inverted and inverted pixel data from the 74LS165 shift register.
Bits 0-6 forms bits 4-9 of the address fed into the character ROM. Bits 0-2 are from a line counter. Bit 10 is the character set switch.
Each character is 8 pixels wide, and 8 pixels high. The patterns are stored for each of the 8 lines of each character.
The output of the character ROM is fed to the 74LS165 shift register where the character pixels are clocked out at a rate of 8MHz. 8 pixels per microsecond.
1 character per microsecond. 40 characters per row, 40 microseconds of characters for every 64 microsecond line on the display.
And so it continues until all 8 lines of the first row of characters have been drawn. It then goes onto the second row and the line counter is back at 0.
8 lines per character, 25 rows of characters, 200 lines in total, 12.8ms in the middle of the 16.67ms video frame.
I hope you are writing that all down in your copybook.
Which Schematic?
Schematics wise, there are four to choose from for the 2001 PET:
- 320008 has 6550 video RAM and 6540-010 character ROM (the original, and most common)
- 320081 has 6550 video RAM and 2316 character ROM (I have never seen one of these)
- 320123 has 2114 video RAM and 6540-010 character ROM (I have seen a few of these)
- 320137 has 2114 video RAM and 2316 character ROM (I have never seen one of these either)
I have never seen any PET 2001s with either board version that has 2316 ROMs (standard 24 pin mask ROMs found in later Commodore machines). I don't even think I have seen photos.
The fact that all the PET 2001s I have seen have 6540 ROMs could mean a few things. Either they never made many of the 2316 versions, or they made loads and they all still work perfectly, so have never needed to be repaired because they don't have those awful 6540 ROMs in them.
Or they were so bad they all failed in the late seventies and few survived. That is less likely given that all later PETs used that same combination of 2114 video RAM and 2316 character ROMs (apart from the 8296 and CBM-II series which used shared main RAM). The 6540 and 6550 were never seen again, which is a good thing. Nice idea, but they didn't work in practice.
The owner has quite sensibly removed and safely stored away all the system ROM and RAM at the front and fitted a PET ROM/RAM.
That should make the system more reliable, allow it to be upgraded to 32K of RAM and BASIC 4.0.
It will also reduce global warming significantly once the 6540s and 6555s are removed.
Note, I said system ROM and RAM. The 6540 character ROM at the back, and the 6550 video RAM a bit further in can stay if they are working. I have replacements if they are not working, or you want something more long term reliable.
- https://www.tindie.com/products/tynemouth/pet-2001-6550-video-ram-replacement/
- https://www.tindie.com/products/tynemouth/pet-2001-6540-010-character-rom-replacement/
In those positions, the chips are permanently enabled, so even when they fail, the usual failure mode is to be enabled all the time, so everything is OK. You can sometimes use 6550 RAM chips as video RAM even if they fail as main RAM because of the enable arrangements for video RAM.
The 6540-010 replacement also includes a switch on the side to select between the BASIC 1 character set (with the logical placement of uppercase letters) and the BASIC 2 / BASIC 4 versions (with the inexplicably worse later version).
The Full Schematic
The schematics for all four boards are hand drawn, and none of the scans of those are particularly clear, so I have redrawn the relevant sections.
Well, almost full. I have left off the video address counters and the clock logic, but that shows most of the relevant sections.
Diagnosing the Fault
I tidied the image up a bit further to make the text easier to read.
There are several important things to get from that photograph:
- All characters are correctly formed
- Everything is in 8 character blocks
- Some of those contain valid text, but in the wrong place
- Many of them contain random data, indicating they are uninitialised
Looking through that, I can see three possibilities for the video fault in the photograph:
- The 6502 is writing the screen correctly to the video RAM, but the video circuitry is looking in the wrong places when generating the screen.
- The video circuitry is perfectly representing what is in the video RAM, but the 6502 is writing to the wrong places in memory.
- The 6502 is writing to the correct place, and the video RAM is reading from the right place, but somehow the video RAM chips are writing to one place and reading from another
Writing it out like that, I think #3 is not impossible (especially with 6550s), but seems unlikely, so the video RAM is probably not the cause. The characters all being correct also rule out things like the character ROM and the shift register and line counters etc.
One down, two to go
If the video circuitry was not reading from the video RAM correctly, it would all be either the @ symbol ($00) or the chequerboard character ($FF) in those spaces. Random data indicates it is reading RAM correctly, but the RAM has not been initialised. So probably not #1.
When you see parts of the screen still with random characters, that is usually the address mux side of it not letting the 6502 write to those bits.
Therefore I would say #2, the address the 6502 wants to write to is getting messed up, and that would be down to the address mux chips. It seems every time it counts to 8 it jumps somewhere else, which suggests a problem with video address line SA3, which would point to the address mux chips. SA3 is switched by the 74LS157 at position D3 (next to the 6502). That would be my first thought, and if that is bad, I would consider replacing D2 and D4 at the same time as there are also apparently faults with higher address lines as well.
I have seen that sort of thing quite a few times, I found lots of photos of boards where I had replaced one or more 74LS157s.
They seem a common point of failure in machines of these era.
The only one I can find that I have written up was this 8032 board where one of the many faults was down to a mux chip with a similar patters on blocks, runs of 32 characters this time.
Condensed Version
I wrote quite a lot of that in the email response to the owner, with a short preface at the start saying it was most likely the 74LS157s at D2-D4 and they could skip the rest of the email.
They ordered some 74LS157 and replaced D2, D3 and D4 and the PET is now up and running.
Thank you to the owner for the photos of their now working PET 2001.
Including the obligatory shot of invaders, apparently this is a version they modified back in the day to work with the BASIC version 1 this PET originally had. They bought it from someone "upgrading" to an Apple when it was only a year or so old.
One very nice, and very early PET 2001, note the modified domestic cassette recorder and the blue labels.
Oh, OK, that's very early. A serial number with a lot of zeroes and a one at the end?
No reason to doubt it is genuine, looks the same as the one on my PET 2001 (which if anything looks more like a fake as it is much cleaner).
Mine is apparently 8,410 PETs later, with the same slightly bolder number 1 a bit out of place on the left (which Jori on my Patreon found meant 240V).
I enjoy a bit of problem solving like that. I try to help where I can, if I can.
The only time I had to decline recently was when I was in the middle of writing a big long blog post (aren't they all?). I was emailed by someone said they had built a Vicky Twenty (nothing to do with me) and that it didn't work when they plugged in a Final Expansion 3 (also nothing to do with me), although they did note it worked fine with Commodore diagnostics and with a Penultimate Cartridge (oooh, I did that one).
If it had been a Mini VIC and the Penultimate Cartridge, then I would do my best to help.
I wouldn't know where to start with the other things though I am afraid as I don't know either of the products involved, so had to suggest they contract the designers, sellers or community forums.
The only other time I have to decline to help is when people are trying to get a set of 6540 ROM chips to work. I have been doing this an awfully long time, and I have been through it many times. It's just not worth it. It will never last. They will all fail sooner rather than later if you actually use the PET. With the best of intentions, you can go through very expensive used ones from ebay or individual adapters, but you will end up replacing them all, at least once as they just burn out other chips when they fail. A nice idea that didn't work out, and Commodore dropped after the PET and never used again for good reason.
(that is one of the 6540 ROM and 2114 RAM boards I mentioned about 6 foot further up the screen)
Sponsorship
I think I might have arranged some sponsorship for the blog.
Don't worry, it's not VPNs or mattresses or craft kits or mental health or learning or microwave meals or health drinks or free games with heavy in-game purchases or phone networks or earbuds or yet another VPN or anything like that.
It is the PCB manufacturer that I actually use, and have been using for about 8 years I think and that I am happy to recommend.
I kept getting emails from a different PCB company, one I don't use, and it didn't seem right to do accept sponsorship from them, so I contacted my guys and asked if they would sponsor the blog.
I am still sorting out the details, but it seems like it will help, so there is now a logo on the side of the page (under the Patreon and Tindie ones) with my affiliate link, and there will be the occasional mention in a relevant post.
I hope no one will have a problem with that.
Shortly after, I received an email from Patreon suggesting I send my members a Valentine's Day surprise. Not sure if they have read my blog, that's not really on theme.
Anyway, I thought I would have a go and this is what I sent to Patreon a couple of days ago (on the end of a very long Mini PET II development log, so few people will have actually got to the end to see it).
JLCPCBs are Red
JLCPCBs are Blue
Here is my affiliate link
So you can get some too
Tindie
My Tindie store contains all sort of kits, test gear and upgrades for the ZX80, ZX81, Jupiter ACE, and Commodore PET, including the PET ROM/RAM, character ROM and video RAM replacements mentioned above, as well as complete PET replacement boards.
Patreon
You can support me via Patreon, and get access to advance previews of blog posts, and progress updates on new projects like the Mini PET II and Mini VIC and other behind the scenes updates. This also includes access to my Patreon only Discord server for even more regular updates.