You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -96,29 +96,33 @@ _Given the measurements obtained in Exercise 2, what would you estimate is the *
96
96
97
97
### Exercise 3: Introduction to pulse trains
98
98
99
-
In neuroscience, pulse trains are commonly used to deliver precisely timed sequences of electrical states (`LOW` and `HIGH`) to control external devices, such as cameras for synchronization or lasers for optogenetic stimulation. However, due to operating system limitations, generating pulse trains by setting [`DigitalOutputSet`] and [`DigitalOutputClear`] in software like Bonsai can be prone to timing jitter (though this approach is sufficient for the stimuli we have been working with). Fortunately the `Hogoblin` provides dedicated `Registers` that can be used to start or stop hardware-programmed pulse trains. We will use such pulse trains as our close-loop stimuli for the next few exercises.
99
+
In neuroscience, pulse trains are commonly used to deliver precisely timed sequences of electrical states (`LOW` and `HIGH` - otherwise known as transistor-transitor-logic or `TTL`) to control external devices, such as cameras for synchronization or lasers for optogenetic stimulation. However, due to operating system limitations, generating pulse trains in software like Bonsai can be prone to timing jitter (though this approach is sufficient for the stimuli we have been working with). Fortunately the `Hogoblin` provides dedicated `Registers` that can be used to start or stop hardware-programmed pulse trains.
- Connect a red LED module to digital output channel `GP15` on the `Hobgoblin`.
102
106
- Insert a [`KeyDown`] operator and set the `Filter` property to the key `A`.
103
107
- Insert a [`Parse`] operator and select [`StartPulseTrainPayload`] from the `Register` property dropdown menu. Set the `DigitalOutput` property to `GP15`.
104
-
- Set the `PulseCount` property to `0`, `PulsePeriod` to `50000` and `PulseWidth` to `5000`. These parameters correspond to a continuous 20Hz pulse train with 5 ms pulses.
108
+
- Set the `PulseCount` property to `0`, `PulsePeriod` to `50000` and `PulseWidth` to `5000`. These parameters correspond to a continuous 20 Hz pulse train with 5 ms pulses.
105
109
- Insert a [`MulticastSubject`] operator and configure the `Name` property to `Hobgoblin Commands`.
106
110
- Insert another [`KeyDown`] operator and set the `Filter` property to the key `S`.
107
111
- Insert a [`Parse`] operator and select [`StopPulseTrainPayload`] from the `Register` property dropdown menu. Set the `StopPulseTrain` property to `GP15`.
108
-
- Run the workflow, use the `A` and `S` keys to start and stop the pulse train.
112
+
- Run the workflow, use the `A` and `S` keys to start and stop the pulse train.
109
113
**What do you observe?**
110
114
111
115
To better understand what each parameter controls, try the following modifications. Reset the values to the parameters above after each step.
112
116
113
-
- Increase the `PulsePeriod` to `200000`. What is the frequency of this stimulation? How would you increase the frequency of the pulses to 40Hz?
117
+
- Increase the `PulsePeriod` to `200000`. What is the frequency of this stimulation? How would you increase the frequency of the pulses to 40 Hz?
114
118
- Increase the `PulseWidth` to `40000`. What do you observe?
115
119
- How would you deliver a 2 second pulse train? (Hint: Use `PulseCount`)
116
120
117
121
>[!NOTE]
118
-
> **Optional** Verify the pulse train by connecting the output to a digital input pin. How would you visualize the results using what you've learned?
122
+
> **Optional** Verify the pulse train by connecting the output to a digital input pin.
119
123
120
-
>[!NOTE]
121
-
> **Optional**If you have cameras that support external hardware triggering, use what you have learned in this exercise to trigger frame capture.
124
+
>[!TIP]
125
+
> If your cameras support external triggering, you can use pulse trains to trigger frame capture. Recording the same pulse train on a digital input with the `Hobgoblin` allows you to have hardware timestamped images that are automatically aligned with other acquired data.
0 commit comments