Thanks guys, for all these responses. I'll take them one at a time:
John West wrote:
The way to be sure is to try executing one of the new 65C02 instructions and see what it does. Once you've got it reliably executing instructions, try opcode $8f. On the 65C02 that's BBS0, which will take a zero page address and an 8 bit offset, read from memory, and either branch or not depending on the value it read. On the NMOS 6502, that's the undocumented instruction SAX abs, which will store the result of ANDing the A and X registers. Feed it $8f, $ea, $ea, $ea, $ea, ..., and see if it writes to memory. I expect it won't.
I'm not too sure if I've done this correctly, but here goes...
Running at 5Hz: for the first 21 cycles, I simply have 0x00 being presented to the data bus, while the CPU settled into its 4 reads, 3 writes cycle. Given that, it was then easy to time my app to present 0x8F at T-State 22 and 23, after which 0xEA all the way.
This is my monitor trace. I've done a little rework on my code, so that the output is clearer to read. As I'm unsure about what I should be seeing, I'm hoping that you'll come back and tell me what you see, and if ti's what you expected to see, or maybe tell me what I've done wrong, if I have in fact, messed this up in some way.
Code:
>>> %Run -c $EDITOR_CONTENT
MPY: soft reboot
Freq: 5
Running...
T-State: 1 ........................................
ADD BUS: 1 0 1 0 1 1 1 1 1 0 1 0 0 0 0 0 | 0xAFA0
Reading: 0 0 0 0 0 0 0 0 | 0x00
T-State: 2 ........................................
ADD BUS: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | 0x0000
Reading: 0 0 0 0 0 0 0 0 | 0x00
T-State: 3 ........................................
ADD BUS: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | 0x0000
Reading: 0 0 0 0 0 0 0 0 | 0x00
T-State: 4 ........................................
ADD BUS: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 | 0x0001
Reading: 0 0 0 0 0 0 0 0 | 0x00
T-State: 5 ........................................
ADD BUS: 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 | 0x0100
Writing: 0 0 0 0 0 0 0 0 | 0x00
T-State: 6 ........................................
ADD BUS: 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 | 0x01FF
Writing: 0 0 0 0 0 0 1 0 | 0x02
T-State: 7 ........................................
ADD BUS: 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 | 0x01FE
Writing: 0 0 1 1 0 1 0 0 | 0x34
T-State: 8 ........................................
ADD BUS: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 | 0xFFFE
Reading: 0 0 0 0 0 0 0 0 | 0x00
T-State: 9 ........................................
ADD BUS: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 | 0xFFFF
Reading: 0 0 0 0 0 0 0 0 | 0x00
T-State: 10 ........................................
ADD BUS: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | 0x0000
Reading: 0 0 0 0 0 0 0 0 | 0x00
T-State: 11 ........................................
ADD BUS: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 | 0x0001
Reading: 0 0 0 0 0 0 0 0 | 0x00
T-State: 12 ........................................
ADD BUS: 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 1 | 0x01FD
Writing: 0 0 0 0 0 0 0 0 | 0x00
T-State: 13 ........................................
ADD BUS: 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 | 0x01FC
Writing: 0 0 0 0 0 0 1 0 | 0x02
T-State: 14 ........................................
ADD BUS: 0 0 0 0 0 0 0 1 1 1 1 1 1 0 1 1 | 0x01FB
Writing: 0 0 1 1 0 1 0 0 | 0x34
T-State: 15 ........................................
ADD BUS: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 | 0xFFFE
Reading: 0 0 0 0 0 0 0 0 | 0x00
T-State: 16 ........................................
ADD BUS: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 | 0xFFFF
Reading: 0 0 0 0 0 0 0 0 | 0x00
T-State: 17 ........................................
ADD BUS: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | 0x0000
Reading: 0 0 0 0 0 0 0 0 | 0x00
T-State: 18 ........................................
ADD BUS: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 | 0x0001
Reading: 0 0 0 0 0 0 0 0 | 0x00
T-State: 19 ........................................
ADD BUS: 0 0 0 0 0 0 0 1 1 1 1 1 1 0 1 0 | 0x01FA
Writing: 0 0 0 0 0 0 0 0 | 0x00
T-State: 20 ........................................
ADD BUS: 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 1 | 0x01F9
Writing: 0 0 0 0 0 0 1 0 | 0x02
T-State: 21 ........................................
ADD BUS: 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 | 0x01F8
Writing: 0 0 1 1 0 1 0 0 | 0x34
T-State: 22 ........................................
ADD BUS: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 | 0xFFFE
Reading: 1 0 0 0 1 1 1 1 | 0x8F
T-State: 23 ........................................
ADD BUS: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 | 0xFFFF
Reading: 1 0 0 0 1 1 1 1 | 0x8F
T-State: 24 ........................................
ADD BUS: 1 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 | 0x8F8F
Reading: 1 1 1 0 1 0 1 0 | 0xEA
T-State: 25 ........................................
ADD BUS: 1 0 0 1 1 1 1 1 1 0 0 1 0 0 0 0 | 0x9F90
Reading: 1 1 1 0 1 0 1 0 | 0xEA
T-State: 26 ........................................
ADD BUS: 1 0 1 0 1 1 1 1 1 0 0 1 0 0 0 0 | 0xAF90
Reading: 1 1 1 0 1 0 1 0 | 0xEA
T-State: 27 ........................................
ADD BUS: 1 0 1 1 1 1 1 1 1 0 0 1 0 0 0 1 | 0xBF91
Reading: 1 1 1 0 1 0 1 0 | 0xEA
T-State: 28 ........................................
ADD BUS: 1 1 0 0 1 1 1 1 1 0 0 1 0 0 0 1 | 0xCF91
Reading: 1 1 1 0 1 0 1 0 | 0xEA
T-State: 29 ........................................
ADD BUS: 1 1 0 1 1 1 1 1 1 0 0 1 0 0 1 0 | 0xDF92
Reading: 1 1 1 0 1 0 1 0 | 0xEA
T-State: 30 ........................................
ADD BUS: 1 1 1 0 1 1 1 1 1 0 0 1 0 0 1 0 | 0xEF92
Reading: 1 1 1 0 1 0 1 0 | 0xEA
T-State: 31 ........................................
ADD BUS: 1 1 1 1 1 1 1 1 1 0 0 1 0 0 1 1 | 0xFF93
Reading: 1 1 1 0 1 0 1 0 | 0xEA
T-State: 32 ........................................
ADD BUS: 0 0 0 0 1 1 1 1 1 0 0 1 0 0 1 1 | 0x0F93
Reading: 1 1 1 0 1 0 1 0 | 0xEA
Thank you very much, John.
---
plasmo wrote:
Since you already have a Pi Pico monitoring 6502 addresses and feeding instructions to 6502 and you've gone down the path of understanding every cycle of 6502 instruction executions (a daunting task, BTW, and Dr. J is your best help), you actually don't need an EPROM programmer. All you need is a setup with RAM & 6502 & IO that uses Pi Pico to feed the initial set of instructions which are written into RAM, then engage RAM & disengage Pi Pico and watch it runs by itself. The process is a bit convoluted akin to starting a gas-powered car, but quite a bit have written about starting up 6502 with the topic of 'bootstrap'
Once you've kicked started 6502 with Pi Pico, you can use the 6502 to program EPROM. That would be a fun & useful first project with your new hardware.
Welcome to 6502.org!
Bill
That's a very good suggestion and would be (as you say) a fun & useful first project. I would, in fact, like to remove the Pico from the loop entirely, once I no longer need it to monitor the 6502 and provide its ϕ₀(IN) signal.
I will certainly find and read what others have posted on the topic of 'bootstrapping'.
Thank you so much, Bill, for this and the welcome.
---
BigDumbDinosaur wrote:
According to information I have, 2000 was the last year Rockwell produced any 6502-family chips. That R6502BP is indeed a fake. You should be aware that the 65C02 is a commonly-counterfeited part that regularly turns up on eBay sites. As Garth notes, we have discussion around here on where to obtain parts and how to avoid being gypped by unscrupulous sellers of fake 6502 parts.
In any case, an NMOS 6502 cannot run that slowly—it is a dynamic design that will lose state at subnormal clock rates. All 65C02s of which I am aware can be safely stopped on Ø2 high. Only the WDC 65C02 can be safely stopped on either clock phase, which is possible because it is a fully static design.
Thank you very much for your input and the welcome.
It seems that I've fallen into the same trap as I'm sure that many others have done before me. To be fair to the seller from whom I got this CPU, maybe he's not as 'up-to-speed' on these facts as he should be, and he's unaware that he's selling fakes.
I will indeed use better suppliers, moving forward.
Again, thank you.
---
I'd just like to finish this post by again thanking you all for your time, as well as the information and help. I can see that this a fantastic community and I hope to be able to contribute, in some way, when I feel that I have something to offer.
My intention is to document this project so that it can be used by anyone else wishing to build this kind of gadget. I know that that are loads of builds that have already been documented, but they're unique, in one way or another, and mine will also have its own personality.
My best regards to you all.
~ Rob.