OpenBCI / OpenBCI_Cyton_Library

Repository for OpenBCI Cyton Arduino Libraries
MIT License
87 stars 88 forks source link

Changing sample rate breaks impedance measurement #94

Open bmartin427 opened 4 years ago

bmartin427 commented 4 years ago

Changing the sample rate seems to clobber the LOFF register (0x04) of the ADS1299. This can be easily reproduced by using the sequence of serial commands ?, ~6, and ? following reset. The LOFF register has the value 0x02 prior to the sample rate command, and 0x00 afterwards. This value change configures the ADS1299 for DC lead-off detection instead of 31.2Hz AC, which is not what the GUI expects to use.

This issue is the underlying cause of OpenBCI/OpenBCI_GUI#653. However, no wifi board is required to reproduce this issue as described above. Wifi is involved in the original issue only insofar as the GUI only attempts to change the sample rate at startup when using the wifi interface, and not serial.

wjcroft commented 4 years ago

Brad, thanks very much for tracking this down.

bmartin427 commented 4 years ago

I have confirmed that PR #95 makes the 31.2Hz waveform show up in the GUI using the wifi interface when clicking the 'ohm' icons.