sending ttl pulse

David McFarlane mcfarla9 at msu.edu
Tue Feb 10 17:07:21 UTC 2009


Dave,

>I've been programming in eprime for a little while now but have come across
>a problem with trying to get eprime (2) to communicate with an external
>device. The device that I'm sending the pulse to is a Pathway ATS
>stimulator (<http://www.medoc-web.com/medoc_en_pathwayAts.aspx>). The pulse
>in port appears to be a BCN port and I am wondering if anyone can a)
>recommend the cable that would be best for sending a pulse down and b) the
>code for sending an on/off pulse.

Did you by any chance mean a "BNC" port?  If so, the next question is 
whether that takes a standard TTL (0V to 5V) pulse.  And if that is 
so I would look into sending the pulse out the parallel (lpt) port, 
after making a custom lpt-to-BNC cable.  At the lpt end of the cable 
(a DB-25 female) I would use pin 18 for signal ground, and pin 2 for 
data.  You would have to figure out the lpt port # on your computer, 
typically is uses &H378 for the data.  In that case you might use code like

' I hate "magic" numbers, so make constants instead:
Const  lptDataPort as Integer = &H378
Const  pulseDur as Integer = 20  ' ms
WritePort lptDataPort, 1  ' turn on pulse
Sleep pulseDur
WritePort lptDataPort, 0  ' turn off pulse

or, if you want to hedge your bets, turn on *all* the bits above with

...
WritePort lptDataPort, &HFF  ' turn on pulse
...

And if you search around the list archives or the PST Forum you can 
probably find more instructions on this.

Alternatively, if you have a SRBox and an expansion kit (or can make 
your own expansion cable), then you can send the pulses through that.

-- David McFarlane, Professional Faultfinder


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en
-~----------~----~----~----~------~----~------~--~---



More information about the Eprime mailing list