DerTrueForce wrote:
What I think BDD is saying is that the 'C02 does not drive that pin unless a WAI is executed.
Therefore there will be little or no current through that resistor unless the 'C02 executes a WAI(since this is a CMOS input, it draws virtually no current).
If you never use that instruction(there's not much reason to, outside of testing), then the current is never drawn and there is no wastage.
I'm perfectly aware of WAI's behaviour in that respect, and have in fact mentioned it at least twice in this thread already. The problem is *precisely* that WAI causes that power dissipation in the resistor, when I want to use it to *save* power.
So there are good reasons not only to use WAI, but to detect externally when it has been used, in a battery-powered device.
Without WAI, the CPU must be put into a tight polling loop when idle, even if input is signalled by IRQ. In such a loop, the CPU is constantly fetching instructions from RAM or ROM. This means that memory chip is selected and drawing active power (milliamps) instead of standby power (microamps). Likewise for the CPU itself and the glue logic which is constantly seeing transitions on address, data and control lines.
With WAI in effect, the CPU halts. The 6502 has no native way to indicate that it's making no active fetches (the 65816 does), but that XOR-gate arrangement can detect that WAI is in effect, and gate off the /CE signals - it just needs NAND gates to be one input wider, or the use of one of the spare selectors on a more complex decoder chip if that's in use ('138, '47). It's not necessary to negate BE, I think, since the address and control lines will be held stable by the CPU and the data lines will be tristated anyway. (Question: does the WDC chip have "bus keeper" circuits on the data lines, or do I need to put very weak pull-downs on them to stop them floating around?)
For extra credit, the WAI detection could also be used to switch over to a slow clock (to save more dynamic power caused solely by Phi2 transitions), such as the low-power (microamp) 32kHz oscillator attached to an RTC chip, and power down the main (milliamps) CPU clock oscillator. The latter would take a millisecond or so to come back up when required, so the logic associated with that might be challenging. Or the clock switching could be under software control, so that WAI can still be used for ultra-low-latency interrupt service with minor power savings.
None of this, of course, would be of concern to a basic computer that's always run off mains power. The total power involved from all sources would be well under one watt. So my first prototype might lose some of this logic in the name of simplicity, but it's still interesting for me to work it all out and see what the ramifications are.