Diagnostic Tools for the Vic-20

Modding and Technical Issues

Moderator: Moderators

User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Diagnostic Tools for the Vic-20

Post by nbla000 »

Hi everybody,

Time passes and our beloved Vic-20 begin to age... I had a problem with a my VIC so by searching on the net I've noticed there is a lot of interest on diagnostic tools (software and hardware) but for a reason or for another nothing sodisfied me.

At the end, I've written some Diagnostic tools and modified/hacked others and I think they could be useful for other Vic-20 users too.

Vic Audio/video Test:
Inspired by a German Color Test cart image found on Zimmers, I've "adopted" a bit the screen pattern and written a similar utility with additional audio test that works for unexpanded VICs

Vic Keyboard Test:
This is a program for unexpanded Vic similar to the extended keyboard test of the Diag264 cartridge for C16/Plus4, it displays the Vic-20 Keyboard matrix and you may type all keys to check them:

Vic-20 Diagnostic Tool:
I hacked the NTSC version to work on PAL machines too (unique version for both PAL and NTSC).
This version also works without harness adapters (marking the external port tests as "BAD" of course) but without interrupting the test cycle so at least all the other tests (RAM/audio/video/etc) work in loop without problems, more technical information on Zimmers.

Vic-20 Dead-Test:
Starting from this Git project derived from this other, I've released a 1.0B version that executes all tests in loop and proper work in RAM for NTSC machines, the 8k version includes my keyboard and Audio/Video tests too.
Please note that if the VIC as some problems it can only starts from a cartridge, this because it does not use any kernal call.

Download here:
Attachments
VIC-AudioVideoTest.zip
(860 Bytes) Downloaded 166 times
VIC-AudioVideoTest.png
VIC-KeyboardTest.zip
(672 Bytes) Downloaded 127 times
VIC-KeyboardTest.png
VIC-20 Diagnostic-a000-pal-ntsc-mod.zip
(2.55 KiB) Downloaded 170 times
VIC-20 Diagnostic-a000-pal-ntsc-mod.png
VIC-20 Dead-Test-1.0b-pal-ntsc-a000-4k.zip
(2.86 KiB) Downloaded 160 times
VIC-20 Dead-Test-1.0b-pal-ntsc-a000-4k.png
VIC-20 Dead-Test-1.0b-pal-ntsc-a000-8k.zip
(4.05 KiB) Downloaded 157 times
VIC-20 Dead-Test-1.0b-pal-ntsc-a000-8k.png
Mega-Cart: the cartridge you plug in once and for all.
User avatar
beamrider
Vic 20 Scientist
Posts: 1452
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Diagnostic Tools for the Vic-20

Post by beamrider »

Cool. I have some Vics awaiting repair, so these will come in handy.
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Re: Diagnostic Tools for the Vic-20

Post by nbla000 »

I'm happy that could be useful for you.

I will include these tools also on the new Mega-Cart external SD menu that I'm releasing.

It will be a sort of extension/addon for any Mega-Cart revision + SD2IEC drive.
Mega-Cart: the cartridge you plug in once and for all.
User avatar
orion70
VICtalian
Posts: 4341
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Re: Diagnostic Tools for the Vic-20

Post by orion70 »

Excellent! I was wondering how to use the dead test on a dead VIC in fact... Slapping it on the Mega Cart start menu will be great. Otherwise, a dedicated Jolly Cart (Mces) would come handy.
User avatar
srowe
Vic 20 Scientist
Posts: 1340
Joined: Mon Jun 16, 2014 3:19 pm

Re: Diagnostic Tools for the Vic-20

Post by srowe »

orion70 wrote: Sat Mar 26, 2022 1:17 am Excellent! I was wondering how to use the dead test on a dead VIC in fact... Slapping it on the Mega Cart start menu will be great. Otherwise, a dedicated Jolly Cart (Mces) would come handy.
I was planning to make my dead test support being an EPROM inserted as a replacement for the KERNAL ROM. That way it is usable even when the system is unable to boot to an external cart. Running an image in BLK5 requires a (short) bit of code in the KERNAL, if it's defective you can't start anything attached to the cartridge port.
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: Diagnostic Tools for the Vic-20

Post by chysn »

Thank you for this! I've made a couple carts for future repair work. My VIC-20 in current rotation is getting stuck on the diagnostic program, which I'll have to look into.
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5

WIP: MIDIcast BASIC extension

he/him/his
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Re: Diagnostic Tools for the Vic-20

Post by nbla000 »

srowe wrote: Sat Mar 26, 2022 2:38 am I was planning to make my dead test support being an EPROM inserted as a replacement for the KERNAL ROM. That way it is usable even when the system is unable to boot to an external cart. Running an image in BLK5 requires a (short) bit of code in the KERNAL, if it's defective you can't start anything attached to the cartridge port.
Yes this is correct, on power on/reset the 6502 processor use the vectors on $FFFC ($22 $FD) to execute code from $FD22 so at least bytes on $FFFC/$FFFD and on $FD22-$FD2E should be consistent otherwise the BLK5 code will not be executed.

Code: Select all

fd22  A2 FF       LDX #$FF
fd24  78          SEI
fd25  9A          TXS
fd26  D8          CLD
fd27  20 3F FD    JSR $FD3F
fd2a  D0 03       BNE $FD2F
fd2c  6C 00 A0    JMP ($A000) <-- start cart code on BLK5
Your solution bypass this problem but requires a "socketed" kernel or you have to unsolder it however you may have no other choise in some cases.

I've just updated, Mega-Cart firmware with DeadTest and Diagnostic tool.

Diagnostic tool autostarts (no mega-cart menu) if there is the keyboard harness inserted and as you can see it works also without harness.
Attachments
DeadTest.jpg
Diagnostic-mc-no-harness.jpg
Diagnostic-mc-no-keyboard.jpg
Diagnostic-mc-keyboard.jpg
Mega-Cart: the cartridge you plug in once and for all.
User avatar
beamrider
Vic 20 Scientist
Posts: 1452
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Diagnostic Tools for the Vic-20

Post by beamrider »

I didn't realise that the Mega-Cart firmware was updatable?
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Re: Diagnostic Tools for the Vic-20

Post by nbla000 »

beamrider wrote: Mon Mar 28, 2022 5:34 am I didn't realise that the Mega-Cart firmware was updatable?
No it's not actually, this is my prototype board, I'm testing the new firmware revision 22 which will be used for the next Mega-Cart shipped by 6502dude but I'm working also on a new external menu for older Mega-Cart revisions that allow to execute all new stuff from a SD2IEC device.
Mega-Cart: the cartridge you plug in once and for all.
User avatar
MCes
Vic 20 Afficionado
Posts: 458
Joined: Fri Jul 24, 2015 1:19 am
Location: Italy

Re: Diagnostic Tools for the Vic-20

Post by MCes »

Very interesting!

C16 and PLUS4 have the Kernal rom always on socket so the "DIAG264" was created
(an alternative ROM kernal that test the computer: diagnostic for '264 machines).
Unfortunately in the VIC20 the rom of the kernal is very often soldered, so the "DIAG20" kernal rom has less sense...


Unfortunately before the JMP(A000) the RESET routine ($FD22 ) run a subroutine: JSR $FD3F and this is a terrible point!
If the ram pg1 is damaged the cpu STACK is pushed with the right "JSR"+1 program counter, but at the end the "RTS" doesn't load the P.C. with the correct value:VIC20 crash BEFORE launching the diagnostic cartridge without helping the repair.... (it happened to me!)

With aCPLD is possible to make a "vegetative" test cartridge that can contain some leds:
(facoltative: Vcc too low, Vcc too high, ripple on Vcc), clock present, RESET pulse valid, Data Bus correctly floating, RESET vector correcly read from kernal ROM, "RTS" (return of JSR $FD3F) correcly done.

1,2,3) The facoltative LEDs are analogical TESTs
4 ) presence of master clock oscillation
5 ) RESET pulse valid:sometimes the RESET pulse generator has the electrolytic capacitor or a 7406 gate damaged
6 ) When clock is LOW the DATA BUS has to be in high impedance, otherwise a IC is blowed (BUS buffer, CPU....)
7 ) If the kernal ROM feed the "$FD22" words at startup is a good scenario! (Kernal ROM is correctly enabled and it feed correctly the DATA BUS)
8 ) If the first "RTS" is executed correctly (2 bytes of pg1 RAM =OK) the code passing to the external cartridge should work (a standard diagnostic cartridge could be started ...)

This LEDs can explain a lot of a machine that doesn't power on with a diagnostic cart also!
"Two things are infinite, the universe and human stupidity, and I am not yet completely sure about the universe." (Albert Einstein)
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Re: Diagnostic Tools for the Vic-20

Post by nbla000 »

MCes wrote: Mon Mar 28, 2022 9:55 am Unfortunately before the JMP(A000) the RESET routine ($FD22 ) run a subroutine: JSR $FD3F and this is a terrible point!
yes right, in effect this is a problem, a faulty page 1 RAM may prevent to run any cartridge even if both DeadTest and Diagnostic do not use JSR call in the early stage but the kernel before does...

A solution could be the kernal replacement as srowe said but you have to unsolder the kernal chip in most cases...

This LEDs can explain a lot of a machine that doesn't power on with a diagnostic cart also!
Very Interesting info... but this hardware riquires someone is able to program a CPLD, unfortunately I'm not :roll:
Mega-Cart: the cartridge you plug in once and for all.
User avatar
MCes
Vic 20 Afficionado
Posts: 458
Joined: Fri Jul 24, 2015 1:19 am
Location: Italy

Re: Diagnostic Tools for the Vic-20

Post by MCes »

nbla000 wrote: Mon Mar 28, 2022 10:35 am Very Interesting info... but this hardware riquires someone is able to program a CPLD, unfortunately I'm not :roll:
Fortunately I can... :lol: :P

Another project into the "have to do" list... :wink:
"Two things are infinite, the universe and human stupidity, and I am not yet completely sure about the universe." (Albert Einstein)
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Re: Diagnostic Tools for the Vic-20

Post by nbla000 »

orion70 wrote: Sat Mar 26, 2022 1:17 am Excellent! I was wondering how to use the dead test on a dead VIC in fact... Slapping it on the Mega Cart start menu will be great.
I thought on this too, in effect as well as from the maintenance menu you can start the Diagnostic Tool and the Dead-Test also with a key combination on boot and if you use the harness for the keyboard, the Diagnostic Tool is automatically started.

The only requirement to start them from Mega-Cart is a kernal even corrupted but capable to start a cartridge and as MCes noted a working RAM page 1 ($01FE and $01FF locations to be precise), like any other cartridge.

However Mega-Cart requires a working VIA2 chip for Keyboard scan on boot, in case, VIA1 and VIA2 can be swapped if not soldered.

Considering that the main focus of Mega-Cart is to play all know cart games for the Vic-20, is not a bad addition :wink:

Otherwise, a dedicated Jolly Cart (Mces) would come handy.
Yes like any Diagnostic tool with harness already sold on the web but I think that the best solution for a "dead" Vic-20 is the CPLD suggested by MCes.
Mega-Cart: the cartridge you plug in once and for all.
User avatar
MCes
Vic 20 Afficionado
Posts: 458
Joined: Fri Jul 24, 2015 1:19 am
Location: Italy

Re: Diagnostic Tools for the Vic-20

Post by MCes »

Now I'm thinking about a test set composed by the classic test-cables and a new diagnostic card.
This new diagnostic board integrates 3 tools:
1) classic DEAD TEST program (the version improved by nbla000) to test quickly without opening the VIC20 case
2) classic DIAGNOSTIC program (the version improved by nbla000) to test the VIC20 thoroughly (test-cables are required for full testings)
3) an hardware LOGIC STATES ANALYZER on board useful for a VIC20 that does not boot up(not even with DEAD TEST).

This "diagnostic set" will be the most complete and powerful I've ever seen!

This project is in the feasibility study.

The LOGIC ANALYZER is made with a CPLD that observe the BUS activities, a 7-segment LED display will indicate the first observed fault:
-Abnormal levels of /RST /IRQ /NMI lines
-The clock presence
-The right floating states of the DATA BUS
-The ability of the CPU to drive well the R/W line
-The ability of the CPU to fetch the reset vector
-The ability of the system to decode the kernel ROM
-STACK error (LOW NIBBLE or HIGH NIBBLE detection)
- detection of the correct automatic start of the cart
(if no problems are found at this point, the diagnostic software on the cart should start for more thorough testing)

Could it be of interest to anyone other than me?
Last edited by MCes on Wed May 04, 2022 11:30 am, edited 5 times in total.
"Two things are infinite, the universe and human stupidity, and I am not yet completely sure about the universe." (Albert Einstein)
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Re: Diagnostic Tools for the Vic-20

Post by nbla000 »

MCes wrote: Wed May 04, 2022 7:36 am Now I'm thinking about a test set composed by the classic test-cables and a new diagnostic card.
This new diagnostic board integrates 3 tools:
1) old DEAD TEST program to test quickly without opening the VIC20 case
2) old DIAGNOSTIC program to test the VIC20 thoroughly (test-cables are required)
3) an hardware LOGIC STATES ANALYZER on board useful for a VIC20 that does not boot up(not even with DEAD TEST).
I think it's a good add-on tool for our old Vic-20s...

Why the old PAL & NTSC distinct Diagnostic tool version and not my pal/ntsc cable free hacked version of Diagnostic Tool? and why not my new DeadTest version with additional Keyboard and Video/Audio tests too?
Could it be of interest to anyone other than me?
I'm interested too :wink:
Mega-Cart: the cartridge you plug in once and for all.
Post Reply