TTL pulse

David McFarlane mcfarla9 at msu.edu
Wed Apr 8 15:32:32 UTC 2009


At 4/6/2009 04:27 AM Monday, David Moore wrote:
>Dear all,
>
>I've written a script to present attentional tasks to participants however
>I need to send a TTL pulse to an external device at random intervals.
>
>I'm using eprime 2 and I have added the parallel port in the devices and
>left the standard settings. I've then put in an inline with the command
>WritePort &H378, 255 however I am not getting any pulse.
>
>Can anyone help?
>
>Dave

To send a pulse, you must both turn the pulse on and then turn it 
off, with some duration in between.  WritePort &H378, 255 will just 
set all bits to 1, you still need to wait a moment and then send them 
back to 0.  Something like this:

WritePort &H378, 255  ' all bits to 1
Sleep 20  ' wait 20 ms
WritePort &H378, 0  ' all bits back to 0

Of course, you should first initialize all bits to 0 way at the start 
of your program.  And this assumes that &H378 is the correct port for 
your case, you may need to contact your IT staff to verify 
that.  Finally, I think PST has a sample program at their website 
that you can download to demonstrate some of this.

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