Hi there,
I've programmed an experiment using PTB-3 (for a Windows XP system) and need to add code for sending event codes to an EEG system via the parallel port.
I learned about PortTalk after finding the FAQ on TTL triggers via the parallel port. I also read about how Screen('Flip') works and the variables it returns for timing information. The Flip documentation and the posts that I have found here suggest to me that the correct way to sync events codes with stimulus onsets is to call lptwrite once Screen('Flip') returns after being paused.
But I had second thoughts after re-reading the Setting Up an ERP Lab section in Steven Luck's Event-Related Potential Technique book. Specifically, on pg. 328 it says that the sequence of events below should be followed to ensure correct timing: "a) wait of the interrupt signal, b) send an event code, c) draw the stimuli in a manner that ensures that any changes in the intensity values stored by the frame buffer occur after the interrupt but before those values are read by the raster beam."
It sounds like the trigger is sent immediately *before* the flip occurs in this description. Since the book was written a while ago, I'm assuming that the sequence could refer to how to implement correct timing for triggers with previous versions of PTB or other stimulus presentation software.
But I'd like to know for sure. So my question is: Is the correct approach to call lptwrite immediately after Screen('Flip') returns? Or can the trigger be somehow synced to stimulus onset by calling lptwrite immediately before the flip occurs?
Many thanks,
Naveed
I've programmed an experiment using PTB-3 (for a Windows XP system) and need to add code for sending event codes to an EEG system via the parallel port.
I learned about PortTalk after finding the FAQ on TTL triggers via the parallel port. I also read about how Screen('Flip') works and the variables it returns for timing information. The Flip documentation and the posts that I have found here suggest to me that the correct way to sync events codes with stimulus onsets is to call lptwrite once Screen('Flip') returns after being paused.
But I had second thoughts after re-reading the Setting Up an ERP Lab section in Steven Luck's Event-Related Potential Technique book. Specifically, on pg. 328 it says that the sequence of events below should be followed to ensure correct timing: "a) wait of the interrupt signal, b) send an event code, c) draw the stimuli in a manner that ensures that any changes in the intensity values stored by the frame buffer occur after the interrupt but before those values are read by the raster beam."
It sounds like the trigger is sent immediately *before* the flip occurs in this description. Since the book was written a while ago, I'm assuming that the sequence could refer to how to implement correct timing for triggers with previous versions of PTB or other stimulus presentation software.
But I'd like to know for sure. So my question is: Is the correct approach to call lptwrite immediately after Screen('Flip') returns? Or can the trigger be somehow synced to stimulus onset by calling lptwrite immediately before the flip occurs?
Many thanks,
Naveed