Can you change the Baud rate of the Android BLE block

조회 수: 2 (최근 30일)
Matthew Bigelow
Matthew Bigelow 2018년 10월 30일
편집: li li 2021년 8월 11일
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

채택된 답변

Sruthi Yenugula
Sruthi Yenugula 2018년 11월 2일
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
li li
li li 2021년 8월 11일
편집: li li 2021년 8월 11일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by