|
From: Roger B. <an...@xp...> - 2018-05-19 20:17:14
|
Hi David, On 19 May 2018 at 8:16, David Gálvez wrote: > 2018-05-18 22:19 GMT+02:00 Roger Burrows <an...@xp...>: > > > > Something similar to this is done in EmuTOS, in case you haven't noticed. > I > > I saw the this approach for the nanoseconds delay in the USB TOS > drivers that took the idea from EmuTOS. > > > think that, unless you really expect MiNT to run native on modern PCs, > trying > > to get a nanosecond-level value is a bit optimistic. > > > > Having 1 nsec granularity is very optimistic I know :-), but if my > calculations are correct with a 060 at 66 Mhz you can have between 15 > nsec and 20 nsec granularity that is not so bad. > Yeah, those seem about the correct numbers, but (apart from overclocking) that is as fast as you can go. On a more typical Atari system (e.g. a TT at 32MHz), the granularity is about 250 nsec, and on an 8MHz ST, it's about 2500 nsec. For delays in the 100 nanosecond range (as required by some USB hardware), this will result in sub-optimal performance. The only way around this that I've been able to come up with is separate binaries: for e.g. base STs you use a NOP instead of a delay loop. On an 8MHz 68000 system, that would be a 500 nsec delay but that's as good as possible I think. The real solution is not to use hardware that requires software delays. But that isn't always an option. Roger |