open-ephys / bonsai-onix1

Bonsai library for the Open Ephys Onix Acquisition System
https://open-ephys.github.io/bonsai-onix1-docs/
MIT License
4 stars 3 forks source link

Incorrect data type for BreakoutAnalogOutput #205

Closed jonnew closed 2 months ago

jonnew commented 2 months ago

The analog outputs on the breakout board requires unsigned 16-bit integer data that is interpreted by the hardware as offset binary:

https://open-ephys.github.io/onix-docs/Hardware%20Guide/Datasheets/fmc-analog-io.html#host-to-device-data-frames

However, signed data is used throughout the output node resulting in incorrect values being sent to the hardware:

https://github.com/open-ephys/onix-bonsai-onix1/blob/7ac700fb8a696d4d9f8d97c9d1b85765b9951ca6/OpenEphys.Onix1/BreakoutAnalogOutput.cs#L100

This issue applies to both Volts and S16 output options because they are both ultimately transformed to S16 before being sent.

image

jonnew commented 2 months ago

Fixed in #213