Jump to content

Help in interfacing cc2541 BLE sensortag with msp430

Recommended Posts

Spirilis is right...you need another BTLE host chipset to interface over BT.  You might be able to pull it off with a dongle (which TI sells) and something like a beaglebone or PI, but I think you will be hard pressed to make it work with an MSP430 without some major effort (if at all).


However....the CC2541 does have an unused UART module that is broken out to the ez430 header (the 6 pin, .05" header by the battery).  The UART isn't enabled in the stock firmware, but it can be used if you roll your own.  I actually this for a project.  You will need to purchase a CCDebugger (http://www.ti.com/tool/cc-debugger) to flash the tag. 


Honestly though...if this is project is more than just a fun challenge, I would seriously steer clear of the sensor tag for this application.  The only compiler option you have is IAR's 8051 compiler, which means (after the first 30 days) you have to choose between writing code that is so small it's barely useful (4k limit) or paying $800 for 3 months for the full version.  The sensor tag board also has some odd design quirks which aren't documented.  It took a combination of reverse engineering the example firmware (which has some bugs in it as well ... looks like it was written by a summer intern) and blind luck for me to figure them out....so it's not really all that friendly towards this sort of custom hacking.  In the end, I didn't so much reuse example code, as I did dig up the documentation on all the sensors and completely rewrite the implementation code...I did use TI's I2C code though, so I guess that's something.  In the end, I think it would have been less effort to just design and build my own board from scratch


Not trying to discourage you or anything...


Anyway, my code is in my GIT repo:  https://github.com/mjbeals/RocketPack/tree/V0.1-ST


Look under Firmware/Sensor Tag.  It is still somewhat of a work in progress, but it should compile, flash and work without issue.  It neglects the IR thermopile (not enough code room), but everything else works.  It spits out a null terminated bytestream over the uart as fast as it can.  It should be 15Hz if you read humidity or 20Hz if you don't.  You can somewhat control it by sending it a single byte which acts as a mask.  The first 4 bits are for sensors (1 = read sensor, 0 = skip it) and bit 5 enables auto poll (1 = continuously poll and send, 0 = read requested sensors once, report, then stop ).  Once that is running, then interfacing with it on the MSP430 is as simple as using serial read commands (in Energia)

Link to post
Share on other sites

I have something similar and it works great as a wireless uart bridge, but the sensor tag doesn't work like that.  It actually advertises the sensors as individual services using GATT profiles.  You could probably rewrite the firmware to advertise a virtual com port, but you hit the same code size issue (the stack alone its to big for the free compiler)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...