Route Signals
The Behavior can route some of its signals to other hardware without a round-trip through the computer. The mimic registers (MimicPort0IR, MimicPort0Valve, and their Port 1/2 counterparts) copy a poke's infrared or valve state onto a digital output, and the EnableSerialTimestamp register streams the device clock over the Port 2 serial line. The examples below use Port 0 and the DO0/DO2 outputs.
Warning
Only use DO0 and DO2 as mimic targets. In the current firmware, selecting DIO0–DIO2 does not drive the DIO line, and selecting DIO0, DIO2, DO1, or DO3 erroneously reconfigures the poke infrared inputs and stops poke detection on all ports until the device is reset.
The complete workflow is shown below:
Mimic Poke Inputs
When a mimic target is set for a poke's infrared beam, the target output follows the beam state in hardware — useful for triggering external equipment directly from a poke.
- Insert a
KeyDownoperator and set theFilterproperty toA. - Insert a
CreateMessageoperator and configure the following properties:Payload- SelectMimicPort0IRPayload.MimicPort0IR- SelectDO0.
- Insert a
MulticastSubjectoperator namedBehavior Commands.
In a separate branch:
- Insert a
KeyDownoperator and set theFilterproperty toS. - Insert a
CreateMessageoperator and configure the following properties:Payload- SelectMimicPort0IRPayload.MimicPort0IR- SelectNone.
- Insert a
MulticastSubjectoperator namedBehavior Commands.
Run the workflow, press A, and block the Port 0 infrared beam — DO0 follows the beam state. Press S to remove the routing.
Mimic Valves
The valve state can be routed the same way, for instance to record reward delivery on an external acquisition system:
- Insert a
KeyDownoperator and set theFilterproperty toD. - Insert a
CreateMessageoperator and configure the following properties:Payload- SelectMimicPort0ValvePayload.MimicPort0Valve- SelectDO2.
- Insert a
MulticastSubjectoperator namedBehavior Commands.
Run the workflow, press D, then open the Port 0 valve with OutputSet — DO2 follows the valve state, including timed pulses.
Stream Timestamps
The EnableSerialTimestamp register enables a serial transmission of the device clock on the Port 2 connector: at the start of every second, the current Harp timestamp is sent as 4 bytes (32-bit seconds, least significant byte first) at 1000 bps. External equipment can decode this stream to align its own data with the Harp clock.
- Insert a
KeyDownoperator and set theFilterproperty toF. - Insert a
CreateMessageoperator and configure the following properties:Payload- SelectEnableSerialTimestampPayload.EnableSerialTimestamp- SelectTimestampPort2.
- Insert a
MulticastSubjectoperator namedBehavior Commands.
Run the workflow and press F — the timestamp stream starts on the Port 2 serial line at the next second boundary.
Last updated with:
Hardware v2.1
Firmware v3.3
Bonsai Package v0.2