I want to make sure I understand the graph - this is presumably showing the TTL value of pin 2 on the parallel port, correct?
No, this is the absolute timing between either 'on' or 'off' signals as per the comments which TTL sends to the ADI box. These signals are 1 second apart and so each point on my graph above represents the time between comments marked at, say 15.016s and 16.016s, which is correct. Or for an error, 30.335s and 31.352s.
When you gathered the data in the graph, were you manually responding in the task, using the monkey, or just running the task without manual or monkey responses? Note that the script will set that particular pin high upon presenting the auditory stimulus and upon receiving a response (e.g., pressing the space bar), so is it possible the second signal represents the response?
I wasn't responding at all, I just left the script. I tried it as well with a modified trial that consisted only of instructions for a) first frame to play sound and sends trigger, then b) trial times out at 1000ms.
Your port definitions above make no difference to the artifact. I have tried a few settings, but nothing seems to make a difference.
I have also changed the latency of the trials in case this was related to the memory. However, even at 10 second (instead of 1 second) intervals, the timing error persists - every 17th TTL comment is 17ms too long as below.
Seeing as this is the same as the monitor refresh rate, I also tried using stimulustimes=0 instead of stimulusframes =1 for the signal - no difference, the error remains.