Introduction: The First Usage of NRF51-DK

About: My name is Bay Yolal, hello everybody!

Today, I am going to show you how to use Nordic Semiconductor's brilliant development kit nRF51-DK board for the first time! Wow, I am so excited now because with this development kit you can easily become a master of Bluetooth world! Not only Bluetooth, but also Beacon technologies are generally tested on this development kit. Nordic Semiconductor's development kit is compatible for Arduino shields. If you have got Arduino motor shield for example, you can attach to nRF51-DK's arduino pins and code whatever you want. Internet of things and machine to machine communication are wireless with this board.

I said "Bluetooth of Things" as called BoT now!

Woohoo!! I am so excited to write first instructable about nRF51-DK for anyone in the world! Let's take a look!!!

The need list:

1. nRF51-DK

2. Micro usb cable

3. Your computer with internet connection.

4. Android v4.4+ Phone (iPhones are okey)

nRF51-DK features are: (Datasheet)

• nRF51422 flash based ANT/ANT+, Bluetooth low energy SoC solution

• 2.4 GHz compatible with nRF24L devices

• Buttons and LEDs for user interaction

• I/O interface for Arduino form factor plug-in modules

• SEGGER J-Link OB Debugger with debug out functionality

• Virtual COM Port interface via UART

• Drag and drop Mass Storage Device (MSD) programming

• mbed enabled

Step 1: NRF51-DK Unpacking and Photos

nRF51-DK is well-designed electronic board. The company Nordic is very gentle. When you buy the product of Nordic, there is "Thank You" letter for motivation.

WARNING: While unpacking the package, be aware of electrostatic decharge in case of any burn or damage to your new card. Don't forget to neutrolize yourself to the ground with protectors such as gloves, shoes, e.t.c.

Step 2: NRF51-DK Battery, Buttons and Leds

There is CR2032 3V battery cell on the rear. On the same side, you can see pins with name each. Pin order seems ordered but focus again to check differencies. Pin from P0.01 to P0.06 are on the right side, the others are on the left P0.07 to P0.30 are on the left side of nRF51-DK board.

From P0.01 to P0.30 we have got 30 GPIO pins to use. Check the diagram between left and right pins, there are two table noticed begins with nRF51 target as a title. (Check for photo)

GPIO - Function - Short - HW

P0.17 - Button 1 - . - .

P0.18 - Button 2 - . - .

P0.19 - Button 3 - . - .

P0.20 - Button 4 - . - .

P0.21 - LED 1 - SB5 - .

P0.22 - LED 2 - SB6 - .

P0.23 - LED 3 - SB7 - .

P0.24 - LED 4 - SB8 - .

There are four buttons and leds on the nRF51-DK. The table above shows us to use which button and led is attached to GPIO pin. GPIO means generic port input output. So, you can code these pin easily to act whatever you want. For example, you can blink a led with GPIO pin, you can run a servo motor by reading other GPIO pin's logic level status e.t.c. GPIO means functionality. The table above refers to design pattern of buttons and leds. You can also see the SB5, SB6, SB7, and SB8 on the top of the board.

Step 3: NRF51-DK Other Details

On last step, we focus on rear, now the front side is more important as well. On the surface there are:

1. mbed Enabled mbed.org

2. Segger ID sticker with PCA10028 v1.1.0 2015.18 which I have.

3. Segger J-Link Technology www.segger.com

Now, let's examine what are these mean.

1. Mbed Enabled means you can write code online on mbed.org website. There are a lot of available libraries and code examples on there to develop qucik projects. Go to mbed.org and create an account, go to developer.mbed.org website and start coding. (Check next steps) You can compile your project and get a hex file.

2. Segger J-Link technology allows us to send hex file to nRF51-DK board from our computer where we developed and compiled on mbed.org website then we get hex file from cloud. This option is for drag-and-drop the hex file to nRF51-Dk board via usb cable. Soon I will show you on next steps.

Step 4: NRF51-DK Datasheet

Step 5: NRF51 First Time to Connect to PC

1. Plug in micro usb cable to nRF51-DK board

2. Plug in other side of micro usb cable to your computer.

NOTE: On my Windows 7 x64 computer, I couldn't find correct driver to see J-Link. If you have got Windows 7 x64, you may not able to use nRF51 directly. I tried Windows 8.1 and it is worked but Win7 didn't work. So, I am using Windows 8.1 computer with me.

3. On next steps, I will show you how to code, but before go there, I want to say you can drag and drop hex files directly to the nRF51-DK on My Computer side. When you attach nRF51-DK board to your computer there is a new drive appeared, drop here your hex code to program your nRF51-DK. Also I give you an example code to send your board if you connect nRF51-DK to your computer. (Check the attachment on this step - Example shows you are publishing randomly and blinking led1)

Step 6: NRF51 Blink Example - Hello World - Mbed.org

1. Go to mbed.org and sign up today, with your new account go to developer.mbed.org

2. On left-top side >> click on New >> Platform = Nordic nRF51-DK >> Template = Empty Program >> Program Name = Blink >> OK

3. Right click on your new program >> create new file >> name = main.cpp >> Type this code:

<p>#include "mbed.h"</p><p>DigitalOut LED_1(LED1);</p><p>int main() {
    while(1) {
        LED_1 = 0; // LED is ON
        wait(0.9); // 200 ms
        LED_1 = 1; // LED is OFF
        wait(1.0); // 1 sec
    }
}</p>

NOTE: Don't forget to select nRF51-DK board as your current board from top-right panel. You need to select your hardware first to progress!

4. Click on compile button and get a library error on the bottom >> select fix it >> select the first library to add your platform >> Click on compile again and get hex code to your computer from your online compiler platform.

5. Connect your nRF51-DK board and drag&drop your new created hex file to nRF51-DK side on My Computer window to choose nRF51-DK's folder.

NOTE: If there is no connection between your nRF51-DK board and your computer, you need to install the necessary driver. Or, basicly, check other computer such as Windows 8.1 or Windows 10 to work fast instead of Windows 7. I mean I couldn't use my Win7 x64 pc to recoginize my board. Maybe this solves your problem anyway.

NOTE: If you could blink a led 1 now you said HELLO WORLD !

Step 7: NRF51-DK Beacon Usage

Now, you have got online compiling platform: developer.mbed.org also you can use Keil, IAR, e.t.c. programs to develop codes. On mbed side, you can be able to code fast ever! For example let's learn nRF51-DK's MAC address.

1. Go to BLE_BASIC code page: https://developer.mbed.org/users/MetaMika/code/BLE...

2. Click on "import this program"

3. Don't tick "update all libraries to the latest revision" if not necessary

4. Select import

Now, as one step before, do compile and send the generated hex code to nRF51-DK board.

Go to nRF Master Control Panel program to download from Google Play now, load and run this app, you need to allow GPS and open your phone's Bluetooth. Scan for available beacons. Now you can easily see what the MAC adress is about your nRF51-DK board. (Don't forget to write this MAC address in case to forget.)

NOTE: You can not learn what is your MAC address with iPhones. I don't know why but Apple wants this to hide.

NOTE: MAC addresses are unique address which is made by hexadecimal numbers. For example, 12:34:56:78:9A:BC is a kind of beacon's MAC address. You can not change MAC address in general, this is about manufacturer design to do.

Step 8: To Sum Up

I just want to write just a beginning of Nordic Semiconductor's nRF51-DK kit to show you what this board can do in simple. Also nRF52-DK is available. Developers are using this board to develop beacon technologies and classification. Using nRF51-DK is very easy to get start on wireless communication in near range because mbed enable option is very fast and you can easily code fast, and without micro usb cable, you can run your development kit with 3V battery cell. Also on mbed site, there are a lot of people programming nRF51-DK.

By the way, I guess this instructable is the first topic about nRF51-DK.

.

That's all !

Step 9: BONUS: Reading This Instructable

NOTE: This instructable's step is aimed for visually impaired people to hear the sentences to learn what's going on here. Watch the video, it explains all steps.

Step 10: BONUS: Getting Started With NRF52-DK