drogon wrote:
Anyway, 8 bits, strobe out and and ack back, so 10 wires. The issue then is direction - my current solution - 2 x 8-bit ports, one to write, one to read. The Pi has more than enough GPIO for that, and it saves all the hassle of software bus turn-around at the expense of using up a VIA on the main 6502 side. (which costs as much as a Pi - go figure) This is a standard mode for the ports on the 65c22 - they handle the strobe + ack in hardware. Think parallel printer port...
To my novice eye, I don't see a whole lot of difference between the parallel port protocols and GPIB. Basic parallel port requires 3 extra lines, just like GPIB does. The extended parallel versions just add more, similar to what GPIB does. Seems more a matter of taste, especially if you don't intend to implement the GPIB wire protocols.
For simplicity I'd want something that can be done with a single VIA, which offers only 2 ports.
drogon wrote:
(and arrange the VIA to IRQ the 6502 after the Pi has taken the data, however I suspect polling might actually be quicker)
Since I envision the pi potentially handling multiple I/O request simultaneously, I want an interrupt driven side on the 6502 since you don't necessarily know what kind of packet is coming next (you could be reading a file, and reading the internet for example). So, the interrupt handler would service the individual channels opened on the 6502 side. What I don't want is anything like DMA. I'd rather the pi send back a packet "here's some data for channel 2" and the routine routes it properly. I can see the interrupt happening at the beginning of a packet, the routine drains the packet from the pi, then it hangs up. The next packet would toggle another one.
Obviously have to suss out handshaking at the channel level to keep the pi from sending more than the 6502 can handle.
GARTHWILSON wrote:
As for other interfaces though, serial doesn't have to be slow. ... I'm hoping Daryl finds a suitable CPLD to replace the discontinued one he used to make his 65SPI IC with. If it had an external clock source that's faster than phase 2, such an IC could send and receive a byte in less than the time it takes for the 65xx to read or write it.
Serial protocols through a dedicate chip may be faster, but not one that's bit-banged from the CPU/VIA. And that was my reasoning. If I have to interface to a dedicated protocol chip (for ANY protocol, whether it's SPI, USB, that DOS chip, or even a UART), I may as well interface to a Pi as it provided universal, modern I/O. It can connect to anything. Just need to have some custom software on it. Ideally, a 1GHz Pi can provide I/O far faster than even a 14MHz '02 or '816 can feed or read from it.
Heck, it may be practical to mimic the 6551 interface: 8 data bits, some "register select" bits, a R/W bit and an the IRQ line. The benefit of the 6551 is that it can plug straight in to the address bus. I don't know if putting the pi GPIO pins on to the address bus is a good idea. If that's the case, that you could put the GPIO pins on both the address and data bus (skipping the VIA), well, that's interesting as well. I just don't know if it can work like that.
I like the idea of a data strobe ala SPI et al vs tying in to the system clock. For whatever reason I just find that simpler. But maybe the it can work with the pi.