GARTHWILSON wrote:
I'm working out a routine to do that. It takes quite a lot of instructions, but gets rid of the jitter.
Hmmm... Interesting coding challenge, trying to do that "efficiently." The irony is that
we're purposely wasting time in order to increase latency to a constant value. But the added variable delay entails some fixed overhead, and
that can be minimized, as can the memory usage.
nyef wrote:
if a read/write to/from your I/O device causes wait-states to be generated until the timer hits a specific value would cause an effective synchronization
Yes -- I like it! It has a lot in common with the WAI approach, really.
Slightly OT:
Years ago I built a Z80 SBC with an FDC chip and a floppy drive. During disk read/writes, software had the job of waiting on the FDC chip and then transferring each byte at the appropriate instant. That worked fine, and I even had some extra speed to spare. But later when I updated the project to manage 1.44M
high-density floppies, the byte rate doubled. The loop had to run twice as fast -- but still synchronizing with DRQ, the "go" signal from the FDC. Polling the chip's DRQ bit (using an IN instruction followed by a conditional backward branch) was no longer feasible.
As a speedy substitute for explicitly polling DRQ, I doubled the size of the EPROM and filled it with two copies (images) of its original contents. But the wiring was such that the CPU could only "see" one image at a time,
as determined by the state of DRQ. I had the EPROM's MS address line fed (via a flipflop) from the FDC's DRQ pin --
not the CPU!
The two images were identical except for a few bytes in the FDC routines. Just before the critical byte-transfer instructions, one image would have an unconditional branch-to-self (ie, "wait"), and the other image would have NOPs (ie, "now go ahead")!
[
Edit]: my recollection is foggy; maybe there weren't actually NOP's in there. In hindsight I see it would be better to omit those -- IOW better if, congruent with the branch-to-self, was the first instruction of the byte-transfer sequence -- which, unlike a NOP, does useful work!
_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html