|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 2/26/2009 4:20:13 PM
Posts: 3,
Visits: 17
|
|
| Has anyone tried to do this? I am using a USB to Serial cable (effectively convincing the computer the USB is a serial port), and trying to send TTLs following participant responses during a cognitive task (to trigger recording on another computer). Is there a way to do this? Perhaps I have missed it in the documentation, certainly for Parallel port this is straightforward. However, through serial port, this seems less so. Using e-prime version 1. Any suggestions are welcome.
|
|
|
|
|
Forum MVP
      
Group: Forum Members
Last Login: Today @ 4:31:15 PM
Posts: 641,
Visits: 2,014
|
|
This may work, but most likely not in the way that you want. First, the serial port does not control a steady TTL signal, instead it sends a series of individual and changing digital bits down a single wire (hence, "serial"). Second, it does not use TTL voltages (0V & 5V), instead it uses +/-3 to 15V. This is all follows the Electronics Industries Association standard RS-232-C of 1969. The serial port is really meant for communication of multiple-bit messages between equipment (hence, the serial port is also refered to as a communications or "COM" port), so this will only work if the equipment you want to control also has such an interface built in. But since you want to control a second computer, it may have a serial port. In that case you must program the second computer to await and respond to some message received through its serial port.
But don't take my my word for this. Do your own Google search with terms such as "serial port" or "rs232" and you should find pages such as http://en.wikipedia.org/wiki/Serial_port and http://en.wikipedia.org/wiki/RS-232. Or look at "Serial Port Complete" by Jan Axelson. For more information on TTL in general, I recommend the "TTL Cookbook" by Donald Lancaster. And for even more background on this and related matters I recommend "The Art of Electronics" by Horowitz and Hill. You should find these books at Amazon.com, or perhaps your local library.
Now I suppose you ask this because you have a newer "legacy free" computer that has only USB ports and thereby lacks parallel and serial ports. If at all possible I would install an adapter card to add a genuine parallel port or serial port as needed, or maybe even a digital I/O board from somplace like http://www.measurementcomputing.com/. But perhaps you have a laptop that does not allow adapter cards. In that case you may need some way to control digital I/O over a USB port. Ramsey Electronics (http://www.ramseyelectronics.com/) sells a kit for $50 to provide digital I/O through USB, but I do not know if E-Prime can use that and I have not tried this yet myself. Another path would be a PST Serial Response Box with your USB-to-serial adapter. I have gotten this to work for input from a SRBox. The SRBox also has a connector for providing 8 bits of digital output using E-Prime, just follow the manual that comes with the SRBox. However, I have not tried doing digital output through the SRBox over a USB-to-serial connector, that would be an adventure, but I suspect that will work. Then if you cared about critical timing you would still have to test that with, say, an oscilloscope.
- David McFarlane, Professional Faultfinder
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 12/1/2008 1:43:11 PM
Posts: 2,
Visits: 3
|
|
you may be able to do this via MIDI, i'm not sure if someone has written a MIDI interface for ePrime, but it's certainly possible. most recording software suports some kind of MIDI machine control, or possibly accepting single bytes in the serial port to control the recording functions...
i agree that you don't need a TTL signal to do this, just output a single byte and have the other system read it, in ePrime, Serial.WriteString()...
-m
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 2/26/2009 4:20:13 PM
Posts: 3,
Visits: 17
|
|
Thanks so much for the replies.
Here is the thing, I am using the following device:
http://www.ftdichip.com/Products/EvaluationKits/TTL-232R.htm
http://www.ftdichip.com/Documents/DataSheets/Modules/DS_TTL232R.pdf
Which, through some magic I don't understand allows me to send +5 volts via a USB port masquerading as a serial device.
However, I am still so very confused (and this may be because of what you have explained to me regarding how serial communication works).
When I send text to the serial port via e-prime, the volts do indeed change (checking using a voltmeter) and it ranges up to +5. But I am having difficulty setting the volts to zero. Is this not possible? Is there any way to set the output to nothing via writestring? Would FlushOutBuffer accomplish anything?
Anyhow, any suggestions you may have would be greatly appreciated.
|
|
|
|