akohlbecker wrote:
There is a window around the falling edge of the clock where the CPU is reading RDY. It can happen that RDY goes low during this window and whether the CPU actually registers it is then undefined.
That's true. But (going slightly OT) let me remind everyone that in this case "undefined" doesn't necessarily resolve to a simple, "yes or no" outcome. (I used to believe that, but I've learned there's more to it.)
In cases where RDY goes high or goes low during the danger zone, one might suppose that the CPU will either immediately recognize the new level or instead simply recognize it on the subsequent cycle... IOW, a tidy result in either case. But there's a third possible outcome. When tPCS or tPCH is violated
the result can be messy, resulting in a program crash.
There's a very clear (to me) instance of this described in
this thread, from which I quote...
drogon wrote:
I'm wondering if anyone is successfully using Rdy to halt a 65C02?
I tried it some time back on my Ruby boards and had mixed results - in that it worked very well - I was pulling Rdy low, then BE low, then fiddling with the RAM from another processor (an ATmega), then releasing BE then taking Rdy high ... At that point, sometimes the 65C02 would crash - it's as if it was reading a random instruction at that point.
RDY was being pulled low and high by an asynchronously-clocked source (the ATmega), which means tPCS or tPCH would have a certain probability of being violated and also a certain probability of being satisfied (this being the most likely outcome, as the off-limits tPCS to tPCH window is quite brief). And, this matches what Gordon reported -- ie; most of the time it worked, but occasionally it failed,
actually disrupting the program.
Perhaps tPCS/tPCH violations cause
metastability issues within the CPU; I don't know. But another (more likely?) explanation is that RDY is a signal that gets internally routed to multiple sections of the CPU. For example, PC needs to be told not to increment, and updates to X, Y and A need to be postponed. It's easy to imagine a jumbled outcome if (for example) PC did get the message in time but some other part of the CPU didn't!
-- Jeff
_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html