• Please review our updated Terms and Rules here

PET got seriously ill...

You were absolutely right -- after recharging its battery, the meter now shows reasonable DC values which also don't change over time:

TP5: 5.0 V
TP6: 11.6 V
TP10: -5.1 V
TP6 is a bit low. Probably not bad enough to cause trouble, but I'm not sure what the tolerances are on these machines. How about the other +5V? There's no test point, but its the output of VR3.

Meanwhile I wonder if it might be worth digging further into the state of the PIA and VIA chips. On the one hand, I might try to figure out if their pins exhibit sensible readings using the logic probe. (The difficulty, however, will be to figure out which readings would be sensible -- information about the PET's inner workings is scattered so much more sparsely over the Web as about, say, the C64's!) On the other hand I might "sacrifice" one of my working 1541 drives and just see if swapping a known-to-be-ok VIA into the PET might help.
Is the VIA socketed in the 1541? If so it's worth a try - you might just strike it lucky. If not, I'd personally not start dismantling stuff yet. I'd start with the CPU itself - try to figure out what's sensible there, then work outwards. For example, you reported a lack of interrupts before, which could definitely cause this kind of problem. Using the schematics and logic probe, you may be able to work out which part(s) is/are causing that. You won't be able to verify everything without the scope, but a logic probe can still get you a long way.
 
Cosam,

TP6 is a bit low. Probably not bad enough to cause trouble, but I'm not sure what the tolerances are on these machines. How about the other +5V? There's no test point, but its the output of VR3.

still haven't had time to check this out -- it is amazing how time flies if there are two little creatures in your household which are in constant need for food, fresh dipers, and entertainment...


Is the VIA socketed in the 1541? If so it's worth a try - you might just strike it lucky. If not, I'd personally not start dismantling stuff yet. I'd start with the CPU itself - try to figure out what's sensible there, then work outwards. For example, you reported a lack of interrupts before, which could definitely cause this kind of problem. Using the schematics and logic probe, you may be able to work out which part(s) is/are causing that. You won't be able to verify everything without the scope, but a logic probe can still get you a long way.

Yes, at least in one of the drives there is a socketed VIA -- otherwise I would also be reluctant to heat up the soldering iron... As for the missing IRQ signal, this *might* be the result of a broken IO chip. However, if I'm not mistaken, those chips (including the IRQ timer) need to be programmed by the CPU in order to function -- and if the corresponding block of boot code doesn't get executed due to some other defect, there'll hardly be any IRQ. So I guess I'll really try to learn more about the interplay between the CIAs, the VIA and the CPU in order to figure out what to expect when probing their pins.

Fortunately there's no deadline associated with my PET's (hopeful) revival... ;-)

All the best --

track18
 
Hi everyone,

here's the result of the research I managed to do regarding my PET over the last week:


Power supply
============

TP6 is a bit low. Probably not bad enough to cause trouble, but I'm not sure what the tolerances are on these machines. How about the other +5V? There's no test point, but its the output of VR3.

VR3 yields some nice 5.1 V -- so everything ok here, at least for the DC part. Though I got my scope a couple of days ago, I wasn't able yet to check for any AC rippling on the DC since the scope came without a probe head. I ordered one and it should arrive anytime soon.


IRQ
===

Seems in the PET the IRQ signal doesn't get generated by an IO chip timer (like the CIAs' in the C64), but by the video circuitry. Normally, the VIDEO ON signal gets fed into PIA1 via CB1 and triggers its IRQA and/or IRQB output to emmit an L pulse. For my PET, my logic probe told me that the VIDEO ON line does do something, but there's no pulses on the IRQA/IRQB pins -- in correspondence with the observation that there are no IRQs detectable at the processor's IRQ input.

Another thing that seems odd to me is that all the PIA1's port B pins remain H no matter which keys I press -- despite the 74145 BCD-to-decimal decoder UC9 dragging its pin 1 (= 0) line down to L (in accordance to the PIA1's PA0 - PA3 output after reset). If the PET's keyboard scanning routine works somehow similar to the C64's, I'd expect this L signal to be passed on to one of the PB input lines when a key is pressed. However, since all PB pins remain H, I suspect that this port is set to output, rather than input mode.

All in all I conclude that PIA1's initialisation routine gets only partiall executed, and only after hitting the reset button (after a cold start, PA0 - PA3 are all H).


Other IO chips
==============

Have only briefly had a look at their pinouts and what to expect there, but everything looked reasonable at a first glance.


ROMs
====

It seems that after a reset only code located in the $E000 and $F000 ROMs gets executed -- the CS1 lines of $C000 and $D000 never get L. Can be confirmed when looking at the 74154 4-line to 16-line decoder/demultiplexer.

This finding concides well with the observed screen blanking after reset ($E246), but the missing start message. Scanning the VICE PET ROM image suggests that the ### COMMODORE BASIC ### string is located at $E1C4 and its printout initiated at $E196. The actual STROUT routine does, however, live at $CA1C -- in one of those ROMs which apparently never get accessed. (There is no commented disassembly available for BASIC V2.0 PETs, is there? I only found original PET and 8000 series ROMs disassemblies.)

I keep wondering whether it is normal for those ROMs to get so hot. Could anyone who owns a working PET perhaps have a look at their machine and verify/falsify this? Would be great, thanks in advance...


Things getting worse
====================

- More and more often, and in particular after machine has been switched on for a while, the reset button doesn't have any effect -- the PET seems to get stuck in the same state as immediately after power-on. In particular, the screen doesn't get blanked and the CPU stopped doing something (according to SYN, address and data bus pin).

- The (still garbled) screen starts to flicker, mainly horizontally.


What to do next?
================

- Check power supply for AC ripples once the oscilloscope probe head arrives.

- So far I haven't swapped CPU and VIA with working ones from a 1541. I would test the ICs' functions by checking whether the 1541 still works after the swap -- this procedure should protect the 1541's chips from any potentially harmful conditions that might exist in the broken PET.

- Together with the probe head I ordered a breadboard. It should be possible to readout arbitrary addresses from the ROM chips by plugging it into the board and manually applying the corresponding L/H values to the address pins, shouldn't it? Anything else to take into consideration (apart from protection against static electricity)?

- Check more detailed what's going on around PIA2 and VIA

- Learn more about what actually happens (or at least: should happen) after powering on a PET.

- Any further ideas welcome...


Best regards --
 
I've found one of these indispensable when working on PETs, Apples, AIM65s and other 6502 boards. If you've got a scope all you need is a 40 pin IC socket; I'd avoid a wirewrap socket because they tend to stretch and loosen the socket. It goes between the CPU and the CPU socket and is wired to generate NOPs, which exercises all address locations; you'll quickly see any problems with address decoding, stuck lines and it can even help find data line problems.

http://www.ctalkobt.net/files/6502-NOP-test_0.pdf

Good luck!
 
Hi everyone,

here's the result of the research I managed to do regarding my PET over the last week:

(<snip> ..extremely detailed findings....)

I find it disturbing that I actually understand some of this now! Only some mind you, and not enough to be any help :)

I keep wondering whether it is normal for those ROMs to get so hot. Could anyone who owns a working PET perhaps have a look at their machine and verify/falsify this? Would be great, thanks in advance...

Mine get quite hot. Not hot enough to take your fingerprints off though, like a shorted RAM chip.

Keep at it. You obviously know what you're doing and I would say it's probably just a matter of time before you find the fault. Hopefully there is only one.

Tez
 
Tez,

I find it disturbing that I actually understand some of this now! Only some mind you, and not enough to be any help :)

I thought I knew what 'disturbing' means, but maybe as a non-native speaker I am missing a subtle undertone? I usually find it the opposite of disturbing if I understand something (except, of course, when understanding something disturbing ;-) )

Code:
dis·turb  (d-stûrb)
tr.v. dis·turbed, dis·turb·ing, dis·turbs
1. To break up or destroy the tranquillity or settled state of
2. To trouble emotionally or mentally; upset.
3.
  a. To interfere with; interrupt.
  b. To intrude on; inconvenience.
4. To put out of order; disarrange.


Mine get quite hot. Not hot enough to take your fingerprints off though, like a shorted RAM chip.

Thanks a lot for almost burning your fingertips for me! Seems my ROMs don't get hotter than yours, so I'll re-insert the ROM business further towards the queue's tail.

Keep at it. You obviously know what you're doing and I would say it's probably just a matter of time before you find the fault. Hopefully there is only one.

Oh, thanks for your trust in my expertise... In fact, I find digital electronics not so hard to understand (it basically boils down to truth tables), but as soon as something as simple as a capacitor comes into play, I'm quite lost...

All the best --
 
Tez,



I thought I knew what 'disturbing' means, but maybe as a non-native speaker I am missing a subtle undertone? I usually find it the opposite of disturbing if I understand something (except, of course, when understanding something disturbing ;-) )

Code:
dis·turb  (d-stûrb)
tr.v. dis·turbed, dis·turb·ing, dis·turbs
1. To break up or destroy the tranquillity or settled state of
2. To trouble emotionally or mentally; upset.
3.
  a. To interfere with; interrupt.
  b. To intrude on; inconvenience.
4. To put out of order; disarrange.

Definition #2 works for tez, with a shading of #1. He's so smart he scares himself...

--T
 
Tez,
I thought I knew what 'disturbing' means, but maybe as a non-native speaker I am missing a subtle undertone? I usually find it the opposite of disturbing if I understand something (except, of course, when understanding something disturbing ;-) )

Yea, sorry. It was a subtle undertone, and a mild attempt at humour. It's unsettling to suddenly understand something which in the past you felt you had no chance of understanding.

Oh, thanks for your trust in my expertise... In fact, I find digital electronics not so hard to understand (it basically boils down to truth tables), but as soon as something as simple as a capacitor comes into play, I'm quite lost...

Me too! My last two repairs have both involved faulty capacitors that on the outside appeared completely undamaged!

Tez
 
Hi there,

I finally got the probe for my scope and even found some time to do some measurements... So here's what I found:

Power Supply
============

With the scope, the voltage regulators' output look like perfect flat lines -- "smooth as an android's butt", one might say ;-)

Clock Signal
============

The signal entering the CPU at Phi0 looks like shown on the attached 'phi-in.jpg' image:

attachment.php


Not exactly a perfect square wave, but I guess those transient oscillations after each level change should well be within tolerance, shouldn't they?

The signals emitted by Phi1 and Phi2, however, looks a bit funny (sensu "strange") to my eyes. Phi1 is shown in the 'phi-out.jpg' file:

attachment.php


Phi2 looks virtually identical (should be phase-shiftet, though; however, lacking a second probe, I cannot confirm this on the scope). Does anyone know if the signal is supposed to feature this "kitchen-knive's blade" shape?

Boot Sequence
=============

Image 'rw.jpg' shows, at a larger time scale, the output of the CPU's R/W line:

attachment.php


Apparently, the CPU goes through the same cycle of operations over and over again; this is confirmed by the signals detectable at the address and data lines, which also exhibit a similar periodicity at the same time scale.

I can well imagine the CPU getting stuck in such an infinite loop while in vain trying to initialise some hardware component -- writing to some of its registers (when R/W goes L) and waiting for some readout to yield a certain value. I guess knowing what exactly the CPU is attempting to achieve here might help identifying the faulty component. To this end, I have the following idea, comments about which I'd greatly appreciate:

I understand the 6502 CPU only executes commands as long as its READY input is H. So dragging this pin to L should halt the CPU, right? IIRC, I read somewhere that MOS Technologies boasted that their 6502 would *always* display something meaningful on its address/data bus. So while halted, it should be possible to read out the CPU's address and data bus using the scope or the logic probe. When repeating this procedure several times, at least some of the readouts should point to the I/O address of the hardware component in question and/or the locations within the ROM where the repeatedly executed commands reside.

In order to be able to explicitly apply an L or H level to READY, I plan to just use a 40-pin socket with its pin no 2 removed. Placing this socket between the CPU and its original socket, I should be able to apply L/H to READY at will, using GND and +5 V taken from somewhere on the motherboard.

So what do you think? Does this sound reasonable, or did I miss something critical? (With a little luck, I'll be able to drop in at our local electronics store tomorrow to buy two 40 pin sockets -- one for the described procedure, and one for the NOP testing device recently suggested by MikeS.)

My last two repairs have both involved faulty capacitors that on the outside appeared completely undamaged

Uh, sounds nasty... Is there some sort of standard procedure recommended for identifying those little beasts?

All the best --
 

Attachments

  • phi-in.jpg
    phi-in.jpg
    25 KB · Views: 1
  • phi-out.jpg
    phi-out.jpg
    24.9 KB · Views: 1
  • rw.jpg
    rw.jpg
    22.2 KB · Views: 1
Apparently, the CPU goes through the same cycle of operations over and over again; this is confirmed by the signals detectable at the address and data lines, which also exhibit a similar periodicity at the same time scale.
I'd have thought this would be true even on a fully functional machine if it's sitting idle. Would indeed be good to know where it's looping.

In order to be able to explicitly apply an L or H level to READY, I plan to just use a 40-pin socket with its pin no 2 removed. Placing this socket between the CPU and its original socket, I should be able to apply L/H to READY at will, using GND and +5 V taken from somewhere on the motherboard.
You should be able to get away with a simple wire attached to pin 2. If READY is usually high, just touching the wire to ground will pull it low. Remove the connection to ground and whatever was pulling it up before should do the same again.

Unless you get a definitive answer in the mean time, or someone beats me to it (I'm not home right now) I'll take some measurements tonight and compare them to your photos.
 
Just for starters, that PHY-IN photo sure doesn't look good to me. If the scale on the scope is 0 - +5 then the overshoot going negative (to zero) looks very bad to me. I remember something about +0.8 as being the TOP of a zero value. Those oscillations start out greater than a 0,8 range. So, pin is going from a good zero into "undefined" land and back to zero, etc. I have seen "normal" square waves. You get a little spike of overshoot on the leading edge, nothing like your picture, and the start of the negative going leg tends to be rounded off, so voltage starts dropping more slowly then drops like a rock. However, I have never seen one where the middle of the square wave has cute little slowly decresing amplitude waves on it.
 
Cosam,

I'd have thought this would be true even on a fully functional machine if it's sitting idle. Would indeed be good to know where it's looping.

you're, of course, right -- however, I would expect the idle loop to be entered *after* the BASIC promt has been output (which obiviously doesn't happen on my machine). Furthermore, in VICE the CBM3032 seems to loop through

Code:
.C:e29d   A5 9E      LDA $9E
.C:e29f   85 A7      STA $A7
.C:e2a1   F0 FA      BEQ $E29D

when idle, which seems significantly shorter than the loop I observed with the scope. For instance, in the above code, there seems only one write operation involved. (As far as I understand, the loop only fetches the number of chars currently stored in the keyboard buffer from $9E and stores it in the 'disable cursor blinking' flag at $A7. This is repeated until there are characters waiting for being processed.)

You should be able to get away with a simple wire attached to pin 2. If READY is usually high, just touching the wire to ground will pull it low. Remove the connection to ground and whatever was pulling it up before should do the same again.

Usually I am a little bit reluctant directly connecting something H to ground without a resistor limiting the current. However, I just had a look at the schematics, and -- tataa! -- READY is connected to +5 V via R14! :)

Unless you get a definitive answer in the mean time, or someone beats me to it (I'm not home right now) I'll take some measurements tonight and compare them to your photos.

I'll see if I do find the time to check out the READY thing tonight. Thanks for offering to do some measurements on your machine if my loop analysis doesn't come up with something useful!

Regards --
 
Well, my Phi-in and out both look just like yours. R/W looks different (I only get the first longer dip in the series, not the following three shorter ones) but that would be logical if you're in a different part of the ROM.

Let us know if you manage to read an address off the halted CPU.
 
Hi there,

Well, my Phi-in and out both look just like yours.R/W looks different (I only get the first longer dip in the series, not the following three shorter ones) but that would be logical if you're in a different part of the ROM.

Let us know if you manage to read an address off the halted CPU.

sorry, didn't manage to check out *anything* yesterday... Many thanks for comparing your PET signals with my findings -- although I already had begun hoping that those oscillations superimposed on the L phases (which, as chuckcmagee pointed out in

Just for starters, that PHY-IN photo sure doesn't look good to me. If the scale on the scope is 0 - +5 then the overshoot going negative (to zero) looks very bad to me. I remember something about +0.8 as being the TOP of a zero value. Those oscillations start out greater than a 0,8 range. So, pin is going from a good zero into "undefined" land and back to zero, etc. I have seen "normal" square waves. You get a little spike of overshoot on the leading edge, nothing like your picture, and the start of the negative going leg tends to be rounded off, so voltage starts dropping more slowly then drops like a rock. However, I have never seen one where the middle of the square wave has cute little slowly decresing amplitude waves on it.

and depicted in

attachment.php


occasionally really enter nowhere land) were the cause of the trouble... That would, at least, have been a hint where to search next.

As for your single dip in the R/W signal, this fits nicely to the STA operation in a healthy PET's idle loop.

I'll try to read out some addresses ASAP -- no idea when that might be...

Regards --
 

Attachments

  • phi-in-ranges.jpg
    phi-in-ranges.jpg
    14.2 KB · Views: 1
Last edited:
Can't help ya with your problem, but those traces look suspiciously like a mis-adjusted probe (or low-bandwidth scope); are you using a high-impedance (x10) probe and is it properly compensated?
 
Hi everyone,

finally some pieces fell into place... Here's what I found over the last few days:


Clock Signal
============

Can't help ya with your problem, but those traces look suspiciously like a mis-adjusted probe (or low-bandwidth scope); are you using a high-impedance (x10) probe and is it properly compensated?

The photos I posted do indeed show measurements done with the probe set to 1x, but repeating the tests with the x10 setting (after proper compensation, of course ;-) ) gives very similar results, i.e. again with damped oscillations riding on the pulses.


CPU and VIA Replacement
=======================

I dared swapping the PET's CPU and VIA with their counterparts from a working 1541 disk drive (one at a time). The drive was still working with either of the PET chips, and the PET was still misbehaving with the drive's ICs. I take this as an evidence that the PET's CPU and VIA are, in principle, ok.


Halting the CPU
===============

I used GND (from the internal cassette port) to drag the CPU's READY line to L (accessed at pin 23 of J4), as discussed in previous postings. Most of the time I found $FFFF on the address bus, sometimes something weird like $90FF or $AAFF, and frequently something in the $E6xx range, in particular $E61E, $E620, $E621, $E624... and sometimes $E6FF. Apart from the latter, these addresses lay within the IRQ handler, which starts at $E61B and looks like

Code:
.C:e61b   48         PHA         ; save A, X and Y on stack
.C:e61c   8A         TXA
.C:e61d   48         PHA
.C:e61e   98         TYA
.C:e61f   48         PHA
.C:e620   BA         TSX         ; get stack pointer
.C:e621   BD 04 01   LDA $0104,X ; get status register from stack
.C:e624   29 10      AND #$10    ; check for break flag
.C:e626   F0 03      BEQ $E62B   ; no break: skip next instruction
.C:e628   6C 92 00   JMP ($0092) ;   handle BRK
.C:e62b   6C 90 00   JMP ($0090) ; handle hardware interrupt

$90/$91 contains the hardware IRQ vector ($E62E), while $92/$93 points to the BRK handler, which resides at $FD17. I'll come back to this later.

One thing, however, that disturbs me (sensu definition #2 ;-) ) is that the CPU didn't resume its work after releasing READY from GND -- only a reset could persuade it do something again.


ROM Test
========

As announced earlier, I plugged the ROM chips into my breadboard, wired them to provide power and appropriate chip select signals (as shown below)

attachment.php



and manually applied various values to their address lines in order to read out the contents of the corresponding memory locations. Here are images of me reading out bits 5 (L) and 6 (H) of address $C000 (which contains $40):

attachment.php

attachment.php


For each ROM, I sampled at least the addresses $x000, $x001, $x002, $x003, $x004, $x008, $x010, $x020, $x040, $x080, $x100, $x200, $x400, and $x800 and compared the readouts with the VICE ROM images.

The $C000, $D000 and $E000 ROMs turned out fine -- but when reading out the first few bytes of the $F000 ROM I only got zeros -- where I should actually find some PETSCII-coded error messages! I continued taking some more samples than for the other ROMs, and a pattern seemed to emerge (values in brackets indicate the contents of the corresponding VICE ROM image address):

Code:
$F000: 00 (54)
$F001: 00 (4f)
$F002: 00 (4f)
$F003: 00 (20)
$F004: 00 (4d)
$F005: 00 (41)
$F006: 00 (4e)
$F007: 00 (59)
$F008: 20 (20)
$F009: 46 
$F00A: 49
$F00B: 4C
$F00C: 45
$F00D: D3
$F00E: 46
$F00F: 49
$F010: 00 (4c)
$F011: 00 (45)
$F018: 49
$F019: 4C
$F020: 00 (4f)
$F021: 00 (50)
$F028: 20
$F029: 4E
$F040: 00 (a0)
$F048: 50
$F080: 56 (52)
$F081: 4F
$F088: 54
$F100: 00 (8d)
$F108: A9
$F180: DF (5F)
$F181: F2 (D0)
$F200: 00
$F208: D0
$F400: 00
$F408: 90
$F800: 00
$F808: F6

I got a $00 in all cases where A3 was L, except for $F080 and $F180 -- here I got non-zero, though equally wrong values. So this ROM seems heavily corrupted!

I also tried to figure out how exactly my ROM's false values should theoretically affect the boot process and if this was compatible with my PET's symptoms. So first for the relevant vectors:

Code:
$FFFC: D1
$FFFD: FC
$FFFE: 1B
$FFFF: E6

Apparently, the RESET ($FFFC/$FFFD => $FCD1) and IRQ ($FFFE/$FFFF => $E61B) vector bytes still were what they ought to be. However, wenn following the RESET vector to its target address, I realized that I did not only get loads of false values, but these values occasionally also changed over time! More precisely, immediately after turning on power, I frequently got values with many bytes set (like $FF, $FB etc.), and during the next 30 or so seconds more and more bits turned L, sometimes, but not always, until the values actually exptected were reached. For instance, for the first seven addresses I found values like

Code:
$FCD1: FE/FB/B6 (A2)
$FCD2: FF       (FF)
$FCD3: FA/9A    (9A)
$FCD4: F9       (D8)
$FCD5: 78/20    (20)
$FCD6: FE/DE    (DE)
$FCD7: FD/E1    (E1)

Now sooner or later one of the false values almost certainly must lead to a CPU jam (=> no activity on the data/address bus and R/W, which is what I encounter immediately after turning on the computer) or a BRK instruction ($00), which will cause a software interrupt.

Now let's again have a closer look at the interrupt routine, which lives in one of the "good" ROMs (at $E61B). Since we came from a BRK, it will try to branch to the BRK handler, which is at $FD17 in the bad ROM. Reading out this addres yields -- tataa! -- another false value, namely $00. Consequently, any initial BRK will cause an infinite number of follow-up BRKs -- and this is most likely what I observe as recurring pattern in the R/W signal:

attachment.php


The first, somewhat longer dip, probably corresponds to the BRK instruction itself, which writes the 2 byte program counter and the processor status to the stack, and the subsequent three smaller dips are caused by the three PHA instructions at the start of the interrupt handler.


What next?
==========

Now having most likely identified a major problem with my PET, the question ist: where to get a new $F000 ROM from? Well, the supermarked next door doesn't have them on stock -- but I could perfectly live with a surrogate like a non-original, modern-type EPROM containing the original code. From the http://vintage-computer.com/vcforum/showthread.php?t=14984 thread I've learned that some of you guys are quite competent regarding EPROMs -- do you know some nice introductory web resources where one could learn something about EPROM types and programming in general and with regard to substituting damaged vintage ROMs?

Happy easter (if you happen to celebrate this holiday)! --
 
Last edited:
Well done on the diagnosis...and all from first principles!

A corrupted F000 ROM was one of the main problems with my Pet too.

Tez
 
Back
Top