I’ve been landed with the job of writing a driver for a device which doesn’t
generate interrupts, and therefore must be polled for data at least once
every millisecond. The DDK isn’t too forthcoming with info on exactly how to
go about doing this, and recommends avoiding it “unless absolutely
necessary” - can anyone provide an explanation or example for a relative
beginner to the field?
Cheers
James
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Polling a device is not difficult, the driver initializes a kernel timer using KeInitializeTimer and starts the timer with KeSetTimerEx. When the timer expires a driver defined DPC routine is
called, in which you can poll your device.
The hard (impossible?) part is doing this once a millisecond, every millisecond. Win2k is not real time and can’t be controlled that precisely. In drivers I have written I couldn’t count on even a 10 mSec timer. It would run at 10 mSecs most of the time, however when network or other device activity was high, a poll would be delayed.
So, if “polling as fast as possible” is acceptable, a timer may work. However, if polling once a millisecond is a hard requirement, I believe you will need a hardware interrupt.
Larry
-----Original Message-----
From: James Wain [mailto:xxxxx@vutrix.com]
Sent: Tuesday, September 04, 2001 8:06 AM
To: NT Developers Interest List
Subject: [ntdev] Polling a device
I’ve been landed with the job of writing a driver for a device which doesn’t
generate interrupts, and therefore must be polled for data at least once
every millisecond. The DDK isn’t too forthcoming with info on exactly how to
go about doing this, and recommends avoiding it “unless absolutely
necessary” - can anyone provide an explanation or example for a relative
beginner to the field?
Cheers
James
You are currently subscribed to ntdev as: xxxxx@diebold.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com