Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnalogIO refactoring and support for buffering and data type conversions #92

Merged
merged 19 commits into from
Jun 4, 2024

Conversation

glopesdev
Copy link
Collaborator

@glopesdev glopesdev commented May 14, 2024

  • Adds support for buffering analog input and output data
  • Adds support for optional data type conversion to/from Volts
  • Introduce AnalogInputDataFrame and expose analog data using Mat types
  • Fixes issue where input ranges were not being assigned to every channel
  • Disallow reconfiguring IO channel direction at runtime
  • Refactor all properties to remove ordering prefix

Fixes #79

@glopesdev glopesdev added the feature New planned feature label May 14, 2024
@glopesdev glopesdev added this to the 0.1.0 milestone May 14, 2024
@glopesdev glopesdev requested review from jonnew and aacuevas May 14, 2024 09:28
@glopesdev glopesdev self-assigned this May 21, 2024
@jonnew
Copy link
Member

jonnew commented May 22, 2024

The order of samples in the buffer is currently incorrect. We need somehow to get each channel (C) sample from raw frames:

 [C0, C1, ..., C11] 

into the analog buffer with a BufferSize-sample (N) stride:

[C0_0, C0_1, ..., C0_N, C1_0, C1_1, ..., C1_N, ..., C11_0, C11_1, ..., C11_N]

Currently, data is ordered like this:

[C0_0, C1_0, ..., C11_0, C0_1, C1_1, ..., C11_1, ..., C0_N, C1_N, ..., C11_N]

The obvious ways of doing this will have a significant performance impact, I would imaging (e.g. looping over the data).

@glopesdev
Copy link
Collaborator Author

@jonnew oh, so it's actually a demuxed row major order? That's even better, I can just get rid of the transpose then, and it will be even more efficient!

Copy link
Member

@jonnew jonnew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from these issues, I'm encountering a strange behavior with my hardware. If I ground an analog input, I see a significant offset voltage (-1V or so). I'm not sure if this an issue with my hardware, hardware design, or HDL. If you can try to reproduce it would be helpful.

OpenEphys.Onix/OpenEphys.Onix/AnalogInput.cs Show resolved Hide resolved
OpenEphys.Onix/OpenEphys.Onix/AnalogOutput.cs Outdated Show resolved Hide resolved
OpenEphys.Onix/OpenEphys.Onix/BufferHelper.cs Show resolved Hide resolved
@glopesdev glopesdev requested a review from jonnew May 23, 2024 08:25
@jonnew
Copy link
Member

jonnew commented May 28, 2024

I have verified that this now appears to be functioning well. There is an issue with the analog input, but I think its either hardware or gateware related and may even be specific to my prototype hardware. Its documented here: open-ephys/onix-fmc-host#8. Let me know if you see this -0.9V offset on grounded analog inputs on your hardware when you have time to test

@glopesdev
Copy link
Collaborator Author

Let me know if you see this -0.9V offset on grounded analog inputs on your hardware when you have time to test

@jonnew Just did the test this morning and I don't see this offset (there was a very slight 20mV offset but this could well be the harp device DIO we used for testing, as we were seeing this on the oscilloscope as well).

@glopesdev glopesdev merged commit a7cd3c5 into main Jun 4, 2024
@glopesdev glopesdev deleted the issue-76 branch June 4, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New planned feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FMC Host Analog IO configuration and streaming
2 participants