BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

fast parallel port read

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
B.r.K.o.N.j.A.
Guest





PostPosted: Fri Jan 13, 2006 12:00 pm    Post subject: fast parallel port read Reply with quote



I need to make an windows app. which reads from parallel port 1000 times per
second and stores value (if any) in memory, any sugestions? Component
advice? Useful links? Any known problems considering read speed? The
programming and parallel port reading is no problem, I like to think of
myself as an experienced Delphi programmer. I just never had done this kind
of parallel port reads. (usually I just write to them Smile)

Thanks,

Brko


Back to top
Maarten Wiltink
Guest





PostPosted: Fri Jan 13, 2006 1:39 pm    Post subject: Re: fast parallel port read Reply with quote



"B.r.K.o.N.j.A." <thebrkonja (AT) inet (DOT) hr> wrote


Quote:
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.


Quote:
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



Back to top
Paul E. Schoen
Guest





PostPosted: Sat Jan 14, 2006 5:15 am    Post subject: Re: fast parallel port read Reply with quote




"Maarten Wiltink" <maarten (AT) kittensandcats (DOT) net> wrote

Quote:
"B.r.K.o.N.j.A." <thebrkonja (AT) inet (DOT) hr> wrote in message
news:dq84p2$hm6$1 (AT) ss405 (DOT) t-com.hr...

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





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.