Re: fast parallel port read
- From: "Paul E. Schoen" <pstech@xxxxxxxxx>
- Date: Sat, 14 Jan 2006 00:15:51 -0500
"Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx> wrote in message
news:43c7ad95$0$11070$e4fe514c@xxxxxxxxxxxxxxxxx
> "B.r.K.o.N.j.A." <thebrkonja@xxxxxxx> wrote in message
> news:dq84p2$hm6$1@xxxxxxxxxxxxxxxxx
>
> > I need to make an windows app. which reads from parallel port 1000
>
> Windows for Workgroups (read 95/98/SE/ME) or Windows NT (read NT/2000/XP)?
>
> On any Windows, a parallel port is a shared resource that you _should_
> not try to hoard. But Windows NT actually enforces it.
>
>
> > times per second and stores value (if any) in memory, any sugestions?
> > Component advice? Useful links? Any known problems considering read
> > speed?
>
> One problem suggests itself immediately. At 1000Hz, you have a 1ms cycle
> time. You are _not_ going to work from timer ticks, therefore you are
> going to spinlock and have 100% CPU useage.
>
> Groetjes,
> Maarten Wiltink
>
I made an MSDOS application about 15 years ago that adjusts the system timer
to 2000 ticks per second, and restores the original ISR functions by
dividing down and servicing it at the original 18.2/second. It uses brute
force reads and writes to the actual hardware addresses. I am reading a 12
bit A/D converter on a special hardware device on the parallel port. I think
it works reasonably OK on Win98 and WinMe, but has more major problems with
XP and 2000. Generally, you must use true MSDOS mode, or boot from an MSDOS
disk.
I think there are port drivers that allow access to the port under Windows,
but I have not tried them. I don't know if there is a driver that allows
changing the divide factor for the system clock, especially as it is
probably now be a virtual device. You may need to write or modify a device
driver to use the timer tick interrupt, and I think that may be difficult.
Also, I found that other interrupts, and perhaps the memory manager, kick in
from time to time and cause skewed or missed samples, even using pure MSDOS,
unless you disable EMM386, Himem.sys, etc. Really old technology...
I rewrote my software and redesigned the hardware to use a serial port, and
I can easily read 12 bit data at 2400 samples per second at 57.6 kBaud. I
can provide details of the hardware and PIC code to implement this, as well
as Delphi code (using SerialNG) to read the data and perform other
functions. The actual samples are performed very accurately at 2400/sec. The
windows program runs a data analysis and display each time the buffer gets
480 samples, or 5/sec, which is a comfortable visual update rate.
--
Paul E. Schoen, President
P S Technology, Inc.
Cockeysville, MD
www.pstech-inc.com
.
- References:
- fast parallel port read
- From: B.r.K.o.N.j.A.
- Re: fast parallel port read
- From: Maarten Wiltink
- fast parallel port read
- Prev by Date: Re: TForm OnClose and OnDestroy (and other help needed)
- Next by Date: Re: Fast Fourier Transform Queries
- Previous by thread: Re: fast parallel port read
- Next by thread: Background Intelligent Transfer Service
- Index(es):
Relevant Pages
|