1 hour ago, TomXP411 said:
Because I don't care about the EPP standard, and I'm not trying to implement it.
While that was a 3 AM "back of the napkin" idea, I still don't want to get tied down trying to support a protocol meant for Zip drives, scanners, and LapLink.
Just saying if you start from the EPP version of the interface instead of the SPP version of the interface like you did, there's less modification required. Customize the general EPP setup to fit the device, add the CTS/DTR lines, job done.
Where a bespoke interface gains the upper hand is when you make use of the CA2 pulse output. If the device you are talking to is fast enough to keep up, you can just set up the port, then write a packet to the port in a loop, or read a packet from the port in a loop, and each read or write gets a pulse output on the CA2 line to tell the external device "store this byte in the FIFO queue" or "fetch the next byte from the FIFO queue", so throughput goes up substantially compared to the EPP approach, you have to strobe each byte with bit banging.
Using the VIA hardware handshaking, you've got a bit of overhead per packet, but for the packet itself, transfer can be as fast as an memory to memory block move.
For that, you want a single strobe and a status/data select bit like you have sketched it, instead of the separate data/address strobes.
But move the strobe from PB0 to CA2, so it can be automatic when reading or writing in a loop, and move Data Waiting to CA1. That gives you the option to have "Data Waiting" trigger an interrupt, and then you can poll Data Waiting in your loop to load as many bytes as have arrived before the interrupt service routine started.