S3RD4R

Hi !

I have been trying to drive a pic circuit from computers parallel port. I found a way to reach the port.

My next problem is I have to set one of the pin for 250 nanoseconds and then clear it for 250 nanoseconds. Sleep function is only for miliseconds. so cant use it. The code has to work on all xp using computer no matter the processor speed. Does anybody know how to obtain this Any dll file etc.

Thanks for all.



Re: .NET Base Class Library waiting for nanoseconds

Ryan Lamansky / Kardax

It's not possible to get that level of precision from a multi-tasking operating system like Windows. There's no way to guarantee another running process won't get some CPU time, messing up your timing.

-Ryan / Kardax





Re: .NET Base Class Library waiting for nanoseconds

Greg Beech

Yep indeed - on Windows you'll be lucky to get a granularity better than 10-15 milliseconds.





Re: .NET Base Class Library waiting for nanoseconds

AFLood

What if he put to process priority to real time That should give him better latency, but does he have any way of taking advantage of it




Re: .NET Base Class Library waiting for nanoseconds

Greg Beech

AFLood wrote:
What if he put to process priority to real time That should give him better latency, but does he have any way of taking advantage of it

"real time" on Windows is a bit of a misnomer; it should really be called something like "very high priority". Ultimately Windows isn't a real-time operating system because of its pre-emptive multi-tasking and as such the quanta (aka time slices) allocated to your threads are to a degree randome and unpredictable. Setting "real time" priority on threads may improve matters slightly, but you still shouldn't count on accuracies better than about 10ms.





Re: .NET Base Class Library waiting for nanoseconds

nobugz

It is possible, but it takes a hardware interrupt to get this kind of timing. That takes a kernel mode driver and the DDK, not a lot of fun. You'd probably have an electrical problem too, a 250 nsec pulse doesn't look like much of a pulse anymore at the other end of the cable without a properly terminated transmission line.