Let me try to put together a reply...
SpottedGal wrote:
... in this project idea, is there really a need to have a separate 6502? I mean, the P2 can emulate one just fine, and sticking within healthy overclocking ranges, the P2 can emulate a 14 MHz 6502.
There's never a need for a separate 6502, unless that need comes from your motivations at the time. Sometimes you might want a fully embedded emulation, sometimes you might want a six-chip single board computer, sometimes something in between. Personally, I do see the value in projects which are a hybrid, with a real microprocessor, maybe some other real chips like RAM, but also a microcontroller to do the work of other subsystems. Personally, I see value in being able to use a real 6502 bus - whether to monitor the behaviour of the system, or to extend it, or both. Different people are interested in different things, at different times. There is no single right way.
Quote:
If nothing else, wait states could be added to writes to give more time for the snooper cog to store it.
Quite so! I think the easiest approach is for the P2 to control the clock. Another way to start easy is to start with a slow clock speed. You'll find out what the sequence of events is and what's the critical path. Many threads here discuss the relative merits of changing the clocking or using RDY - both are valid.
Quote:
I wasn't sure of how to do the timing. I was thinking asynchronous from each other. Maybe use an oscillator can and generate the P2's clock in firmware. It is rated for 180 and has been tested up to about 350 MHz. I'd stay under that for reliability and headroom.
One datapoint which might be relevant: the PiTubeDirect project uses the 500MHz videocore in a raspberry pi to interact with the 2MHz bus of the BBC Micro. (Possibly, the timing is such that we only get a half-cycle to act, so the deadlines are a little like a 4MHz bus.) In this case we need to emulate both reads and writes at full speed, and it proves to be quite difficult to meet the timing, but possible. Emulating writes (in effect, actually snooping for writes) is going to be more relaxed. But it still might be surprising how few instructions you can run in the limited time.
Quote:
That [P2] seems like a nice chip to use for most peripherals...
Yes indeed, an interesting chip with lots of facilities. It's similar with other microcontrollers - many facilities. Which means you can't use the chips constraints to determine the direction of your project - you have to figure out what you want to do with it. (Which also means, you won't be using all of those facilities, and you need to be OK with that.) So, if you want a quick project, you do something simple, if your aim is to learn something, then shape your project accordingly, if you want something you can show to other people, or something to teach with, or something to entertain, or something battery-powered, or something very extensible, well the project changes shape as a result.
When it comes to learning something, you might be wanting to learn about the P2 specifically, or about 6502 systems, or about electronics, or logic, or programming. Lots of possibilities, and only you can decide what you want to do next.