Hi,
we are developing an application consisting on connecting one or more (up to seven) Bluetooth modules (based on CC2564B) with a smartphone or tablet with Android O.S.
Each bluetooth module (Sensor Unit) transmits data at 64 kbps (at least) organized in packets of 128 bytes that are sent each 32 ms.
Data are sampled by means od two 16 bit external A/D at 2 kHz.
The application firmware side is based on the SPPDemo example included in the stack documentation.
At this time we are able to discover, connect and start sending data from one sensor unit to the server device (Samsung Galaxy Tab3) and connect up to seven devices at the same time BUT.....
analyzing the recorded data i found that there is 1 missed sample every 32 ms. I think that this is due to the fact that the packet sending (128 bytes) lasts around 750us while i need a sample each 500 us (sampling frequency is 2 kHz).....
Is this observation correct? How can i solve this problem?
There is a way to sample data while sending packet? I noticed that while sendig operation is in progress the default SPPDemo app stops scheduler and also interrupt so it is impossible to sample data during this operation.
If i want to not stop scheduler and interrupt (sampling timer) during the sending packet operation, what is the SPPDemo code that i need to change? there are some risks?
There are other options?
Thanks in advance!