Re: fast parallel port read




"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




.



Relevant Pages

  • Re: Growing memory usage in D4 app with SerialNG
    ... Borland C, but it will not run on a true Windows platform because it uses the parallel port with direct hardware register bit banging, ... Windows requires drivers or other privileges for direct access to the hardware. ... I'd separate all hardware and platform dependencies in future versions or applications, and exchange that implementation according to the target platform. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Windows Vista and DMX-512 interfaces + software
    ... Windows 2000 PCs. ... new PC that runs Windows Vista and does not have a parallel port, ... You will truly struggle to find ANY DMS software/dongle with Vista ... It is questionable that he would have Vista drivers for the interface. ...
    (rec.arts.theatre.stagecraft)
  • Re: Mach 3 Crashing PC
    ... even tried turning the parallel port off. ... accounting is the same identical machine, and it runs Mach 3 just fine. ... I run both Ubuntu Linux and Windows XP ... You might have to go in and unload the printer driver before ...
    (rec.crafts.metalworking)
  • Re: Are you considering an Apple Mac/iMac? ...
    ... than Windows. ... BSD (i.e. OS-X) can be hacked as fast as Windows, ... on my Win98SE I get those little "monitor icons" (two of them that show up in the lower right task bar and the screens blink from dark green to light green when data flows out (lower screen) and data flows in and I can get an idea if something is downloading onto my box and it shouldn't be. ... For mass storage I have a boxfull of old 100 MB Iomega zip drives that run off the parallel port; work fine for me (I don't do movies, audio, high pixel ...
    (sci.research.careers)
  • Re: Parallel Port-like access in windows xp
    ... And I'm running legacy parallel port hardware with the original DOS ... >> fine in a Windows 98SE DOS box. ...
    (microsoft.public.windowsxp.hardware)