gfoot wrote:
So that's good! This is the asynchronous synchronous mode, which Dave said is limited in clock speed to about 8MHz. The command for the IFCLK mode didn't work for me, even with J2 removed. I'm tempted to check the pin is labelled correctly etc though and go from there.
Ooh, this works for me too now! I noticed in the timing diagram that Dave posted (page 50) that even in synchronous mode, it wants SLWR to be low - that's RDY1, which is labelled RDY0 on our boards. So tying that low and rerunning the --ifclk=xi command caused it to grab some data.
I was able to sample my system running at 16MHz very well. One problem I found was difficulty sampling from an "off" state - for some reason that didn't work well. But I wanted to capture the reset, so I connected the 6502's NRESET line to the FX2LP's PA5 pin - when this is low, it disables capture. Then I can hold the reset button, run the command, wait for it to be ready, then let go of the reset button:
Code:
???? : : RESET !! : 9 : A=?? X=?? Y=?? SP=?? N=? V=? D=0 I=1 Z=? C=?
FFC0 : A2 FF : LDX #FF : 2 : A=?? X=FF Y=?? SP=?? N=1 V=? D=0 I=1 Z=0 C=?
FFC2 : 9A : TXS : 2 : A=?? X=FF Y=?? SP=FF N=1 V=? D=0 I=1 Z=0 C=?
FFC3 : A9 0C : LDA #0C : 2 : A=0C X=FF Y=?? SP=FF N=0 V=? D=0 I=1 Z=0 C=?
FFC5 : 8D 60 FF : STA FF60 : 4 : A=0C X=FF Y=?? SP=FF N=0 V=? D=0 I=1 Z=0 C=?
FFC8 : A9 00 : LDA #00 : 2 : A=00 X=FF Y=?? SP=FF N=0 V=? D=0 I=1 Z=1 C=?
FFCA : 85 00 : STA 00 : 3 : A=00 X=FF Y=?? SP=FF N=0 V=? D=0 I=1 Z=1 C=?
FFCC : A9 80 : LDA #80 : 2 : A=80 X=FF Y=?? SP=FF N=1 V=? D=0 I=1 Z=0 C=?
FFCE : 85 01 : STA 01 : 3 : A=80 X=FF Y=?? SP=FF N=1 V=? D=0 I=1 Z=0 C=?
FFD0 : A9 00 : LDA #00 : 2 : A=00 X=FF Y=?? SP=FF N=0 V=? D=0 I=1 Z=1 C=?
FFD2 : 85 02 : STA 02 : 3 : A=00 X=FF Y=?? SP=FF N=0 V=? D=0 I=1 Z=1 C=?
FFD4 : A9 04 : LDA #04 : 2 : A=04 X=FF Y=?? SP=FF N=0 V=? D=0 I=1 Z=0 C=?
FFD6 : 85 03 : STA 03 : 3 : A=04 X=FF Y=?? SP=FF N=0 V=? D=0 I=1 Z=0 C=?
FFD8 : A2 7F : LDX #7F : 2 : A=04 X=7F Y=?? SP=FF N=0 V=? D=0 I=1 Z=0 C=?
FFDA : A0 00 : LDY #00 : 2 : A=04 X=7F Y=00 SP=FF N=0 V=? D=0 I=1 Z=1 C=?
FFDC : B1 00 : LDA (00),Y : 5 : A=64 X=7F Y=00 SP=FF N=0 V=? D=0 I=1 Z=0 C=?
Now I swear this program has black magic in it - I'm going to lose sleep tonight wondering how on earth it's able to detect an interrupt scenario from sampling only the data bus:
Code:
524314 8001a 0 d0 ? ? ?
524315 8001b 1 fd ? ? ?
524316 8001c 2 c8 ? ? ?
0555 : D0 FD : BNE 0554 : 3 : A=00 X=45 Y=04 SP=FF N=0 V=0 D=0 I=0 Z=0 C=1
524317 8001d 0 e8 ? ? ?
524318 8001e 1 d0 ? ? ?
0554 : E8 : INX : 2 : A=00 X=46 Y=04 SP=FF N=0 V=0 D=0 I=0 Z=0 C=1
524319 8001f 0 d0 ? ? ?
524320 80020 1 d0 ? ? ?
524321 80021 2 05 ? ? ?
524322 80022 3 55 ? ? ?
524323 80023 4 21 ? ? ?
524324 80024 5 3d ? ? ?
524325 80025 6 04 ? ? ?
0555 : : INTERRUPT !! : 7 : A=00 X=46 Y=04 SP=FC N=0 V=0 D=0 I=1 Z=0 C=1
524326 80026 0 48 ? ? ?
524327 80027 1 ad ? ? ?
524328 80028 2 00 ? ? ?
043D : 48 : PHA : 3 : A=00 X=46 Y=04 SP=FB N=0 V=0 D=0 I=1 Z=0 C=1
524329 80029 0 ad ? ? ?
524330 8002a 1 2d ? ? ?
524331 8002b 2 ff ? ? ?
524332 8002c 3 c0 ? ? ?
memory modelling failed at FF2D: expected 7F actual C0
043E : AD 2D FF : LDA FF2D : 4 : A=C0 X=46 Y=04 SP=FB N=1 V=0 D=0 I=1 Z=0 C=1 prediction failed
524333 8002d 0 4a ? ? ?
524334 8002e 1 4a ? ? ?
0441 : 4A : LSR A : 2 : A=60 X=46 Y=04 SP=FB N=0 V=0 D=0 I=1 Z=0 C=0
The prediction failure is due to that location being a VIA's IFR register.
It's amazing what can be achieved from sampling so few lines, and it makes the whole thing much easier to use than other options, much easier to plug in when it's needed. There are a few output options that I think could be added, and it still struggles when it doesn't know the machine state (like starting a capture while the system is already running) and in those cases maybe a little human help could be supported - telling it what the program counter is, register values etc if we can figure them out, or even just that a certain branch was not taken (as it seems to assume they're all taken if it's not sure).
I also tried capturing at 25.175MHz, and while this seemed to work when starting from a running system, it didn't work from reset - fx2pipe seemed to get blocked up after receiving only one block. It's possible that the clock signal I'm sending to the FX2LP is not clean enough - it's certainly not symmetric as I stretch it a lot. But then, it didn't mind at 16MHz - so perhaps it's just too fast.