Tag Archives: Bluetooth Low Energy

TI CC2640R2F BLE Keyboard

TI CC2640R2F BLE Keyboard
Bluetooth Low Energy Connection to Smart Phone

This project features the Texas Instruments SimpleLink Bluetooth Low Energy CC2640R2F Launchpad interfaced to a USB Keyboard to function as a BLE Keyboard. 

The reference for this project is based from the Bluetooth SMART Keyboard Reference Design which uses a BLE CC2650 board interfaced to Mini Keyboard.

BLE CC2640R2F was used instead since it is able to support BLE 5 Long Range and High Data Rate feature. For a BLE Keyboard application the BLE 5 Long Range feature is desirable. Imagine able to type at your Laptop through BLE Connection at a distance of 400 meters. However, at the moment there is no Personal Computer or Smart Phone that supports BLE 5 Long Range Feature. If that time comes when there are Personal Computers and Smart Phones that are able to support BLE 5 Long Range Feature, then the BLE CC2640R2F Long Range Feature can be enabled through software so this project can become a “TI CC2640R2F Long Range BLE Keyboard”.

Interfacing the USB Keyboard to TI CC2640R2F Launchpad:

I used a Logitech K120 USB Keyboard to interface with TI CC2640R2F Launchpad. I dismantle the Logitech K120 USB Keyboard and remove the USB cable connected to the Keyboard motherboard.

The next step is trace the top and bottom keyboard matrix. The top keyboard matrix has 8 pads connected to the board and. The bottom keyboard matrix has 18 pads connected to the board. For this project at the moment I only aim to output Keyboard Letters and Numbers, which you can see at the Keyboard Matrix Table below are highlighted in green.

Keyboard Matrix
Keyboard Matrix

Then ribbon cable is soldered to the pads of the motherboard. Only half of the pad is in contact with the keyboard matrix. To solder the ribbon cable to the pad, the black conductive material on the pad needs to be scraped off first.

IMG_1058
Keyboard Motherboard Top Side
IMG_1057
Keyboard Motherboard Bottom Side
IMG_1061
Keyboard Motherboard with ribbon cable soldered to the pads
IMG_1062
Assembling the Keyboard with the Ribbon Cable

Overall Pin Compatibility:

TI CC2640R2F LP Pin Compatibility

Keyboard Interfaced to CC2640R2F Launchpad:

IMG_1104
Enter a caption

The TI CC2640R2F Launchpad is powered using Power Bank.

Program: TI CC2640R2F BLE Keyboard

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

Program Details:

Using the Key Matrix Data I was able to generate Key Scanning codes from the Bluetooth SMART Keyboard Reference DesignThe Key Scanning Codes are for BLE CC2650. I then port the code to work for HID Emu Kbd Example Program from CC2640R2F SDK Version 1.30.

I used a Iphone 4s for testing because there was some issue pairing with my Windows 10 Laptop. Using LE LightBlue App, I was able to see the BLE Services.

The key pressed from the BLE Keyboard can be seen at the Iphone 4s Notes App.

Advertisements

TI CC2640R2F Play Buzzer Tunes

CC2640R2 SensorTag2
Bluetooth Low Energy Connection to Smart Phone

This project shows how to play buzzer tunes through Bluetooth Low Energy Connection. I used my earlier blog project “TI CC2640R2F SensorTag“, and added playing buzzer tunes 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.

Program: TI CC2640R2F SensorTag

I added code files sensortag_playtunes.c, sensortag_playtune.h and pitches.h to TI CC2640R2F SensorTag CCS Project.

TI CC2640R2F SensorTag Play Buzzer Tunes:

Buzzer Tunes Credits to:

  • Dung Dang for the Happy Birthday Buzzer Tunes.
  • Dipto Pratyaksa for the Mario Brothers Main Theme and Underworld Tunes.

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.