Tag Archives: BLE

Bluetooth Low Energy Game Controller

Slide1

This project features the Texas Instruments SimpleLink Bluetooth Low Energy CC2640R2F Launchpad interfaced to a Educational BoosterPack MKII to function as Bluetooth Low Energy Game Controller.

Hardware Block Diagram:

Slide2

BOOSTXL-BATPAKMKII is used to power up the Bluetooth Low Energy Game Controller. Alternatively you can use 4 AA batteries as power supply.

Project Hardware Modifications:

  • Remove TI CC2640R2F Launchpad R52. This effectively disconnects the LaunchPad’s BPRST header pin from the CC2640R2F device’s RESET_N pin. Then EN1 circuitry of BOOSTXL-BATPAKMKII pulls the signal down to ground which is connected to the TI CC2640R2F BPRST Pin 13. If you are using 4 AA batteries as power supply skip this step.R52
  • Put a 10K Ohm Resistor across R9 of BOOSTXL-BATPAKMKII Rev 1.0. This is fix for the charging issue. Place a jumper at JP6 BIN. If you are using 4 AA batteries as power supply skip this step.IMG_1216
  • Remove 5V and 3V3 jumpers. Move VSENSE jumper from XDS110 Power to External Power. IMG_1207 - Copy
  • BTN1 of Educational BoosterPack MKII is connected to TCK pin of TI CC2640R2F LP BP Connector. The TCK pin at CC2640R2F LP BP Connector is not connected to anything. So to make use of it short it to DIO15.IMG_1224 - Copy
  • BTN2 of Educational BoosterPack MKII is connected to TD0 DIO16 pin of TI CC2640R2F LP BP Connector. To connect DIO16 to CC2640R2F place a wire short at R48 pad. Remove TDO and TDI Jumper.IMG_1225 - Copy
  • Set Educational BoosterPack MKII J5 jumper to 2-3 position. This is so we can set the LCD Backlight to off.IMG_1226

Bluetooth Low Energy Game Controller Inputs:

  • Educational BoosterPack MKII Joystick, BTN1 and BTN2.
  • CC2640R2F Launchpad BTN1 = SELECT, BTN2 = START

The BTN inputs are mapped to HID commands that is for NES Online Games Website.

Software Requirements:

Sending HID Commands Periodically every 80 ms:

The usual format for keyboard reports is the following byte array:
[modifier, reserved, Key1, Key2, Key3, Key4, Key6, Key7]
Key1 = Joystick X
Key 2 = Joystick Y
Key 3 = Educational BoosterPack BTN1
Key 4 = Educational BoosterPack BTN2
Key 5 = CC2640R2F LP BTN1/BTN2

Program: TI CC2640R2F BLE Game Controller

Note: See, program link README.md for instructions.

Advertisements

TI CC2640R2F SensorTag

TI CC2640R2F SensorTag
Bluetooth Low Energy Connection to Smart Phone

This project features the Texas Instruments SimpleLink Bluetooth Low Energy CC2640R2F Launchpad with SensorTag and Key Fob codes ported from BLE Stack 2.2.1.. 

Bluetooth Low Energy Services:

  1. Device Information Service.
  2. Link Loss Service.
  3. Immediate Alert Service.
  4. Tx Power Service.
  5. Accelerometer Service.
  6. Battery Service.
  7. Simple Keys Service.
  8. TI Sensortag 2.0 I/O Service.
  9. TI Sensortag 2.0 Register Service.

Note: Texas Instruments Sensors BoosterPack Plug-In Module will be later on added to this project to have full SensorTag Functionality.

Project Hardware Requirements:

  1. TI CC2640R2F Launchpad.
  2. TI Educational BoosterPack MKII.
  3. TI BLE USB Dongle or TI CC2650 Launchpad with Host Test Program.

Project Software Requirements.

  1. Simplelink CC2640R2 SDK: BLE-STACK V3.0.1 (Support for CC2640R2F)
  2. BLE-STACK V2.2.1 (Support for CC2640/CC2650/CC1350)
  3. TI Code Composer Studio 7.0.
  4. TI SmartRF Flash Programmer 2.
  5. TI BLE Device Monitor.
  6. SensorTag App.

Hardware Setup:

IMG_0809
TI Educational BoosterPack MKII connected to TI CC2640R2F Launchpad

Overall Pin Compatibility:

Overall Pin Compatibility 2

TI CC2640R2F Blogs:

5 need to know facts about the new SimpleLink™ Bluetooth low energy CC2640R2F wireless MCU

How does Bluetooth® 5 increase the achievable range of a Bluetooth low energy connection?

Program: TI CC2640R2F SensorTag

Note: Using SmartRF Flash Programmer 2, you can program the app and stack hex files to your device setup. See, program link README.md for instructions.

Program Details:

The TI CC2640R2F SensorTag Program, are made up of SensorTag and Key Fob codes from BLE Stack 2.2.1 ported to CC2640R2F SDK simple peripheral.

See, CC2640R2 SDK Porting Guide, to learn how to port codes from BLE Stack 2.2.1 to CC2640R2 SDK simple peripheral example programs.

TI SensorTag App:

Note: As of this Blog Post Publishing , the SensorTag App crashes when going to Sensor View. However, the SensorTag App does not crash going to Services.

TI CC2640R2F SensorTag IO:

To activate TI CC2640R2F Launchpad IO, first set Config to “01”, to enable control by remote client. Then set Data to these below settings.

“00” – All IO’s set to OFF
“01” – Blue LED ON
“02” – Green LED ON
“03” – Both Blue and Green LED ON
“04” – Buzzer ON

TI CC2640R2F SensorTag SimpleKeys:

TI CC2640R2F Launchpad Button 1 and Button 2, presses are passed on the SimpleKeys BLE Service.

TI CC2640R2F SensorTag Immediate Alert:

Immediate Alert is triggered by setting Link Loss Alert Level to either “01” or “02”. Then set Immediate Alert to “01” for Low Alert or “02” for High Alert.

TI CC2640R2F SensorTag Link Loss Alert:

Set the Link Loss Alert Level to either “01” or “02”. Then remove link to Bluetooth Device. In this case, I removed the TI BLE USB Dongle. When connection timeout is reached, Link Loss Alert is triggered.