Modify firmware to start in digital mode by default
I'm currently using the board in digital mode by sending /3. I'd like to update the firmware so it starts by defualt in digital mode (/3) .
Is this something I can change in the setup() of DefaultBoard? How should I do it?
void setup() {
// Bring up the OpenBCI Board
board.begin();
// <- change mode here? How?
// Bring up wifi
wifi.begin(true, true);
}
Comments
Skiria, hi.
My quick reading of the source files would suggest that you start with the DefaultBoard.ino file, and modify the
setup()functions as follows:Or if you wanted analog board mode it would be:
board.setBoardMode(board.BOARD_MODE_ANALOG);https://github.com/OpenBCI/OpenBCI_Cyton_Library/tree/master/examples/DefaultBoard
https://github.com/OpenBCI/OpenBCI_Cyton_Library
Also mentioning James Taylor @jctaylor. Who was asking related questions on the thread below, as an alternative to sending the SDK command "/3" before a session.
https://openbci.com/forum/index.php?p=/discussion/3305/external-sync-and-channels#latest
William
My board is set to digital mode on startup (using the code above). If I use the OpenBCI GUI, it automatically sets the board to analog mode when it starts. I have to go to Digital read and change it to digital. I'm afraid of damaging the board if it starts in analog mod? Is there a way to start in digital mode with OpenBCI software?
Hi Skiria,
I'm pretty sure the factory firmware default mode for OpenBCI GUI and Cyton, is to readout the Accelerometer XYZ axes in the Aux channels. However since your modified firmware changes the board mode to Digital, it sounds like also the packet Stop Byte should change. According to the table shown here,
https://docs.openbci.com/Cyton/CytonDataFormat/#binary-format
If the GUI sees this stop byte and assumes Analog Board Mode, then the only way to remedy that would seem to be to modify the GUI source code. There is no distinguishing in the stop bytes between digital and analog Aux board modes.
William
Frankly however, I think you would be BETTER OFF, reading out your external triggers in Analog mode than digital. Then your code can confirm that the trigger on/off voltage levels are what you expect. And can detect if something goes wrong. In Digital mode you just get ones or zeros, and the PIC32 does that determination based on it's internal logic threshold levels.
Sorry to bother you, which column in the csv file is the 0 or 1 read in the digital mode, as shown in the following figure