I started a run of Klaus' test suite, and things went wrong straight away - no surprise there. After all, it would have been a miracle if it worked first time. Examining the debris, I found the CPU was stuck on the BRK trap in the test suite. A run-away PC register, I thought. It didn't take long to find the last bit of code the CPU had executed before getting lost, but it was not what I expected:
Code: Select all
c264 : a901 > lda #1 ;precharge accu
c266 : 28 > plp
c267 : 48 pha
c268 : 08 > php ;save flags
Yup, nothing there, just pushing and pulling from the stack. Stepping through, I found something surprising: the PHP at the end of the sequence was somehow resetting IR! The logic probe confirmed that the control signal used to clear IR (in order to trigger an interrupt) was not in fact firing during the offending cycle. And unlike previous errors, there seemed to be no flaky solder joints in the signal path. But, I reasoned, something must be pulsing the signal somehow. IR is a 74AC273, so even a momentary pulse on its /CLR input would be enough to inflict the critical damage.
Well, it turns out that the IR-Reset signal is generated in Card B but the IR itself is on Card A, and that implies a treacherous journey across the boards for this sensitive signal. Still, figuring out what was happening was going to be a challenge. Thankfully, just when I thought the inevitable oscilloscope purchase was finally upon me, dr Jefyll suggested a cheaper (and frankly much more sensible) way forward: "I'd give some attention to the VCC and GND connections." In actual fact, I had yet to follow the earlier pointer regarding more robust VCC and GND connections, let alone connecting the many GND lines on the inter-card connectors. My bad!
Lesson learned: after making many more jumpers and wiring everything up (including GND lines to the SBC), the rogue behaviour vanished! Amazing. Hunting this problem down has been just so interesting, and the solution seems like a bit of black magic. It's one thing to read about low-impedance paths, and quite another to witness their effects! I’m surmising that in addition to providing a good return path for signals, the GND lines here also serve to connect the ground planes on each board together to provide a common reference. Is it plausible that absent these connections, an IC generating a “high” voltage on Card B might be seen as a “low” voltage on Card A, enough to accidentally trigger a /CLR signal like IR-Reset?
Either way, it’s been an amazing learning experience and a very satisfying fix to make. And to top it all off, the CPU then ran the full NMOS 6502 test suite to completion. Double hurray!!!
Man, what a day
