Skip to content

Simple two-way communication using Bluefruit Connect app, Adafruit Bluefruit SPI Friend, and an MSP430 microcontroller.

License

Notifications You must be signed in to change notification settings

microphonon/MSP430-Adafruit-Bluefruit-LE-SPI-Friend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MSP430-Adafruit-Bluefruit-LE-SPI-Friend

This repo demonstrates how to setup a two-way interface between an MSP430FR5969 Launchpad and the Adafruit Bluefruit Connect app using Adafruit's Bluefruit LE SPI Friend module:

https://www.adafruit.com/product/2633

The MSP430 configures the BLE module to advertise as "LED Demo". Select UART after connecting to it with the Adafruit app. The app is used to switch the red LED on P4.6 on and off by sending single lower-case characters t or f, respectively. Any other characters generate an input error. The Launchpad will acknowledge a change in LED state by sending a short message to the Bluefruit app.

Communication between the MSP430 and BLE module is via SPI using eUSCI_B0. The BLE module is configured using the UART-AT command set encoded with the SDEP protocol. This is implemented with a wrapper script, where an acknowledgement from the module is returned automatically. Separate write and read functions send and receive data to/from the app via BLE wireless. Details can be found in the Adafruit documentation linked above.

The following Launchpad pins are used:
P1.0 Green LED
P1.2 SPI CS for BLE
P1.6 MOSI to MOSI
P1.7 MISO to MISO
P2.2 SCLK for SPI
P3.4 RST on BLE (optional, use with caution)
P4.6 Red LED

Important: The IRQ interrupt pin on the SPI Friend is not used as it is a highly unreliable indicator of the state of the module. Instead, the module is polled using Timer_A sourced to ACLK at 32768 Hz with LFXT referenced to the onboard crystal. The timer idles in LPM3. It is critical to introduce suitable delays between sequential operations in the BLE module. These delays were determined by experimentation.

Requires nofloat printf support in Code Composer. 3.3V for the BLE module can be supplied by the Launchpad. Modifications will be needed for the other MSP430 Launchpad models, but the code is thoroughly documented to make this transparent. This repo contains the MSP430 firmware only; Adafruit maintains the firmware for their module.

About

Simple two-way communication using Bluefruit Connect app, Adafruit Bluefruit SPI Friend, and an MSP430 microcontroller.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages