OK, I made some progress.
I built a simple logic-analyzer that samples two signals at 48MHz and
sends the data over USB back to the PC. I can sample two signals at
48MHz for up to 20mins, but that would result in a 14GiB log file!
I have just sampled /C_OE for half a minute (30sec) and analyzed the
log file. The results are rather interesting.
Firstly, I have stripped the test rig down to bare bones: I have a
commercial game cartridge (Crue Ball), to which I've added a resistor
between /C_OE and ground, which drags the /C_OE high level down to
about 3.3V. At this level the game still works fine, but it's safe to
connect directly to an FPGA input without the need for a level-
converter chip. The analyzer generates a big (340MiB) datafile, and I
wrote a conversion program to allow me to view the results in GTKWave.
Here's a small sample of what the /C_OE data looks like:
http://www.swaton.ukfsn.org/temp/oeSample.jpg
Further analysis gives some useful statistics:
http://www.swaton.ukfsn.org/temp/stats.txt
First the shortest /C_OE low and high periods:
Shortest low period was 7 cycles (146 ns)
Shortest high period was 7 cycles (146 ns)
Now the longest /C_OE low and high periods, which are surprising:
Longest low period was 105 cycles (2188 ns)
Longest high period was 844 cycles (17583 ns)
It seems to me like 17.5us is a long time to be sitting there not
accessing any memory or registers!
Then you get some data giving an indication of how common /C_OE
asserted periods of each length are:
Low period cycle distribution:
7 cycles: 264865
8 cycles: 89440
9 cycles: 12841
10 cycles: 582
15 cycles: 8528007
16 cycles: 26985259
21 cycles: 1919
This means that in my 30sec sample, there were nearly 27 million
occasions when /C_OE asserted for 16 cycles (~333ns). This is by far
the most common assert duration, but there are comparatively rare
occasions when it asserts for only 7 cycles (~146ns). By "rare" I mean
there were "only" 264,865 occasions in my 30sec sample where this
happened. Notice I have filtered out zeros in the data: there were
ZERO occurrences of /C_OE asserting for 11, 12, 13, 14, 17, 18, 19, 20
cycles.
Finally you get similar data for the gaps between /C_OE asserts:
High period cycle distribution:
7 cycles: 117671
8 cycles: 27830
9 cycles: 10543899
10 cycles: 10861566
15 cycles: 18998
So, in my 30sec sample, there were over 10 million occasions when /
C_OE deasserted for 9 cycles (~187ns) and a similar number of
occasions where it deasserted for 10 cycles (~208ns). These two
represent by far the most common deassert duration. Again, there are
comparatively rare occasions (117,671 in my 30sec sample) when it
deasserts for only 7 cycles (~146ns).
In summary:
/C_OE asserts have a typical duration of 333ns and a minimum
duration of 146ns.
/C_OE deasserts have a typical duration of 187-208ns and a minimum
duration of 146ns.
I can now try similar tests including other signals in the sampling,
so for example I can determine the minimum setup time for the address
lines before /C_OE asserts, and verify that the address lines never
change whilst /C_OE is asserted. I can also run similar tests with the
FPGA doing ROM emulation, and hopefully thereby determine the exact
cause of the crashes I was seeing. I also got some fast Schmitt
trigger inverters, so I can see what effect they have on the signals
too.
Chris