Table of Contents

Advanced Configuration

These advanced configuration settings affect which data the Behavior board broadcasts. By default, all events are enabled, but you can selectively disable certain events. The device can also transmit serial timestamps on the peripheral port P2 for logging and post-hoc alignment on non-Harp devices. Refer to the connections article to set up the hardware connection for the serial timestamp.

This article covers how to visualize the default event streams, select the active events, and stream serial timestamps in Bonsai.

The complete workflow is shown below. Copy and paste it into Bonsai or build each section by following the step-by-step instructions below.

Advanced Configuration

Visualize Analog Data

To see one of the default streams, visualize the AnalogData event, which reports the analog inputs at 1 kHz (see Acquire Analog Data for more details):

Visualize Analog Data

Run the workflow. The visualizer immediately displays a rapid stream of AnalogData values, confirming that the event is enabled by default.

Select Active Events

The EventEnable register selects which event streams the device broadcasts, write a new selection to select the streams you want to keep. Any event not selected in the payload is disabled.

Select Active Events

  • Insert a KeyDown operator and set the Filter property to A.
  • Insert a CreateMessage operator and configure the following properties:
    • Payload - Select EventEnablePayload.
    • EventEnable - Enter PortDI, PortDIO, Camera0, Camera1 to disable the AnalogData event and keep the rest.
  • Insert a MulticastSubject operator named Behavior Commands.

Run the workflow and press A. The visualizer will stop showing any new AnalogData events.

Stream Timestamps

The EnableSerialTimestamp register enables the serial timestamp stream, an auxiliary output that can be used by non-Harp devices for logging and post-hoc alignment.

At the start of every second, the device transmits its current time in whole seconds as a 32-bit unsigned integer in 4 bytes, least significant byte first. The transmission format is serial (UART) data at 1000 bps, with 8 data bits, no parity, and one stop bit.

Record this signal on a digital input and decode it offline during postprocessing to align the data on the non-Harp device with other Harp data.

To enable the stream:

Stream Timestamps

  • Insert a KeyDown operator and set the Filter property to S.
  • Insert a CreateMessage operator and configure the following properties:
    • Payload - Select EnableSerialTimestampPayload.
    • EnableSerialTimestamp - Select TimestampPort2. On older package versions, if this dropdown option is not visible, enter 4 (this value enables the SerialTimestampPort).
  • Insert a MulticastSubject operator named Behavior Commands.

Run the workflow and press S. The timestamp stream starts on the P2 serial line at the next second boundary. Verify the signal on the digital input line on the external device, it should appear as a series of digital input transitions at one second intervals.

Note

The serial timestamp stream is not the same as the Harp synchronization clock, which keeps connected Harp devices synchronized. The Behavior board does not generate the Harp synchronization clock and can only receive it. For a Harp synchronization clock generator, consider the Harp Timestamp Generator Gen3.



Last updated with:
Hardware v2.1
Firmware v3.3
Bonsai Package v0.2