BigDumbDinosaur wrote:
For some time, we've been kicking around various methods of wait-stating when a slow device must be accessed on an otherwise-fast machine...
While I had the logic analyzer (LA) hooked up I captured what the '816 was doing during a read cycle and annotated the result. Operating conditions are room temperature, 5 volts and Ø2 at 12.5 MHz. The transition from logic 0 to logic 1 is assumed to occur at 2.5 volts and is assumed to be symmetric—the LA has no provisions for independently setting the logic 0 and logic 1 levels. Annotated times are in nanoseconds, with a ±2ns accuracy.
Attachment:
File comment: 65C816 Read Cycle — Selected Signals
data_bus_turnaround_scaled.gif [ 295.58 KiB | Viewed 29199 times ]
The code that was being executed during this capture was:
Code:
sep #%00110000 ;8-bit registers
lda #%00000011 ;read...
pha ;from...
plb ;bank $03
;
loop lda $8000 ;effectively LDA $038000
bra loop
Prior to starting this, I placed
$04 at location
$8000 so as to produce a data bus pattern that would clearly not be the same as the bank address. The capture occurs at the final cycle of the
LDA $8000 instruction, which is when the '816 reads the addressed location. As is always the case with the '816, the Ø2 low phase is when address setup occurs and the bank bits are emitted on the data bus.
Of particular note is the bank address persistence after the rise of Ø2. The measured 14ns is critical because the bank latch must be closed before that period expires, otherwise undefined content may be latched and ultimately result in data corruption due to addressing errors. Assuming the use of a 74AC573, there is only a 3-4ns margin, worst-case, before the data bus turnaround begins. That being the case, the reference circuit shown on page 44 in the 65C816 data sheet would fail if the '573 is at the weak end of its specifications. This would be due to the fact that the inverted Ø2 signal used to control the latch will lag Ø2 by one gate delay, effectively reducing the 14ns window by anywhere from 2ns to 7ns, depending on the inverter being used.
Also, note the 8ns period between when the '816 stops emitting the bank and the addressed device (RAM, in this case) puts data on the bus. In my POC designs, the Ø2-qualified read/write circuit drives
/RD low one gate delay after the rise of Ø2, which ranges from 1.9ns to 6.6ns, according to the data sheet. Assuming the gate's performance falls near the middle of the spec, it would mean the RAM is responding with considerable alacrity to
/RD.
The 8ns data persistence after the fall of Ø2 can be attributed to a combination of logic latency and bus capacitance.