Re: How to precisely control timing write I/O to lpt with driver?
From: Maxim S. Shatskih (maxim_at_storagecraft.com)
Date: 10/11/04
- Next message: H. H. CHAO: "Resume from suspend and USB storage driver may continue copying fi"
- Previous message: Maxim S. Shatskih: "Re: PCI Bus filter - can you attach it dynamically?"
- In reply to: lptguy: "How to precisely control timing write I/O to lpt with driver?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 11 Oct 2004 14:37:00 +0400
I don't think such things are possible in Windows at all. You can probably
achieve some results, but not robust enough to make a product based on this.
Develop the USB hardware and forget the obsolete LPT port. Note that most
new laptops have no LPT.
Or another way - rely on hardware strobes on LPT port and ECP mode DMA to
transfer the bytes, not on interrupts or host CPU code timings.
-- Maxim Shatskih, Windows DDK MVP StorageCraft Corporation maxim@storagecraft.com http://www.storagecraft.com "lptguy" <lptguy@discussions.microsoft.com> wrote in message news:EA8A9B71-400B-4F87-B6D7-68072EF83425@microsoft.com... > can someone tell me how to precisely control timing to write I/O out to Lpt > with kernel mode driver? > > I had compiled and modified a kernel mode parallel port driver, a user mode > dll to export I/O read and write, and a MFC application that issues I/O read > and write through the driver to an externel device connected to the parallel > port. Everything seem like ok, but when i use QueryPerformanceCounter and > QueryPerformanceFrequency api in the MFC application to obtain accurate > desired timing delay (in nanosecond accuracy), the application writing out a > waveform to the Lpt to the external device, may not appear as accurate as > desired. Sometime the delay appear longer, though most of the time it works > fine. In some computer it has such delay error appear at every particular > interval. And it will not produce a desired delay when a CD or music is > played at the computer. > > below is the source code: > > do{ > BOOL bResult = ::QueryPerformanceCounter(&liCurrentCnt); > if(liCurrentCnt.QuadPart < liBeginCnt.QuadPart) > { > AfxMessageBox("Error occured in timing!"); // never happen > break; > } > }while(liCurrentCnt.QuadPart < liMaxBoundCnt.QuadPart); > > Is there any solution to this problem? > > Is there any method in kernel mode driver, that I can hog the CPU processing > for a certain amount of time? > > Or is there any way can I put my application thread or driver service > routine to the highest priority that no other software can interrupt it? > > Can anyone please help? >
- Next message: H. H. CHAO: "Resume from suspend and USB storage driver may continue copying fi"
- Previous message: Maxim S. Shatskih: "Re: PCI Bus filter - can you attach it dynamically?"
- In reply to: lptguy: "How to precisely control timing write I/O to lpt with driver?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|