This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2540/2541 accelerometer data retrieval and saving without using Btool or Sensertag app?

Other Parts Discussed in Thread: CC2541, CC2540

Hi all,

I want to get CC2541 mini dev kit accelerometer's raw data (x, y, z-axis value), in a way that it can be streamed and saved in a file for further analysis. I think this is useful considering its SPI interface, and might be applicable to a lot of CC2540+peripheral data saving and processing.

Is there a way to do so? Currently from what I understand the keyfob accelerometer data can only be viewed in smartphone SensorTag app or Btool, and these two methods don't allow data saving.

I studied the SensorTag app Android source code, seems like a way is to modify the Android source code. But I haven't fully understand the code yet. I've also looked at the  BLE Serial App sample application: processors.wiki.ti.com/.../LPRF_BLE_SerialApp This application allows UART data stream, but still need to integrate the accelerometer's SPI interface. These two methods do not seem to be optimal solution.

How should I implement this? Is there any similar examples? Any suggestions are greatly appreciated. 

Thanks,

Bo

  • Yep, there are many ways to do this. You could modify the simpleBLECentral application (included with the installer) to read the accelerometer data. Then send this data to your PC via UART and save to a file. See the bridge example for an example to add UART: processors.wiki.ti.com/.../SerialBLEbridge_V_1.4.1

    You could also write a python script to mimic BTool to act as a central device to read the accelerometer data. That is, you would send the same HCI Vendor Specific Commands (see the API included with the installer).