CC2540DK-MINI received

CC2540DK-MINI Keyfob

I recently picked up the CC2540DK-MINI, since it was one of the cheapest dev kits at $99 (including FedEx 2-day express shipping to Australia!) and I was really impressed by their recent video displaying the CC2540 keyfob interacting with the iPhone 4S.

The kit comes with a keyfob, USB dongle, CC Debugger, USB cable and an interface cable to attach the CC Debugger to the keyfob or USB dongle.

The keyfob has a VTI CMA3000-D01 accelerometer functioning in SPI mode, two buttons, an LED which flashes both red and green, a buzzer, and a retainer for a CR2032 battery.  The USB dongle contains just a CC2540 chip, and this can be used to act as the master peripheral (similar to the role that a Bluetooth Smart Ready mobile phone such as the iPhone 4S would play).

The complete package provided with the CC2540DK-MINI kit. Clockwise from top left: CR2032 battery, Keyfob, USB Dongle, plastic keyfob case, CC Debugger, 2 different debugger flash cables and a USB to USB mini connector

I found the Mini Dev kit pretty easy to set up, although I initially had some issues with VMWare intercepting the driver for the CC Debugger and not releasing it to the host operating system even when I shut down VMWare.  I ended up uninstalling VMWare and everything worked fine afterwards.

I also had some difficulty with the Keyfob not being detected by the CC Debugger (the light would remain red on the debugger device, even though I had connected the Keyfob and inserted a battery into it).  The issue was caused by corrosion on the negative battery terminal in the CR2032 coin cell retainer, a problem that others have experienced as well.  The solution for me was to use tweezers to clean the surface of the terminal that was oxidized.

Corroded negative battery terminal on the keyfob

Having said that,  I soon discovered that I was going through CR2032 batteries too quickly during debugging.  I followed the instructions described on page 27 section 5.1 figure 38 of the Bluetooth® Low Energy CC2540 Mini Development Kit User’s Guide, and shorted out the pads for resistor R1 which are located immediately next to the debug header on the keyfob.  The keyfob will now operate without a battery, and will instead draw power from the CC Debugger.

Behold my awesome solder work. It ain't pretty, but it works

If you still run into problems with the CC Debugger not recognizing your Keyfob, make sure you have the ribbon cable properly oriented (the red wire must be attached to pin 1 on the Keyfob) and try using a new battery if you have one – some users have reported that the battery included with the Mini Dev kit had no energy when it arrived.

Another gotcha I ran into was the Keyfob not sending accelerometer data when I tried interfacing it with the Texas Instruments iPhone app.  I had mistakenly programmed the keyfob with the cc2540_ble1.1_keyfob_SimpleBLEPeripheral.hex found in the Texas Instruments\BLE-CC2540-1.1a\Accessories\Hex_Files directory, which lacks accelerometer functionality.  If you run into the same issue, make sure you’re using the KeyFobDemo project (C:\Texas Instruments\BLE-CC2540-1.1a\Projects\ble\KeyFob\CC2540DB\KeyFobDemo.eww) which requires you to use IAR to flash it onto the Keyfob.

Once all of that was sorted out, I was able to connect the Keyfob to the CC Debugger, load up the KeyFobDemo project in IAR and run the “Download and Debug” command to flash the Keyfob with the software.  I also signed up to become an Apple iOS developer, which costs $99/year, and this allowed me to install the Texas Instruments iPhone app onto my iPhone 4S.  After running the TI iPhone demo app through Xcode, I pressed the button on the right side of the Keyfob, which toggles advertising on and off, then pressed the “Scan and connect to keyfob” button on the iPhone which established a connection to the Keyfob, and in a matter of seconds, I was receiving live accelerometer data!

I’m now in the process of trying to split my time between learning how to write apps for the iPhone, trying to understand as much as I can about the CC2540 and the TI BLE stack and libraries (HAL, OSAL, etc) and learning about printed circuit board (PCB) design, since I’d like to eventually create my own PCB with a CC2540 and the minimal components necessary to communicate with another BLE peripheral.

Speaking of which, here’s a really interesting post on the TI forums about the minimum bill of materials necessary for designing your own PCB with the CC2540.  This will most certainly be a topic for another blog post when I become more familiar with hardware and using PCB design software such as Eagle.

Also, for those of you developing apps for iOS, I’ve recently discovered the excellent iPad and iPhone Application Development course from Stanford University available for free from iTunes U.  You can find the content for the Fall 2011 course here, and the Stanford University course page is available here: CS 193P iPhone Application Development. There’s also an Advanced iPhone Development course provided by Madison Area Technical College which has some great content as well.

About these ads

32 thoughts on “CC2540DK-MINI received

  1. Thanks for this post – it is very helpful.

    You mention getting the TI iPhone ap by becoming an Apple iOS developer (and spending $99). Could you share the steps involved in doing this?

    Where do you sign-up to become an iOS developer? Once you pay your money, how do you find/get the TI iPhone ap?

    Thanks very much, in advance, for your help.

    • Hi Scott, it’s pretty easy to become an iOS Developer, simply go to the iOS developer registration page enroll yourself. You don’t need an iOS developer account to download the TI iPhone application, but you need to have the account in order to copy the TI iPhone app to your phone to test it out. You can download the TI iPhone application source code from here. Good luck!

  2. Hi Adam, informative post and i like how you explained things in good detail. I have this product also because the iPhone app was interesting. You mentioned about PCB design. I don’t have a mechanical engineering background so I don’t know whats the best way to start making sense out of all the hardware. How have you started the learning curve for the hardware procedures? Any books you can recommend or tutorials to go through that have helped you? Thank you in advance.

    • Hi Tomi, glad you found the post useful. To be honest, I’m still struggling to understand the underlying electronics and hardware of this stuff. One thing that’s been extremely helpful was to sign up for the the MITx online course for Circuits and Electronics, 6.002x. So far the course has focused on explaining how basic circuits work, how to analyze them and how to make meaningful measurements. It’s been very useful for someone like myself who had no experience or training with electronics. At least now I can make measurements with my digital multimeter and understand the results! I highly recommend enrolling for the course, reading the textbook and following along with the lecture videos.

      Having said that, I think it’s still possible to work with a BLE development kit such as the CC2540 and make useful programs without extensive circuit design and electronics engineering knowledge. Of course if you want to take things further and design your own Bluetooth Low Energy devices and interface with other circuits, components and peripherals, having a basic understanding of how electronics work will be a huge benefit.

  3. Can you upload/link to KeyFobDemo project, in HEX format? I don’t have IAR to compile it? I would like to just push the HEX file with the debugger and check the iphone app?

    thx
    Mike

    • Yes, I believe you can use the following hexfile to test the KeyfobDemo project with the iPhone app: C:\Texas Instruments\BLE-CC254x-1.2\Accessories\HexFiles\CC2540_keyfob_SimpleBLEPeripheral.hex. Although it may not support all the data that the regular source code provides, such as accelerometer information, so don’t be surprised if only the button presses work in the test app.

      • why am i getting a totally different folder structure? can you show me the a link to the file that you got all those hex files from?

      • Hi there. Another TI BLE stack was released since I originally posted that entry, so you can disregard the folder structure. You’re most likely using BLE stack version v1.2, which is why the directory structure is different.

      • ah okay thanks. can you tell me the file names of which hex file i have to use for the dongle and which one for the keyfob or where i can read that? it seems hard to find those infos. The TI website has downloads all over the place.

      • For version 1.2 of the BLE stack, to test with the TI iPhone app, you should be using the following hex file for the USB dongle:

        C:\Texas Instruments\BLE-CC254x-1.2\Accessories\HexFiles\CC2540_USBdongle_HostTestRelease_All.hex

        And the following file for the keyfob:

        C:\Texas Instruments\BLE-CC254x-1.2\Accessories\HexFiles\CC2540_keyfob_SimpleBLEPeripheral.hex

        Note that the CC2540_keyfob_SimpleBLEPeripheral.hex file only provides limited support for the TI iPhone application. In other words, you won’t receive accelerometer (and possibly other sensor) data on the TI iPhone app if you flash the CC2540_keyfob_SimpleBLEPeripheral hex file on the keyfob. In order to get accelerometer support, you need to use IAR to compile the KeyFobDemo project located in the following directory:

        C:\Texas Instruments\BLE-CC254x-1.2\Projects\ble\KeyFob\CC2540DB\KeyFobDemo.eww

  4. Hi, thanks you so much for your blog!
    I am an iOS develloper and I would like to learn how to connect a BLE device to an application.
    My question is simple: Do you need to create a firmware to use keyfob?

    All I want is a BLE device already programmed that will be easy to connect to an iphone 4s app with corebluetooth library. I want to search the device, connect to it, and use the service (for exemple the accelerometer) but I don’t want to program anything on the ble device.

    For you, what is the best way to do that?

    Sorry for my bad english. Hope you understood ;)

    • Hi Vincent, have you seen the demo iPhone application from Texas Instruments? You can find it here. It will allow you to connect your iPhone to the Keyfob included with the CC2540DK-MINI. The keyfob will need to be flashed with the KeyfobDemo project in order for this to work properly. This project is included with the TI BLE-Stack, but you’ll need to use IAR Embedded Workbench to compile and download it to the Keyfob. You could alternatively use the precompiled hex file for the Keyfob, but I don’t think it supports accelerometer data. See my response to this comment for more information.

      • Thank you for your answer, I have ordered a CC2540DK-Mini. I will flash the Demo and I have found a .hex who contain the accelerometer.
        I keep your blog in mind if I have any question !

  5. Hello Adam,
    thank you very much for you blog, it is really useful to understand clearly what steps have to be done!

    Personally, I had the battery problem too and now succeeded to download and compile the keyfob project with IAR and to install the app on the iPhone with Xcode.

    But i still can’t connect the iPhone to the keyfob.

    I used the app provided here
    http://processors.wiki.ti.com/index.php/Category:IPhone4SBLEDemo
    which i think is a new version if compared to the one in the video

    It has the button “Scan and connect to keyfob” only.
    I press on the right button of the keyfob, then I press on the app button. It searches the keyfob for a few second and then nothing happens…

    I have an iPhone 4 (not a 4s) with iOS 5.1.1.

    Do you think I have to check some options on the iPhone bluetooth? Because it seems the keyfob is working.

    Thank you again,
    Matteo

    • I found this on a few articles.
      “The iPhone 4S is the first smart phone that supports the new Bluetooth 4.0 standard”

      So the problem is that I have an iPhone 4 and not an iPhone 4S?

      • Hi Matteo, the reason you can’t connect the keyfob to your iPhone is because you don’t have Bluetooth Low Energy hardware in your iPhone 4. You’ll need an iPhone 4S which comes standard with BLE support, in order to use any BLE devices, such as the Texas Instruments keyfob.

    • HI mateo ,

      If you want to work with the functionality of keyfob ,you can flash host test release project from Ti and you can install Btool in the windows PC to communicate with keyfob !

  6. i paired mine now with the iPhone 4s and noticed this:
    if i leave the cc2540dk sitting there for longer time i’m not able anymore to connect to the device. i need to press a button first and then i can scan and find the device. this makes applicatiuon like a key finder impossible. i havent messed with the code yet, i just wonder if thats a bug or just how the same program was written.
    I also found someone has supplied the TI iOS demo program to the app store as free app so you don’t need a Apple developer account just to try it out.
    http://itunes.apple.com/th/app/ble/id492891790?mt=8

  7. Hi Adam
    I would like also to be able to do all the three PCB, BLE programming over CC2540, smart phone application.
    I have some background in digital PCB (not RF)
    MCU programming (AVR not TI)
    and java,C,C++ (not smart phone programming)

    can you please share with me more about your experience trying to learn each field
    is it to much for one person or you found yourself able to handle it all?

    please share you experience

    thanks

    • Hi Natanel. In terms of my progress, I haven’t made it very far. For the past three months I’ve been spending every free moment working on the MIT 6002x Circuits and Electronics course. As a software engineer, my hardware knowledge has been extremely lacking, so when I found out that MIT was offering a free online course, I decided to enrol and increase my understanding. The course has been great, but the investment in time has prevented me from doing any work on BLE related projects, as can be seen from my lack of posting on the blog.

      As you mentioned, there’s quite a lot to learn in regards to developing a BLE peripheral. If you’re developing an iOS application, you’ll need to understand the following:

      • Cocoa
      • Xcode
      • Objective-C
      • Corebluetooth Framework

      And for the software side of a BLE peripheral, based upon a CC2540/41 for example, you’ll need the following:

      • C programming (if using the onboard 8051 MCU)
      • Knowledge of the CC2540/41 chip (how to trigger interrupts, how the timers work, low power modes, etc, using GPIO, interfacing with SPI, I2C, etc)
      • An understanding of the TI BLE stack
      • An understanding of the Bluetooth 4 standards (BLE operating modes, eg broadcaster, master role, GATT profile, etc)

      And for the hardware side of a BLE peripheral, say for example, you want to add an accelerometer to a BLE112 module:

      • PCB layout design software
      • PCB manufacturing (either etching your own or having it done through a PCB fabrication and assembly factory)
      • Electronic components, such as resistors, capacitors and voltage sources and understanding how to add them to your PCB design
      • Testing equipment (Oscilloscope, logic analyzer, digital multimeter, etc) plus understanding how they work
      • PCB assembly (eg soldering the components yourself)

      Now some of the above might not be applicable, depending on your needs, and I’m sure I’ve also missed other important details, but consider the above a basic list of the various areas that you might need to be familiar with in order to go from an idea to a working prototype.

      So is it too much for one person to handle? It’s not an easy task, but I think if you’re motivated and determined, it’s definitely possible. And from the list of experience you provided, it seems like you’re more than capable of understanding all the necessary technology.

      As for myself, this is the exact reason I started this blog. I’m going to endeavour to work from start to finish with a BLE project, including all the areas I’ve outlined above, and I’m going to post my experiences as I go along. So expect to see much more activity on the blog in the coming weeks, since the MIT course is nearly finished, so I’ll be able to once again dedicate my free time to working on a BLE project.

      • Yes, the board is hand mounted. I use a soldering iron with a very thin tip and a pair of thin tweezers to place and fix all the components. When everything is mounted (except the CC254x chip) I use a hot plate at 300 degC to reflow the solder and at the same time I mount the CC chip. Hot air soldering iron can also be used, but you have to careful not to burn the board. And it is of course a huge advantage to have a good microscope.

  8. Hello – I just received my CC2540 kit and was struggling to understand why the fob wouldn’t turn on. After I scraped off some oxidation (solder flux?) the light came on — thank you! I loaded it up with the SimpleBLE peripheral profile. Now I can discover the device on my Android phone, but the light doesnt come on anymore. I think this may be related to the profile thats loaded — in case someone else panics!

    PVS

    • Glad to hear you managed to get it working after cleaning the battery terminals. A shame TI is still shipping dev kits with this defect, you’d think they’d have fixed it by now!

  9. Pingback: It’s alive! (Or “Making the TI CC2540 keyfob beep and blink”) | Getting Smart On Bluetooth Low Energy

  10. Hi Adam,

    Found this blog today and was somewhat amazed/amused at the common experiences I’ve had over the past week since I received my CC2540 Mini dev kit, particularly with the fouled negative battery terminal on the board which I had to scrape with a small file. Must be a feature.

    I got the demo code to run on my iPad using the techBasic framework which enabled me to program the iPAd without having a Mac computer. It was a satisfying first step and I went ahead an ordered a new iMac, signed up for the Apple Developer’s Program and am now ready to dive deeper into the iOS platforms.

    Question: Have you or anyone else been able to configure an iMac or MacBook with a USB Bluetooth 4.0 adapter (TI’s or any other vendor) so that the USB adapter works with the iPhone/iPad simulators? I’ve read multiple postings and papers discussing difficulties and investigative steps but no one seems to have written a success story. I know that I’ll be tackling this problem very soon.

    Thanks for the great blog!
    Chip Keyes
    Boise, Idaho (US)

  11. Hi,
    Thanks for all your posts. You are doing a great job!!
    We are working on interfacing BLE(TI solution- CC2540) in master/slave configuration for our device. We want to go for CC2540EMK (eval module) to begin with development.
    How can I program and debug CC2540EMK with cc-debugger?(do not have SmartRF05 Evaluation Boards). What interfacing circuit is needed?
    Thanks…:)

  12. Hi Adam,
    I’ve got the mini dev kit coming soon and was wondering if you’ve come across any good sites/tutorials on the actual C programming of the CC2540?
    The program I need is actually quite simple, but I imagine learning IAR is a big step itself.
    Thanks for the great blog.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s