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).
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.
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.
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.