Time control using the LPT port

  • Thread starter Bruno Alexandre Rodrigues
  • Start date
B

Thread Starter

Bruno Alexandre Rodrigues

I am programming using VC++.
I know how to change bits on the LPT.
The problem is: How can I do it controlling the time step, if it is less than 1 millisecond?

I know how to do it if it more than 1 millisecond. I place a windows timer and an interrupt. The problem is that the timer resolution is 1 millisecond.

If i want to change the LPT bits every 100 microseconds, for instance, how can I do it?

Please help me if you can, because it is very important to me.

Thank you very much.
 
R

Robert Scott

You cannot do it in Windows unless you write a kernel mode device driver, which is very hard. Normal application programs in Windows are subject to arbitrary delays introduced by the pre-emptive multi-tasking of the operating system.

If you really want to achieve 100 microsecond resolution, boot up the computer in pure DOS and run a DOS program. 100 microsecond resolution can be achieved in DOS by reading the 8254 timer chip on-the-fly. Or you can use the RDTSC instruction of the Pentium chip.

Robert Scott
Real-Time Specialties
Embedded Systems Consulting
 
Top