Digital I/O between EPrime and Biopac

859 views
Skip to first unread message

Cate

unread,
Oct 28, 2008, 2:07:00 PM10/28/08
to E-Prime
I am trying to use the ReadPort function to receive a TTL pulse
transmitted via a Biopac MP system. I am using the Biopac STP100C
Digital Interface that connects to the PC running Eprime via a
parallel port. In the product specifications, it specifies the pins
over which TTL pulses can be sent to/from EPrime.

Parallel Port interface (uses standard PC printer port with DSUB 25
connector)
Output from E-Prime: (pins 2-9) connect to MP System Digital I/O lines
8-15
Input to E-Prime: (pins 13-10) connect to MP System Digital I/O lines
4-7

Using the ReadPort(889) or ReadPort(&H379) commands yields the value
120 regardless of whether a TTL pulse is being sent to any or all of
the EPrime input pins. Similarly, using WritePort(888,x) yields no
recognized input on the receiving machine regardless of the value of
x.

Any suggestions, especially from anyone who has successfully used this
hardware setup, would be appreciated.

Thanks in advance,
-Cate

David McFarlane

unread,
Oct 28, 2008, 3:08:29 PM10/28/08
to e-p...@googlegroups.com
Cate,

I have never used a BioPac, but here are a few general thoughts on
the use of a parallel port for I/O in EP.

First, make sure your parallel port really appears at base address
&H378. A few computers put the port at a different base address,
like &H278. You might find the lpt port base address using the
Windows Device Manager.

Second, make sure that the parallel port is configured for the proper
mode and direction. The BIOS in some computers allows you to
configure the parallel port as an old, standard ("legacy") parallel
port, as well as newer bidirectional modes (ECP & EPP?). If you use
a bidirectional mode then you must also set the data direction using script.

I ran a search at the PST Forum using the term "parallel port" and
found the following post which may give you some ideas:

http://support.pstnet.com/forum/Topic1164-8-1.aspx

-- David McFarlane, Professional Faultfinder

Cate

unread,
Oct 29, 2008, 6:50:33 PM10/29/08
to E-Prime
Hi David,

Thanks so much for the feedback!

My parallel port is really at &H378 (888 in decimal). I have now
gotten Writeport (888,x) to work but I am still unable to read from
port 889 (I get a value of 120 regardless of the TTL input I'm
sending). This leads me to believe that I either need to include some
code to enable using the port for input, or that my port is not
correctly configured in the BIOS for input. I checked the BIOS and it
is currently set to ECP mode. Other options available for selection
are EPP and PS/2. Would you recommend using a different mode?

Any advice would be welcome!

Thanks,
Cate

David McFarlane

unread,
Oct 30, 2008, 2:44:05 PM10/30/08
to e-p...@googlegroups.com
At 10/29/2008 06:50 PM Wednesday, Cate wrote:
>I have now gotten Writeport (888,x) to work but I am still unable to
>read from port 889 (I get a value of 120 regardless of the TTL input
>I'm sending). This leads me to believe that I either need to
>include some code to enable using the port for input, or that my
>port is not correctly configured in the BIOS for input. I checked
>the BIOS and it is currently set to ECP mode. Other options
>available for selection are EPP and PS/2. Would you recommend using
>a different mode?

Would not hurt. ECP and EPP are newer "bidirectional" parallel port
modes, PS/2 is the original, standard, "legacy" parallel port
mode. I would try the PS/2 mode first. After that fails I would try
the EPP mode for good measure. After that fails I would follow the
link I sent earlier and try following those instructions. Don't know
what I would do after that fails.

Before all that I would put a volt meter or oscilloscope on the
parallel port inputs to make sure they are what I think they are. I
might also disconnect the BioPac and use another known signal
source. I might also look at the output from the BioPac to make sure
that that is what I think it is. Finally, I might find some other
more primitive software to inspect the state of the parallel port. I
used to do this with the "i" command from the old DOS "debug"
utility, I don't know if that still works with modern Windows. Short
of that I would write a primitive E-Prime script to just continually
display the state of the parallel port (and maybe a few neighboring
ports for good measure), just to make my debugging a little easier.

Reply all
Reply to author
Forward
0 new messages