Zolatron 6502 homebrew computer – clocking in

Sometimes the things that confuse you most turn out to have the simplest solutions – and so it was with the clock for my Zolatron 6502 homebrew computer.

First, let’s deal with the 6502’s clock pins. There are three of them and they’re called PHI1O, PHI2 and PHI2O – except when they’re not. Older versions of the 6502 have PHI1 instead of PHI2.

‘Phi’ is the Greek letter Φ and is used here to represent ‘phase’. So you can refer to these signals as phase 1 and phase 2.

You’d be forgiven for thinking that the 6502 has two clocks, but it doesn’t. What happens, at least on current versions of the chip, is that you feed a clock signal in on PHI2. This comes out again (albeit with a slight propagation delay) on PHI2O (the ‘O’ standing for ‘out’). The signal also comes out on PHI1O, but inverted – where it’s high on PHI2O it’s low on PHI1O and vice versa – hence the use of the term ‘phase’.

What do you do with all these signals? Well, mostly nothing. There was a time when you could use the 6502’s internal clock. And when you didn’t, it was common to use a crystal plus resistors and inverters (typically packaged in a 7404 chip) to create the necessary pulses. And, indeed, that’s how it’s done in Grant Searle’s popular 8-chip (or 7-chip) 6502 computer. But as Searle himself notes, this is now a somewhat obsolete way of going about it.

It would looks something like this:

That’s five components. It’s also, by the way, the approach that the Apatco kit I’m building takes. You could call it the traditional method.

It’s now easier to use a can-style oscillator, with no external components other than, perhaps, a decoupling capacitor, and feed that to the 6502’s PHI2 pin, as well as any other components requiring a clock pulse. This is the recommendation of Western Digital itself, which states in the datasheet: “An external oscillator is recommended for driving PHI2 and used for the main system clock. All production test timing is based on PHI2.”

Here’s a 1MHz can-style oscillator doing its thing on a breadboard.

There’s some overshoot and ringing, but I’m assuming they’re going to be within limits for what I need.

As for the PHI1O and PHI2O, let’s hear from Western Digital again: “PHI2O and PHI1O were used in older systems for system timing and internal oscillators when an external crystal was used.” That reference to ‘older systems’ is a clear hint that you shouldn’t be messing with these things now.

So the easiest – and arguably best – solution to the 6502’s timing needs is to plonk in a can-style oscillator and have done with it.

So, the latest tweaks I’ve made to my schematic are:

  • Adding a bypass cap to the power lines for the oscillator (see image at the top of the post).
  • Marking PHI1O and PHI2O on the 6502 as ‘not connected’.
  • Removing the PHI1O and PHI2O signals from the backplane connector.

If you’re keeping score, this is how the main board schematic looks now.


Leave a Reply

Your email address will not be published. Required fields are marked *