Link to home
Start Free TrialLog in
Avatar of css
css

asked on

Digital output

I'm programming for an application that writes 2.5 millions
of 9 bit signals on a port (like parallel). The process takes to me about 4.5 seconds and it's too much. I have an ISA card called DAS-1202 (Keithley-Metrabyte).
I would like to make it faster (1 second).
To write on the ports I use c++ _outp.
Solutions?
Avatar of jrhelgeson
jrhelgeson
Flag of United States of America image

Ok, so what's the question?
Avatar of jhance
jhance

There are four factors here affecting the speed of your output to the port:

1) Speed of your CPU (i.e. instructions/second) let's call it MIPS
2) Overhead in your loop (i.e. instructions/loop), say INST
3) Times through the loop (i.e. 2,500,000), call it N
4) Port handshaking time, if any (i.e. seconds of delay), call it T

So you can calculate the total time as:

T = N * [T + (INST/MIPS)]

From the information above, you've told us only about N.  What else is going on in your loop that is slowing things down?
You want speed? Use .ASM. Open a file with the data points, load up the buffer and *GO*.

Your going to run into problems in *any* language in that the first time an interrupt fires your task is going to suspend while the interrupt is serviced. This will give a "dead spot" in your signal. The more the rest of the system is doing, the more dead spots you'll see. This will also occur if your output loop has to hit disk. Ditto for doing any OS calls.

If you want predictable high speed operation you'll need to shut down windows and run on a single threaded DOS box. This will allow you to block interrupts and honk your data stream in one long thread. You'll tie up 5Mb of RAM just to hold your data (9 bits, you'll have to use 16bit words to hold the data.) Basic output loop is trivial, but you'll need to preload RAM with the data so you don't have to hit disk while you're running.

M
Avatar of css

ASKER

I want to know what's the best hardware for digital output ... tell me a product like DAS-1202 (Keithley Metrabyte). I want 16 bit output otherwise I used the parallel.

Why dont you get a PCI parallel port card? You can also use an extra ide channel as a 16 bit parallel port.
I've always had good luck using 8255 based devices. They're very flexible and with 24 I/O lines you can pretty well configure what you need. What to use for output depends on what you're driving.

M

Avatar of css

ASKER

What's 8255 based devices? Have you got a product name and an internet address where I can read for information?

Thank
ASKER CERTIFIED SOLUTION
Avatar of mark2150
mark2150

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial