Page 7 - Programming the BLE112

With the Microduino successfully programmable, we move on to connecting the programming logic to the BLE112. The BLE112 will NOT work out of the box. I held off on using it as the core BLE chip due to this, but in the end, its strengths make this requirement worth it. It also means the module has much more flexibility compaired to other possible BLE configurations. Since we have already connected some of the power regulator elements, this step becomes slightly easier, but the small soldering required adds more complexity.

The BLE112 Programming Schematic:


1.) review BLE112

First, review the schematic (Both BLE112 and Programming). This is really useful when testing / debugging. The schematic shows a simple RX / TX / V / G / RST connection, but running the voltate and ground to the power regulator. I do this so there is a central power / ground letting you power both the microduino and (later on) the BLE112 while using a FTDI - USB adapter. This also shields the hardware a bit, as the regulator will take any voltage spike hits first.

BLE112 Overview


The BLE112 important connections are hilighted above. These show the soldering connections you will have to make. The BLE112 is a microcontroller all to its own, so some of the pins are configurable if you want to dive deeper into the BLE112 side. For expanded information beyond the scope of this build, here are 2 great links:

Bluegiga Ble112 details

Jeff Rowberg's Open Source BLE112/113 + Arduino Library

You will need to download the BLE112 + Arduino Library, and the software needed to program the BLE112 can be found on the BlueGiga link (You will have to register). Assuming the basic setup, the pins represent the following:

GND - standard ground. There is more than one to choose from.
RST - the reset pin
p0_4 - BLE TX serial
p0_5 - BLE RX serial
p1_6 - BLE module wakeup
p1_5 - BLE Microduino wakeup
DVDD - power feed (3v3)
AVDD - power feed (3v3)
AVDD - power feed (3v3)
p2_1 - programming pin 1
p2_2 - programming pin 2

2.) Connect Power / Ground

The first step in connecting the BLE112 is to give it power. Due to various internal configurations, this actually requires 1 connection to ground and 3 3V3 connections. I chose to connect to the ground pin on the side with less connection points, but there are other ground pins that you may find more accessable. (Refer to the Bluegiga page for more details). To solder these pins, the goal is to align the wire at a 90 degree angle to the module, then lightly press the wire into the have circle groove where you previously placed solder / flux. You may want to use flux here again. a little bit of solder on the backside is ok, but keep it to a minimum, as the backside adds thickness to the logic frame, which can cause some issues if there is too much solder in the wrong place.

For the 2 AVDD pins, just run one wire to both and join them with solder. The other end goes to the VOUT pin on the power regulator. Also run a line from DVDD to the regulator power out. If you forget this, it will not work!


Make sure you don't create a short between 2 connections or ground!

Solder Progression


3.) Connect Reset, and 2 Programming pins

Now, there are 3 wires from the programming port underside that need to be run to the BLE112. You want to trim the port wires, and join them with microwire to enable a BLE112 connection. When you connect the reset pin, also add a extra microwire feed. That will be used on the next page. Here are the 3 pins you will be running (assuming you are looking down into the port pin holes with it facing north):

4 = BLE Reset
5 = p2_1
6 = p2_2

Since these connections can be a bit tricky, I would suggest using a multimeter with continuity testing to verify all pins are connected successfuly. After that, lets test!


When running any wires, make sure they do not add to the 3mm height of the logic frame!

4.) Test Programming

Break out your CC Debugger. The connections are fairly strightforward. See the diagram below and connect the following:

CC Ground - pin 1 (Gnd)
CC Reset - pin 4 (BLE Reset)
CC Debug Data - pin 5 (p2_1)
CC Debug Clock - pin 6 (p2_2)

CC Debugger Port


Now power is not connected yet, and that is because we have to do one extra thing. The CC Debugger needs to detect the voltage, so run CC 3V3 to a breadboard. Then connect the CC 3V3 Feed to a line going back to the CC Debugger Target Voltage Sense. Then take another jumper from the breadboard 3V3 and run it to pin 3 on the logic frame programming port (the power pin). Plug the CC Debugger USB in, and press the reset button. Now check two things:

a.) you should see the Microduino red power LED light up

b.) the CC Debugger LED should be green.

If all goes well you should have something similar to the image below!



5.) Program it

First you will need to download the Jeff Rowberg's Open Source BLE112/113 + Arduino Library and get the required Bluegiga software from Bluegiga. The main program you need is the BLE SW Update tool. This simply lets you flash BLE112 programs to the chip. The BGLib contains precompiled firmware. As of June 3, 2014, Jeff hase 3 different compiled firmware bundles. OSWatch uses BGLib_U1A1P_38400 noflow_wake16_hwake15.

The first programming step is to make sure the CC Debugger sees your BEL112. Simply open up the Bluegiga BLE SW Updare tool, and press the refresh button. You should see CC Debugger by default selected as the main port. Then, press the Info button. You should see basic info about the connected BLE module.

Connection Established


Now that you have a stable connection, you need to browse for the location of the BGLib firmware you downloaded, and open the folder called BGLib_U1A1P_38400 noflow_wake16_hwake15. Within there, you should see a project112 file. Select that and press open.

File Selection


Finally press the update button. Uploading the program will take a few seconds. Assuming all has gone well, you should get a nice green screen to tell you everything worked out. You have now completed the setup neede for the BLE112 chip. Technically you will not need to program the BLE112 again.



Next Page - Microduino & BLE112

The Build