Thursday, September 12, 2013

The trick to get the BLE112 working

The BLE112 Bluetooth module is a v4.0 bluetooth module from Bluegiga and is marketed as low energy and programmable. It is based on the CC2540 Bluetooth chip from Texas Instruments - note the CC in the part number stands for ChipCon which is a Norwegian RF company taken over by TI.

OverView
The original Bluegiga modules such as the WT12, WT11 and long-range WT41 (referred to as "Classic") are super easy to use. Just enter SET with a carriage return into the Serial port and the the Settings are sent out the Serial port. The new BLE112 is not so easy to use and is not backwards compatible with the classic modules. For a start there are four Serial ports and none of them will do anything until the module is programmed. And to program the module requires an external programmer and a lot of knowledge about blueguga script (bgs) what each xml file does. The aim here is to go through what is required, and shortcut a very steep learning curve. The information below took around 3 months and around 50 emails to the Bluegiga contact. While the BLE112 is difficult to get used to, it is the future of bluetooth communications.

QuickStart Guide
To get started on the BLE112, the best way is to purchase a USB-BLE112 adaptor. Here are the options:
  • Purchase two USB-BLE112 USB adaptors - programmed with EV_MASTER and EV_SLAVE
  • Purchase a USB-BLE112 USB adaptor and a BLED112 USB dongle.
  • Purchase one USB-BLE112 USB adaptor and connect to a computer or mobile device
With the USB-BLE112 USB adaptor, this can be plugged straight into a USB port, the FTDI driver installed, the BlueTerminal program installed and run, and the reset button can be pressed on the side to view the reset message. When a bleutooth connection is made (this is automatic with the example firmware), simply type data in and it will come out on the other bluetooth device.


How to Program
The BLE112 module can be programmed with a CC Debugger available from E-14 or TI direct for around $50. If you are serious about the BLE112, do this first. The CC-Debugger plugs into the USB Port and has a ten pin IDC interface for programming the BLE112. On the USB-BLE112, there is not enough room for a connector so we have placed an IDC10 connector footprint which the CC-Debugger can be plugged into. To improve contact, the connector can be twisted gently and when the green light is on, the USB-BLE112 module is ready to program.


How to Compile
The Bluegiga documentation is very extensive on the BLE112 but is dry and lacks examples. The best way to learn how to program is to download the example projects, compile and download them and then modify.

EDIT: The bluegiga website has been upgraded so the links below have moved. 

To compile, go to Bluegiga Support, login (or register), click on the BLE112 picture, select Software Releases and download Bluetooth Smart v1.1.1 (refer to picture above)  and then download the BLE Update program available by scrolling down to PC Utilities (refer to picture below) - it is called the Bluetooth Smart firmware update tool.


Now download, the four sample projects, EV_MASTER, EV_SLAVE, D_MASTER and D_SLAVE. EV stands for Evaluation kit and this software should be programmed into the USB-BLE112 while D stands for dongle or the BLED112. Double clicking on the .bgproj file will now open the BLE Update program. If no .bgproj file is available, just copy the project.xml file and add a .bgproj suffix. Please note that the first time this is used, a licence key will be needed. This can take up to 24 hours for Bluegiga to reply.

With the BLED112 dongle, this can be programmed using the DFU program. Below are the contents of a batch file and the out.hex file should be taken from D_MASTER directory.
..\..\bin\dfutool.exe 2458:fffe out.hex

The Firmware
The firmware is in the .bgs or bluegiga script file. Bluegiga recommends Notepad++ as the editor and there is a Bluegiga extension for Notepad++. Below is the first part of the firmware which shows the initial routine (or the setup() routine for Arduino users). The endpoint is the port which the data uses to trasnkit & receive. System_enpoint_uart1 is equal to 5 and is the second serial port with the other serial ports being uart0, uarts 2 and uart3. call system_endpoint_tx is the same as a puts command and the second argument 63 is number of characters in the string. Hopefully later on Bluegiga will remove this but one way to find this otu is to compile and the compiler will advise what this argument should be.

event system_boot(major, minor, patch, build, ll_version, protocol_version, hw)
 
    endpoint = system_endpoint_uart1
 

    call system_endpoint_tx(endpoint, 63, "\n\r** Boot: Connection Slave, GATT Server ** Version: et-0.8 **\n")

Good Luck and may all your Bluetooth connections be successful.

Youtube video showing the BLE112 in action
http://youtu.be/8abV9guO654

References
Programming BLE112
Jeff Rowberg's BLE112 page on Inmojo

Tuesday, February 7, 2012

Interview with EEWeb

Here is an interview our Chief Technical Officer did with EEWeb. Clock on the link below to see the full interview

http://www.eeweb.com/spotlight/interview-with-fergus-dixon

Tuesday, November 22, 2011

EEPROM Emulator



Here is a video showing the EEPROM emulator in action. This device communicates using a standard serial port an currently supports 93c46, 93c56 and 93c66 devices with more devices to be added soon. A new feature recently requested is the ability to be able download a file. BlueTerminal has also been upgraded to add this feature.

Monday, November 14, 2011

USB-IR adapters


This video shows two USB-IR adapters communicating with each other at 9600 baud. A dip switch on the USB-IR allows the baud rate to be set to 19200, 38400, 57600 or 115200 baud.

Tuesday, October 18, 2011

USB WT12 Youtube video



A picture is worth a thousand words, and a video is worth a thousand pictures. This 71second video shows how easy it is to setup a USB-WT12 bluetooth adapter, read the settings, discover bluetooth devices and connect using the SPP profile. When connected, the bluetooth connection is just like a wired serial link, except there is no wire.

Wednesday, September 7, 2011

USB-WT bluetooth adapters


A new USB-WT11 bluetooth adapter has been added to the product list, and the USB-WT12 has had an upgrade. The USB-WT12 adapter has an internal reset switch which can be accessed with a paper clip. These adapters are available in gray or clear USB cases, and the price has been reduced from $120 to $99.

Friday, July 15, 2011

Blue Terminal v0.99

The E

The ESD Terminal emulator program has been renamed to Blue Terminal to reflect the focus on Bluegiga bluetooth devices. Many minor changes have been implemented such as adding a new HID Profile toolbar, adding a SEND button to be able to send data in multiplex mode, imrpoved multiplex mode support - the commands are automatically sent with the MuxLink set to 0xff. Also, the terminal box has been changed to blue font on a white background to make printing easier.

Friday, June 17, 2011

ESD Terminal v0.97


The ESD Terminal program has been updated to v0.97 with some improvements. COM ports 10 to 20 are now supported - this was due to a bug from the Microsoft where COM9 can open a port but COM10 cannot. Also, the missing character after linefeeds has been restored and AutoDetect will now show the highest COM port which is more likely to be where a BlueGiga device will be assigned. Help has had a minor update.

Friday, June 10, 2011

LIS331DLH test board


ESD has just finished a project using the iPhone accelerometer - the LIS331DLH. Sparkfun sell a zillion accelerometers but not the one used in the iPhone. This device made by SGS-Thomson uses very low power (~0.25mA) and can measure 3 axes to 16bits. Also, it can be interfaced via I2C or SPI. Email us for more info about this LIS331DLH accelerometer test board.

Friday, June 3, 2011

USB-IR dongle updated

The USB-IR infrared dongle is now available and is supplied with a transparent case. The lid covering the USB connector unclips and clips onto the back. A wrist strap can be attached to the Bud case.

USB infrared adaptors now sell for a few dollars but most are designed to communicate to computers using a software driven IrDA stack, and cannot send out SIR (simple Infrared) data at 9600 baud. Many instruments such as the Welch Allyn Spot Medical Instrument series use SIR to communicate and the default baud rate is 9600. The Baud rate can be adjusted up to 115200 baud using an internal dipswitch.

Tuesday, May 17, 2011

ESD Terminal v0.96

The ESD Terminal program has been updated to version 0.96. The help file is now linked to the program and can be accessed via F1. The data interface is now more snappy and the Offline/Online restore feature where the Com port is reconnected automatically still works. Backspace has been implemented and simple file logging has been added. When File|Log is selected a filename is constructed from the current date and time.

Friday, February 25, 2011

ESD Terminal v0.95

The next version of ESD Terminal v0.95 has been updated, and is available for a free download. Any enhancements of issues, please email with details, and this will be added to the next update. Positive feedback is also welcomed. The main terminal emulator for Windows 7 does not seem to have the capability of setting parity, databits or stop bits.

Wednesday, February 16, 2011

BT-Serial

A new product has been added - the BT-Serial bluetooth to serial adapter. This allows for easy setup to view and adjust the WT11 module settings. This module has been designed to be used in conjunction with the ESD_Terminal program.

Tuesday, November 23, 2010

ESD Terminal v0.94

ESD Terminal version 0.94 has now been loaded. This program is a serial terminal program designed to be used with a Bluegiga bluetooth device, or as a simple serial terminal. The changes include fixing some button functions (such as Call SPP which went missing), improving the speed on old computers, adding a Hex(adecimal) mode, echo, SPP and BGIO toolbars which are saved when the program is exited. The .cfg file contains all the settings in text format and can be viewed with Notepad.

ESD Terminal has some advantages over Putty which appears to be the default Windows 7 serial terminal program. ESD Terminal can handle a broken connection, and will automatically try to reconnect once a second. More features will be added to ESD Terminal, and the next one is to be able to log all data to a file. Any suggestions for improvements will be listened to carefully.


Monday, November 22, 2010

ESDN

The website has now moved to www.esdn.com.au which should be easier to remember than the last one. We have this website for 2 years, and plan to keep it renewed now indefinitely. Please update your bookmarks to reflect this change. Thanks.

Tuesday, November 2, 2010

ESD Terminal v0.93

ESD Terminal has now been updated. With the advent of Windows 7, Hyperterminal seems to have disappeared, and the Windows 7 replacement seems to be Putty which is a free download. Unfortunately Putty has a few hangups - ie, lose the com port and the program hangs up and has to be restarted. This version of ESD terminal handles this a lot more gracefully - the Statusbar will show the status of the conenction as either Online or Offline. Even better, disconnect the USB dongle, the Online changes to Offline, and when the USB dongle is reinstated, Offline becomes Online.

We have also added a AutoDetect for the COM port which fills the Combo Box with a list of available COM ports, one of which may be selected and connected.

New features are MUX mode, improved graphics for the PIO dir/on/off functions, updated help and other stuff. The main purpose of this program is to help us debug bluetooth connections using Bluegiga iWrap, and any comments on useful changes/upgrades/enhancements would be appreciated.

Wednesday, October 20, 2010

ESD Terminal v0.92

A new version of ESD Terminal has been posted. This is still a beta version (the aim is for v1.00 to be the first real problem-free version). The most important change here is the ability of the program to capture the MAC addresses from an INQUIRY command and load them into the Combo Box labelled MAC. This new version also has better support for shift characters such as : Any ideas on improvements would be appreciated - leave an anonymous comment. We plan to release a new version every month.

Thursday, October 14, 2010

USB-WT12 in case

We now have the next version of the USB-WT11 and USB-WT12 available, and they fit inside a small case with a cap. The case can be either opaque or transparent, - a photo will be put up soon.

Thursday, September 9, 2010

USB-WT12 and USB-WT41

Added the USB-WT12 and USB-Wt41 long range bluetooth modules. These photos are of the prototypes only, and are not representative of the finished product. The SMD leds now allow the status of all i/o ports to be easily viewed, and the reset button has been added.

Friday, September 3, 2010

USB-barcode

A new product, the USB-barcode has been added. This dongle is very simple, pressing a button activates the barcode scanner which then sends the barcode back via the serial port at 9600 baud.