Skip to content

Search Results

Keyword: diagnostic

I have repaired a fair amount of drives, and every time I find myself loading a test or a diagnostic software from disk. This is a bit of a contradiction since the drive being tested, or repaired, might not even be able to load a program. I also have a variety of tools for different purposes and wanted to have everything in one place.

 

This is why i created a 1541 Diagnostic Cartridge.


 

The challenge was to get all these tools to fit into a 8K cart. I wanted to keep the hardware simple and a 16K cart would have overwritten the Basic interpreter.

Therefor I have optimized both code and visual on the tools to keep the size down. Some tools are old, others were written from scratch and a few I rewrote in machine code instead of basic. A couple of the tools are still in Basic, but optimized.

The cartridge is an 8K ROM at $8000-$9FFF

You can also use RESTORE to return to the menu.

You may need to send a “I0:” or turn the drive off/on before running further tests if an previous error has occurred.

 
Alignment
Occasionally I get questions about alignment and aligning the drive. There are some differences of opinion how to align a diskdrive, my personal view, and how I do it, is to use a special analogue disk and a dual trace oscilloscope. The analogue disk is a factory produced disk and has patterns written on specific tracks. An analogue alignment disk can not be duplicated.

1541 Diagnostic Cartridge Alignment Check. This program was distributed with a computer magazine and gives a quick drive alignment health instead of hooking up an oscilloscope. The program was completely disassembled, compacted (code and texts) and disk routines rewritten to share I/O routines just to fit onto the cart with the other tools.

The Alignment check program can (I, however, do not recommend doing it this way) be used to adjust the alignment but it will only be as accurate as the drive, or system, the disk was written with.

The two first columns should be identical, otherwise the alignment is off by a whole track(or more), most often this indicates an incorrectly positioned head stop. The third column indicates how well the drive can read data off each track, its alignment, and should be 100%, or atleast very close to. Fourth column is between tracks (or half tracks), this value can fluctuate a bit even on a well aligned drive. The 1541 allows for some tolerance and therefore some values can be within reasonable limits.

It is very seldom when you actually need to align a drive for proper functionality. If the drive works in daily usage and does not make noise or do continious re-reads or searches it is probably ok. If a drive fails to read disks, begin with cleaning the head and lubricate the rails. If this does not help, the R/W head might be damaged, quite often seen on the Mitsumi D500 mechanism. You can verify it by measuring the R/W head using an ohm-meter. Remember that a slightly misaligned drive is probably able to format and read its own formatted disk.

Most important, if it works, don’t fix it 😉

Recommended reading : Commodore Diskette Diagnostic Manual Version 2 (3140451-01) and Commodore 1541 Troubleshooting & Repair Guide (SAMS)

 

 
Update 2020.09: C64iSTANBUL designed a PCB, You can find it on pcbway 🙂
Update 2019.12: A few words about alignment.
Update 2019.12: TFW8B is selling their version of the cartridge.
Update 2017.09: The Cartridge is also available at the Protovision shop.
Update 2015.12: Upon request from their customers, The Shareware PLUS Commodore 64 & 128 Blog asked me if they could offer the 1541 diagnostic cartridge in their product sortiment.

 

 

1541 Diagnostic PCB by C64iSTANBUL. Looking great, thanks ! 🙂

 

Update
CHECK64 is an updated package for 586220/781220/789010 diagnostics, see Diagnostic Carts and Manuals.
 

This post spawned out of a discussion at a facebook group about the commodore diagnostics reporting errors when using custom kernals. I decided to modify the kernal detection routine to identify good known kernals from a checksum table. Thanks to Jonny Hylander, Fredric QJ Blåholtz and Krister Andersson for ideas and suggestions.

586220+ : Initial version. Disassembly and kernel identification routines by www.worldofjani.com.

586220+ v0.4 : Marty/Radwar sent a huge list of kernal checksums. This version is able to identify a staggering 49 different kernals, for example Professional Dos, RapiDos, DolphinDos and Speeddos. Download the v0.4 sourcecode for a full list.

586220++ v0.5 SX-64 Tape Port check removal : KiWi at www.SX-64.de sent me a version which works correctly on the SX-64. Scroll down for the download and sourcecode. See his page here.

586220++ v0.5 Expanded window for paddle test by Sven Arke. Klick here.

586220* Proper chip number display for SX-64 and C-64 by Ted Saari. Readme.

See Diagnostic Carts and Manuals for information about the harness for this ROM.

2020-06 : giox sent me an updated standalone program which identifies 137 kernals. There is an ID clash (which can be expected at some point) for 901246-01(4064 Kernal) and Armageddon.

 

Sourcecode for diag586220+ and original disassembly of the 586220 diagnostic. Compare these two files to see how the implementation was made.
Diag586220+ v0.4 by Marty / Radwar. It identifies 49 different kernals.
Standalone ROM Checksum program with diag586220+ v0.4 tables
Standalone ROM Checksum program for 137 kernals, thanks to giox for the work!
Diag586220++ v0.5 by KiWi / www.SX-64.de
Diag586220++ v0.5 Paddle Update 08/2017
Diag586220* Proper chip number display for SX-64 and C-64 by Ted Saari 07/2018
Sourcecode for Diag586220*

 


 

Background.

The diagnostic 586220 does a checksum on the kernal ROM to verify if it is ok. It will only identify the original CBM ROMs. All other (even good, for example JiffyDos) kernals will be marked as “BAD”.

The 586220 was used since i have done an reassembly/disassembly of it earlier.

Code to calculate the checksum.

Depending on $FF80(Kernel revision) the checksum is either $E0 or $E1. This determines if Kernal is marked as “OK” or “BAD” by the diagnostic test.

I remembered that the C128 diagnostic cart displays the checksum. When running the C128 diagnostic(789010) the checksum on the C64 Kernal is reported as $D4. After investigating the code, which is identical to the one above except for the fact that only $1F00 of memory is checked, this is probably due to $FF00-$FF04 belong to the MMU.

We shared ideas about how this would be accomplished, but also noticed that some of the different kernals generated the same checksum. This might be deliberate for them to pass a diagnostic test.

 

All code below is compatible with 64tass (i.e. Turbo Assembler compatible).

The new checksum routine. To make a distinction, the address lowbyte is xor:ed and therefor not resulting in an identical checksum.

 

 

…I made a program that can identify the kernal ROM.

 

A table is used for the checksum and a pointer(.word) to the matching ROM name. You can easily add new checksums and ROMs to the code.

 

 


 

Incorporate the checksum with Diagnostic 586220
 
The goal is to replace the original checksum routine with the code above.

As we can see in the disassembly, the routine for ROM tests are at $890E. Further investigations reveal that code between $890E and $8A44 can be replaced. This area also has the routines to check BASIC and CHARACTER ROM.

 

Checksum routine is located a few lines below $8926.

After inserting the code, you can now assemble(compile) the code with c64tass. I won’t go into details about the code itself, but it is presented and downloadable further down on the page.

 

The output file (.o64) can now be written to an eprom. Skip the two first bytes (0x00, 0x80) which is the loadingadress of the file.
 

You can also test the cart in vice by converting it to a crt. Cartconv.exe is included with the Vice emulator.

 

586220-
586220+ diagnostic, it is now possible to identify the kernal ROM.

 

The new checksum code.

Checksums for BASIC and CHAR are also displayed.