2026-02-04
Timing faults
Now, I don't have much to show you yet, but I always start these
projects by getting something rather simple to work. The first task was
to write output data to a Peripheral Interface Adapter (PIA). However,
oddly enough (and after verifying every connection and details of the
datasheets), the output to the PIA were... sporadic. Unlike the CMOS
versions of the 6502 and Z80, the 6809 is not a static design, and you
therefore cannot halt the clock to single-step instructions and monitor
the bus, which I used to do with a very ad-hoc Arduino setup.
After a lot of headscratching, I decided to buy a cheap logic analyser
with a resolution up to 24 MHz and record it with Sigrok.
I inspected the address lines, data lines, and some control lines. It
turns out that everything ran perfectly for maybe a millisecond.
Inspecting the E (enable) line, which is the last signal in the
picture, everything starts going wrong after it pulses a tiny
bit shorter than usual. This made me realise that I accidentally used
ever so slightly larger load capacitors in the crystal circuit
than spec (27 pF vs. 24 pF). Even single-stepping wouldn't have caught
this.
Just as an end note, after getting the basic microprocessor setup to
work on the 4 MHz crystal, there was something more odd that I noticed
with this system. I turned off the lamp on my desk, in order to get
ready to leave, but the output of the PIA changed. Somehow,
somewhere, signal noise or a current surge generated from the lamp
indirectly channels into the PIA to change its state. How peculiar.