Friday 17 February 2017

VIC20 Repair

The Penultimate Cartridge was launched last year, and between the initial units I sold and all the production units that have been sold by The Future Was 8 Bit, there are quite a lot of them out there.
I'm pleased to say that with all those units that have been sold there have been no returns. We almost had one, here's the story.
A user had just bought a Penultimate Cartridge and reported it was behaving oddly. The menu was appearing, and games could be loaded, the problem came with the RAM, anything over 8K was failing. This is odd, as the design has been proved to be reliable, and all the units are tested before and after being installed in their cases, so we wouldn't expect any failures. The user had done a bit of testing, and was happy to do a few more tests to try to identify the problems.
Time for some quick revision on the VIC20 memory map. The 6502 in the VIC20 has a 64K address space. This is split into 8 blocks of 8K, allocated as follows:

Block
Address Range
Use
0
0000 - 1FFF
Internal 5K RAM + CART RAM1/RAM2/RAM3
1
2000 - 3FFF
Cart BLK1
2
4000 - 5FFF
Cart BLK2
3
6000 - 7FFF
Cart BLK3
4
8000 - 9FFF
Video / IO space
5
A000 - BFFF
Cart BLK5
6
C000 - DFFF
BASIC ROM
7
E000 - FFFF
KERNAL ROM

A cartridge can add ROM or RAM at blocks 1,2,3 and 5, and also 3K of RAM into block 0, as three 1K blocks at RAM1, RAM2 and RAM3 (hence the maximum = 4x8K + 3x1 = 35K). 8K was working, so was 11K, so block 0 and block 1 were OK, but as soon as RAM was added to block 2, it would fail. In order to narrow things down, I asked the user to try a few games. The VIC20 will automatically start a ROM with an appropriate signature when placed in block 5. Most cartridges use an 8K ROM in block 5, and many also have an additional 8K ROM in another block. There isn't a standard here, some use block 1 some block 3. I suggested testing the following games:

Game
Blocks Used
Avenger
5
Centipede
5 + 1
Defender
5 + 3
Adventure Land
2 + 3

Avenger, Centipede and Defender all worked fine, so blocks 1, 3 and 5 were OK. Adventure Land required block 2, and that wasn't working. So again this was pointing to block 2. This exonerates the RAM chip, but points the finger at one of the following:

  1. Something in the cartridge responding incorrectly when block 2 was selected
  2. A bad contact on the edge connector carrying the block 2 signal
  3. Something inside the VIC20 causing an issue with block 2 access

The user had already cleaned the edge connectors, and they looked fine, which seems to rule out option 2, so the cartridge was return to TFW8B for testing. When received, it tested fine, so that rules out 1. The only candidate remaining was a fault in the VIC20. The user wasn't too far from me, so dropped his VIC20 off for further testing.
All looks well inside, nice clean VIC20 CR. This later version of the VIC20 was fairly reliable, it is usually the kernal ROM or VIC chip which goes, coincidentally, the only factory socketed chips on the board.
I tried it out using my prototype Penultimate Cartridge, the LEDs on here show the mode and ROM image selected, and these were showing the right thing, so the cartridge was operating as it should, but was still failing memory tests.
Inside the VIC20, there is a 74LS138 chip which generates eight signals, one for each block of memory, each of which is normally high and is pulled low when that block is selected. Looking along the pins on the oscilloscope, all the pins were high as expected, with blocks 0, 4, 6 and 7 being used in normal operations, and blocks 5 and 3 also pulsing low when the Penultimate Cartridge menu was being used. Block 1 was high as normal. Block 2 was floating low all of the time. Bingo. There's ya problem.
I swapped that chip out and retested and everything now ran fine. Block 1,2 and 3 could be filled with RAM and that all passed memory tests. When that line was floating low, as soon as any ROM or RAM was connected to that pin, it would be enabled all the time, not just when the block was accessed, so would have caused errors throughout the address range, explaining the strange behaviour.
I've run through the Penultimate Cartridge tester a few times, and it has passed. I retested with a different Penultimate Cartridge and several original Cartridges, and finally had the users original Penultimate Cartridge sent up here from TFW8B.
That again passed all the tests. I also tried some large games loaded from SD2IEC, like Pentagorat which needs 32K of RAM and Doom which needs 35K.
All done and ready to return to the user with his original Penultimate Cartridge. That VIC20 might have been like that since new, never a problem until something larger than 8K was added to the cartridge port. I've checked and unfortunately, the warranty from Commodore has run out.

Update: A similar (but less common issue) - http://blog.tynemouthsoftware.co.uk/2022/11/vic-20-repair-the-vic-that-did-not-like-cheese-and-onion.html

2022 Update: The production version of the Penultimate Cartridge is now available from  The Future Was 8 bit