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.
Tool/software: TI-RTOS
I would like to preface this with that I am relatively new to the TI MCU platform. Essentially, I would like to collect data from an external accelerometer through I2C and send that data to a mobile phone using BLE. I have found the drivers for I2C in the resource explorer under Empty Project for the CC2650. So I have successfully set up I2C communication between the board and accelerometer. I am not confused on how to add BLE functionality. I noticed there are no BLE drivers in the include folder. I currently have BLE Stack SDK 2.2 installed. However, I am confused on where to go from here. Where do I obtain the header/drivers files for BLE. And how do I go about adding that BLE functionality to send accelerometer data?
Hey Bharathi,
Here are a few links that may have already answered your questions:
https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/t/496210
http://processors.wiki.ti.com/index.php/CC2650_LaunchPad_User%27s_Guide_for_Bluetooth_Smart
https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/t/600218
I would personally start with the Simple Central and Peripheral examples, which you can find in the BLE_SDK_2_02_02_25 install directory.
For reference, you may also want to review the Simplelink Academy modules for Bluetooth 4.2 under the CC2640R2. Although the Simplelink SDK is not supported on the CC2650, the information in the module is a great introduction to BLE.
Great. This will definitely help. To my understanding, starting a new project zero project should already have all drivers added correct, including I2C? That was my main concern.
Also with BLE SDK 2.2, CC2650 is now supported right? So I should be able to follow along with the SimpleLink Academy tutorials but just use it for my specific device?
Thanks,
Bharathi
So do you suggest using the sensortag instead of the launchpad then for this project? If that is the case, how do I send specific sensor data through BLE? Do I have to write my own service? I have a general understanding of BLE, but I am not sure how this all ties together with TI libraries.
You'll have to first determine whether or not you want your device to behave as a peripheral or a central device (See the SimpleLink tutorial for explanation on the different GAP roles). To send data to your phone, for example, then you'll likely want the device to behave as a peripheral (your phone will be the central).
The i2C drivers are not in the simple peripheral example. Just copy over the i2C support code from the 'CC2650_LAUNCHXL.c' file and call the Board_initI2C(); function to initialize (like you've already done in the empty project).
In short, you can send data over to the central device using the advertData variable. The first few bytes of that variable are "reserved" (I use this term loosely), so be sure to fully understand the way data is transferred before altering advertData.
I am still really struggling to get started here. I am able to collect I2C data using another imported project (TI RTOS CC2650STK SensorTag tmp007 i2c project). I've looked over the SensorTag and SimplePeripheral examples, but I am still confused on how to merge over I2C with these projects. Again, my objective is really simple. I would like to collect I2C data and send that to a mobile device using BLE.
I found that this SimpleLink Academy tutorial does exactly what I need (with the CC2640R2). Is there something similar with the CC2650?
Great! In that case, I can just use the ProjectZero project for the CC2650 instead of using SensorTag correct? I am saying this because all the board configurations are appropriate, and I feel like it may be easier to get started.
I do have a couple questions, if I were to go about this approach. I found that the I2C drivers were not included in the Drivers folder in the project directory. Where can I go about finding those relevant driver files? Can I just include from my other project where I got I2C working?
What exactly is the ProjectZero.c task. I just need to send data from I2C, so would I add that implementation in that task, or would I need to write my own task? I just want to have it set up such that that is all I am doing. I don't need all the extra functionality associated with ProjectZero.
Let us know how it goes!
I'm going to close this post. If you have any follow up questions, just post a reply here and the thread will reopen.
Bharathi,
The Project Zero example will not run on the CC2650 without making some substantial changes. Project Zero, in your case, should only be used as a reference to incorporate I2C.
I would still try using SimpleBLEPeripheral in BLE-STACK-2-1, which does not have the I2C drivers in the example project.
To add the I2C driver, make sure to take your existing I2C project and copy over all necessary initializations, defines, includes, config structs, etc from your empty project to your new project. You can find this in the CC2650_LAUNCHXL.c file under the "I2C Begin" heading. Also, in CC2650_LAUNCHXL.h, you should also remember to copy over the Board_I2C define under "Generic I2C instance identifiers". Lastly, just like you've done in the empty project, be sure to call the I2C initialization and any tasks you've created to interface to your sensor.
Just wanted to check the location of the corresponding Board.h and CC2650_LAUNCHXL.h/c files. I see them under include->C:/ti/tirtos/_cc13xx_cc26xx_2_21_01_08/products/tidrivers_cc13xx_cc26xx_2_21_01_01/packages -> ti -> boards ->CC2650_LAUNCHXL. These are the files I will be updating right? Just want to make sure before I update anything.