Can you change the Baud rate of the Android BLE block

3 visualizaciones (últimos 30 días)
Matthew Bigelow
Matthew Bigelow el 30 de Oct. de 2018
Editada: li li el 11 de Ag. de 2021
I am trying to receive a 256 samples per second signal from a HM10 bluetooth device using the custom characteristic of the HM10. I have successfully sampled a 1hz sine wave that is not distorted at that sample rate. However when I try to sample a 128Hz sine wave it is all over the place (which is the signal I actually need for my project). The custom characteristic of the HM10 sends a maximum of 20 characters. Im assuming one of the issues is that the 9600 baud rate is not high enough and I need 57600 to get the whole signal ie 20(characters) x 8 (bits) x 256 (samples per second)...please correct if Im wrong. I can change the baud on the HM10 easily enough but does anyone know how can I match it with the simulink driven android device? ie change the baud for the android BLE block to 57600

Respuesta aceptada

Sruthi Yenugula
Sruthi Yenugula el 2 de Nov. de 2018
Hi Matthew,
Maximum data sent through BLE characteristic is 20 bytes. Android BLE receive blocks can receive the characteristic for every 0.1 second, if the sample time parameter of the BLE Receive block is set to 0.1. You can set the sample time according to your needs. Two things you control in BLE Receive BLE block is Sample time and Data Size(it depends on peripheral/central device i.e sender data size ).
  1 comentario
li li
li li el 11 de Ag. de 2021
Editada: li li el 11 de Ag. de 2021
Hi Sruthi :
  1. I used to send 7 bytes data to the mobile by (STM32F407 through BLE4.0 module,Baud rate=115200) every 0.001 second;
  2. BLE Receive block's sample time set to 0.001, data size set to 10;
  3. and also log the receive data by To Workspace block which sample time set to 0.001 too;
but the result :
  1. the receive data logged in MAT-files seems wrong,The data is not stored in the correct position, the frame header often appears in the 3rd or 4th bit value.The data is completely useless.
  2. when i reduce transmission frequency to 7 bytes per 0.02 second , the data stored correct, but always missing log some frame data.
my Q :
  1. Why do the above two results occur?
  2. What is the highest sending frequency of the slave device can be used?
  3. What is the appropriate sampling time and the data size of the BLE Receive block?
  4. Can To Workspace block be freely to control the start and stop of the recording data?
Thanks.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by