Skip to content

Rethink Enable logic on ConfigureNeuropixelsVXe operators #468

@jonnew

Description

@jonnew

ConfigureNeuropixelsVXe operators expose an Enable property. This is tied to the DS90UB9x.ENABLE register state.

There is also a per-probe, implicit enable property as well:

if (probeAMetadata.ProbeSerialNumber != null)

If the probe is not detected, then its configuration is skipped and it is de-facto disabled. This is a bit of a logical mess

  1. If Enable is set to false, then why are detected probes being configured even if they are detected? They will ultimately produce no data.

  2. Even worse, if the user sets Enable to false, presumably to test something about acquisition without probes plugged in, then both ProbeSerialNumbers will be null and exception will be thrown:

    if (probeAMetadata.ProbeSerialNumber == null && probeBMetadata.ProbeSerialNumber == null)

    why are we requiring probes to be present when their data will be ignored?

  3. Finally, as a result of playing around with this issue, I found that if probe configuration is skipped then 9 times of 10, this line will throw a "Failure to write register" exception:

    i2c.WriteByte(0x3E, 0x00); // Power mode normal

    Putting a Thread.Sleep(100); before this line "solves" this issue. It seems that we were getting away with this because configuring the Neuropixels, which is currently required, takes a while.

So this is a bit of a mess. At a minimum, if the Enable register is false, the minimal amount of setup should be performed while leaving the probes in powered down state even if they are present. Further, in this case, it should be acceptable for no probes to be detected since the user has indicated they don't want their data anyway.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions