Skip to content

feat(cyton): per-channel config, AUX analog mode, buffer drain, FTDI latency check - #343

Open
pellet wants to merge 1 commit into
NeuroTechX:masterfrom
pellet:feat/cyton-device-config
Open

pellet wants to merge 1 commit into
NeuroTechX:masterfrom
pellet:feat/cyton-device-config

Conversation

@pellet

@pellet pellet commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Configuration and recording options for the OpenBCI Cyton.

  • eegnb.devices.cyton: cyton_ch_config() builds per-channel gain and BIAS settings from the GAIN_* codes, and thinkpulse_config() does the same for ThinkPulse active electrodes. Channel commands are retried up to 3 times when the board doesn't reply Success, which is usually a dropped serial reply.
  • EEG(analog_mode=True) switches the Cyton to analog mode (/2) and records the AUX pins as AUX0… columns, for any analog sensor such as a photodiode.
  • EEG.drain() writes the recording so far. BlockExperiment calls it after each block, so the pattern-reversal VEP keeps completed blocks if a session crashes, and long sessions stay clear of BrainFlow's ring buffer, which wraps after 30 minutes at 250 Hz.
  • On Windows, connecting a Cyton now stops with an error unless the FTDI dongle's LatencyTimer is 1 ms. With the 16 ms default, samples reach the host in bursts, so BrainFlow's arrival timestamps, and the markers aligned to them, can be off by up to a batch of samples. OpenBCI recommends the same setting (https://docs.openbci.com/Troubleshooting/FTDI_Fix_Windows/), and doc/misc/ntcs_phase1_instructions.md already calls it "a major gotcha". Existing Windows users need to set it once per dongle, and again if a driver update resets it. The error message says where and links OpenBCI's guide, and the Cyton section of doc/getting_started/streaming.md now covers it.

…latency check

Configuration and recording options for the OpenBCI Cyton.

- `eegnb.devices.cyton`: `cyton_ch_config()` builds per-channel gain and BIAS settings from the `GAIN_*` codes, and `thinkpulse_config()` does the same for ThinkPulse active electrodes. Channel commands are retried up to 3 times when the board doesn't reply `Success`, which is usually a dropped serial reply.
- `EEG(analog_mode=True)` switches the Cyton to analog mode (`/2`) and records the AUX pins as `AUX0`… columns, for any analog sensor such as a photodiode.
- `EEG.drain()` writes the recording so far. `BlockExperiment` calls it after each block, so the pattern-reversal VEP keeps completed blocks if a session crashes, and long sessions stay clear of BrainFlow's ring buffer, which wraps after 30 minutes at 250 Hz.
- On Windows, connecting a Cyton now stops with an error unless the FTDI dongle's LatencyTimer is 1 ms. With the 16 ms default, samples reach the host in bursts, so BrainFlow's arrival timestamps, and the markers aligned to them, can be off by up to a batch of samples. OpenBCI recommends the same setting (https://docs.openbci.com/Troubleshooting/FTDI_Fix_Windows/), and `doc/misc/ntcs_phase1_instructions.md` already calls it "a major gotcha". Existing Windows users need to set it once per dongle, and again if a driver update resets it. The error message says where and links OpenBCI's guide, and the Cyton section of `doc/getting_started/streaming.md` now covers it.
@pellet
pellet force-pushed the feat/cyton-device-config branch from 146f879 to e3340c6 Compare October 5, 2026 11:19
@pellet
pellet marked this pull request as ready for review October 5, 2026 11:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant