ytropek wrote:
- crossing the 8MHz barrier.
8MHz isn't much of a barrier for the 6502 itself. A stock through-hole WDC65C02 can manage 20MHz+ with no trouble as demonstrated by Bill (plasmo).
I don't know specifically why WDC's boards are clocked at 8MHz. However, at 1MHz, each phase of the 6502's two-phase
clock is 500ns. In practice, the 6502 needs about 10ns from each phase unto itself for address hold and data setup, leaving 490ns on either side of the rising edge of Ø2. At 1MHz, modern 6502s spend a lot of time sitting around twiddling their thumbs waiting for things to happen.
At 10MHz, each phase of the 6502's two-phase
clock is 50ns. When timing margins start to get tight, you also have to consider that it can take up to about 5ns for an address or data line to switch, so in practice you have to subtract 30ns from your total cycle time. At 10MHz, that leaves 35ns on either side of the rising edge of Ø2 to get things done.
I think you'll find that when it comes to going fast there are two theoretical bottlenecks, and one practical challenge.
The first bottleneck is ROM speed. If you're making a relatively traditional design with some portion of the memory map devoted to ROM, which contains boot code, you will find that most ROMs have an access time in the 100 - 150ns range. The fastest EEPROMs and some EPROMS have 70ns access times. There are some OTP ROMs that are as fast as 40ns. (In practice, ROMs are often faster than their specs let on. I have a nominally 70ns Atmel EEPROM that runs at 12.5MHz with no trouble.)
Some ways forum members deal with this:
1. Wait-states
2.
Clock stretching (using Jeff's amazing `163 counter trick)
3. ROM-less systems (using an Arduino, PIC, or some other device to to load a RAM image for the 6502 to boot from)
The second bottleneck is address decoding. For example, suppose I want to run my 70ns Atmel EEPROM "by the book," rather than overclocking it. My cycle time will look something like this:
10ns address hold + 5ns switching time + Xns address decoding + 70ns access time + 5ns switching time + 10ns data hold
We're already at X+100ns, which means that if we run at 10MHz we're overclocking something. Each layer of complexity added to address decoding (X) will put more reliance on something being over-specced and make the design more likely to fail. Disregarding the slow speed of ROM, address decoding is still a bottleneck if you want to use any WDC "family parts," such as the WDC65C22. These parts have to already be selected when Ø2 goes high, which means that at 10MHz your I/O address decoding has to fit into about 35ns. Even with a fairly fast logic family such as AHC this will put a hard limit on complexity of about 4 - 7 ICs deep. I ran into this with Blue August, where I failed to hit my target of 16MHz. My RAM and
clock-stretched ROM worked fine, but when it came to I/O I just couldn't get everything done in the 16ns I had available.
Going at 20MHz vs. 10MHz cuts your cycle time in half, which gives you about 10ns before the rise of Ø2 for your address decoding. Good luck! This is why people start using FPGAs.
Finally, the practical challenge is that, even if your math works out on paper, getting a design to work *at all* is more challenging at higher speeds. The most important consideration is to have a robust ground return network. (See the High Speed Digital Circuits thread, and Garth's Primer page about AC performance problems).
P.S. if you think of a WDC65C02 + 12ns SRAM as a kind of philosophical reference system (no I/O, no ROM, no address decoding) you get a kind of theoretical maximum speed of around 37MHz. We saw this in Bill's designs, where he was able to get close to 40MHz before he had to start using crazy tricks like over-voltage to go faster. This thought experiment system isn't very useful, but it does tell us that, for hobby systems, the 6502 and the RAM are basically "free." They will never cause us problems because ROM, I/O, and address decoding are so much slower. So, practically speaking, if you use the fastest ROM you can, waitstate or
clock stretch, keep your address decoding simple, you should be able to hit the WDC65C02s 14MHz speed without too much trouble. Between 14MHz and 20MHz is pretty tricky without programmable logic, but can be done if you're precise.