How to practically increase sample rate?
[original new thread title: "How to practically increase sample rate with Bluetooth transmission (bypassing the OBCI Dongle)?"]
----
Hello everyone,
I already red some discussions touching the topic of increasing the sample rate while streaming the data to a PC over bluetooth (I have a Cyton and I use it for sEMG acquisition for research purposes), but I was not able to really figure out which exactly is the best/simplest solution, so I hope to help also other people in the community with this post, that could clarify the topic.
As far as I have understood, if I want to change the sample rate from 250 SPS to 1000 SPS, first I should modify in the library the file OpenBCI_32_Daisy.cpp, according with the following discussion: http://openbci.com/forum/index.php?p=/discussion/614/change-sampling-rate-frequency .
Then, in order to obtain also the stream of the data to a PC at such frequency (1000 SPS), it seems to be necessary to bypass the OBCI Dongle, for example establishing a connection to another bluetooth 2.0 receiver. I have two questions about this point: 1) am I right? , 2) how to practically do that? Can someone explain the steps to do that?
Finally, in general, if someone could clarify all the steps to increase the sample rate (and the bluetooth streaming) to 1000 SPS could be great for me and my research.
Thank you in advance for your time,
Roberto

Comments
@Bonzo you can change the sample rate using the wifi shield with just a simple command. i.e. i did the hard work for you in modifying the code to work at higher rates.
https://github.com/OpenBCI/OpenBCI_32bit_Library/tree/dev-3.0.0
This code is still in beta but is working well and if you are located in the US, we have one wifi shield left for a beta tester.
Unfortunately I am located in Europe, Italy.
So, if I got it, uploading the code you linked from github will make the OBCI board working at 1000 SPS? or do I have to use it with the wifi shield?
Thank you again for your help.
Roberto
What do you mean exactly with "use external serial port [...] using that same code"?
Thanks.
Thank you all for your kind interest and answers.
Could I be right?
Yes, actually I could try to first reprogram the Pic32 communicating at 115200 baud. Anyway, I was following the "correct" procedure as suggested in the guidelines:
1. reprogram the device radio
If I first reprogram the Pic (that is, change sample rate to 1 kHz and board's baud rate to 460800) then, if the radios don't work at higher baud rates (as I'm suspecting), there is the possibility that I will not be able anymore to reprogram the Pic and reestablish the communication with the board.
I am not sure if I am right, but I am "scared" to permanently "lose" the communication with the board. Could be possible?
2. Do NOT set or change the pic baud rate on Serial0
3. Do NOT set the sample rate yet, leave at 250
As far as I was able to understand:
Since my goal is to reach 8 channels at 1kHz, if I don't change the baud rate and I don't change the sample rate... how I can realize that?
For my knowledge, it is not clear the meaning of "set or change the pic baud rate on Serial0 ". The changes that I was trying to do were (without good results):
1. increase the baud rate in "OpenBCI_Radios_Definitions.h" (setting "#define OPENBCI_BAUD_RATE_DEFAULT 115200" to "#define OPENBCI_BAUD_RATE_DEFAULT 460800")
2. reprogram the device radio and then the host radio
3. increase sample rate in "OpenBCI_32bit_Library.cpp" (that is setting "WREG(CONFIG1,0xB6,BOARD_ADS);" to "WREG(CONFIG1,0xB4,BOARD_ADS);")
4. increase the baud rate in "OpenBCI_32bit_Library_Definitions" (that is setting "#define OPENBCI_BAUD_RATE 115200" to "#define OPENBCI_BAUD_RATE 460800")
Is there something with sense in what I was trying to do? In case, could you clarify some concepts?
Thank you very much.
Next concept: using Serial1 with an optoisolator hardwired tp your laptop will support a higher sample rate. This can lead to shock if you hooked up wires incorrectly so no one recommends this. Thats why the wifi shield is a big deal.... it uses SPI instead of UART which is much faster and allows for a much greater then 1kHz
Another possibility should be to connect the Serial 1 of the board to an external bluetooth module, do you know (or do you have) any tutorial on how to hw&sw implement such solution? (something with more information than this: http://openbci.com/community/openbci-with-android-as-graduation-project/).
Does "great sample rates" mean at least 1 kHz? Will the sample rate be settable by command?
Thank you for your precious work!
How will be communicated the day the wifi shields will be on sale? Is there a possibility to pre-order?