Introduction: How to Upload Codes to NRF51822 Using NRF51-DK
Today, I am going to show you how to upload codes (alias; firmware) to any Bluetooth beacon has nRF51822 chip from nRF51-DK development kit via wired connection. nRF51-DK can be used to program nRF51822 included Bluetooth Beacon hardwares.
The need list:
2. Any Beacon module includes nRF51822 chip
4. Micro usb cable
Step 1: The Connection
nRF51-DK's programming pins are eight. We need only four pins of it. These areas seen on picture above:
RED Wire = VTG (Voltage Triger Pin)
GREEN Wire = SWDIO
WHITE Wire = SWDCLK
BLACK Wire = GND Detect Pin
Your nRF51822 chip probably on the surface of your product. It should be has got programming pins such as Debug/Debug out named.
You need to insert a battery to your Beacon and battery's positive pin has to get attached to Voltage Triger Pin of nRF51-DK, negative pin of Beacon's battery has to get attached to GND Detect Pin. This is for telling nRF51-DK to don't get a hex file from my computer, this code is not for you, it is for other side's hardware's code (firmware). So, When nRF51-DK detects a voltage source between VTG and GND detect pins, it will send the hex code directly to your Beacon module's nRF51822 chip. This is programming.
You need to use external batteries to supply your Beacon to get trig a voltage between VTG and GND pins.
Now, use micro usb cable to attach nRF51-DK board to your computer, attach your nRF51822 chip included Beacon board to nRF51-DK with tiny breadboard cables. Open nRF51-DK board with it's slide button and power your Beacon with external voltage source.
Step 2: Generate Hex Code on Mbed Compiler
On my early instructable, I told how to use developer.mbed.org online code developing website to program nRF51-DK, now while you are using mbed compiler, select nRF51822 as your platform to compile your codes for nRF51822 chip to get ready for sending this code to your Beacon via nRF51-DK board is attached to your computer via usb cable. (See the picture above, I add a picture how to select a platform.)
Now, click on compile button to generate a hex file to download to your computer, send this hex file to nRF51-DK from your file explorer there has to be J-Link folder, just drag and drop your hex file to there. I will upload hex file to your Beacon.
That's all !
Step 3: 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.