Here’s a breakout board I made for it, using a Johanson balun and chip antenna. It takes a little help from the Internet, but I got it to work with Nordic’s SDK and the gcc-arm-none-eabi toolchain. Haven’t tried debugging yet.
Bluetooth Low Energy (or Bluetooth 4.0) is a new protocol that’s much simpler than traditional Bluetooth and optimized for low duty cycle communication such as heart rate monitors, fitness devices and remote control. For iOS, it has the added virtue that apps can use custom Bluetooth devices directly without requiring special hardware approval from Apple and their MFi encryption chip.

The transceiver inside nRF51822 (96.5 dB link budget) supports both Bluetooth Low Energy and Nordic’s proprietary nRF24L01+ protocol, which everyone and their mother seems to be using in their designs these days. The physical layer makes raw packets are made available in a frame buffer. Nordic provides a free S110 “softdevice” stack that handles the Bluetooth protocol.

The microcontroller is pretty nice too: it includes AES encryption, 12-bit ADC, and a switch matrix that allows you to map almost every digital function to any pin. There’s 256 KB of flash (80 KB of which are needed for the Bluetooth softdevice) and 16 KB SRAM.

With chip antennas and integrated passives, it’s never been easier to realize an RF design. Leaving out the 1.9V DC/DC converter (using the on-chip LDO instead), the minimum circuit for nRF51822 has 6 decoupling caps, one pulldown resistor, a balun, an antenna, a 16 MHz crystal and two load capacitors.

The TI part is pretty horrible for hobbyists because the interface to the BLE PHY is not documented. It has a similar architecture where Bluetooth LE is handled by a library they provide (which Nordic calls a “softdevice”), but you need an expensive IAR license to link to it. The call conventions are different from what sdcc does. The 8051 microcontroller is also not nearly as nice as the Nordic one. IAR is one of those commercial products that is so expensive that it’s hard to even figure out how much it costs.

Nordic’s default toolchain is Keil, which isn’t cheap, but as I wrote it does work with gcc.

Compiler: The Keil ARM-MDK compiler is a free tool chain that allows up to 32k of compiled code to be developed. This compiler may be downloaded from the Keil website. The stacks, AKA the “softdevice”, size does not enter into this number as it is delivered as a precompiled .bineray (.hex) and is loaded by the developer. Nordic is also supporting GCC.

This device may also be purchased with the ANT protocol already programmed and is labeled the nRF51422.

Guan Yang is right, you really do require the IAR compiler to use the TI part. It costs $3k.

The Nordic part is much much nicer – I think you’d have to be totally crazy to use the TI part.

You can buy the nRF51822 dev kit for $100 which includes a segger j-link to program the chip and debug it. It also gives you access to the SDK.

In my opinion the SDK should be free and you should be able to use any old arduino/bus pirate/etc to program it (and some people have had success with this approach), but $100 is still pretty damn good compared to $3k.

I should add that Bluegiga BLE112 is a module that includes the TI part. They have their own Bluetooth stack (meaning they got access to the full datasheet), and if you are willing to only code in their scripting language, you can avoid getting an IAR license. The modules are a lot more expensive though.

Your comments on TI are interesting too – I had heard that the stack could only be used with their chain. The CSR devkit otoh, is more expensive up front (so a different hobbyist hurdle), but doesn’t have hidden further toolchain costs. Again, it works the same way – link against a stack library, but some parts have that in ROM, saving codespace.

I’ve not looked at the Bluegiga scripting language, so don’t know how powerful (or limiting) it is, but I guess that kind of approach is the hobbyist ideal…

I think the zeitgeist these days is for standard parts so your design could potentially be mass produced, and relatively thin layers on top of the underlying hardware or tools so you can get a simple development environment, but still go to the metal if you need to. Arduino is very popular these days, BASIC Stamp not so much.

Looks interesting this nRF part. Much better than the closed down firmware of the BLE112/113.

Unfortunately their datasheet is not accessible without login.

What I’m interested in is the current consumption when sleeping. They claim 530nA in sleep with ram retention. Does that include any kind of oscillator or rtc to wake up after some time, e.g. after a minute or so?

The primary reason for having a lock on the datasheets is so anyone with the Product Key will need to register once (takes a minute or so) and then you will get automatic updates on the datasheets, dev kits and the like as they are made available. You can contact one of the three Nordic Semiconductor distributors or contact Nordic Semiconductor via the support portal for more information on how to obtain a Product Key. Purchasing of one of the $99.00 nRF51822-EK kits will get you the product key (It is located on the lable) . The product key gives you access to documentation, the SDK, hardware files and the development tools that Nordic Semiconductor provides for that particular product.

So it seems like you can get into the range of about 1µA when you want some kind of timed wakeup. This still isn’t too bad.

I took a look at your files for this breakout on github. Would you mind to add some more component info into the schematic, like for the balun, antenna stuff and inductors? That would make it more easy to get a complete BOM for ordering the parts.

I’ve seen that you already have a version 2 up which uses a p-fet for reverse battery protection. What kind of fet are you planning to use there? Most models I’ve seen in the sub-3v range have a gs-leakake of around 100nA which I’d like to avoid.

Eel: As you can tell, version 2 is nowhere near complete. It will use a 3225 crystal and include the 32.768 kHz for a few hundred nA power savings in sleep mode. If there is room I will also put the standard 50 mil 10 pin debugging header so it can be used with the mini Segger debuggers included in the Nordic eval and development kits—might sacrifice a pushbutton for that. I don’t plan to select the p-FET very carefully because I’m not worried about current consumption at that magnitude. Is there a better solution?

I will update the schematic soon. In the meantime, the balun is 2450BM14A0002 and the antenna is 2450AT18A100E. (The balun footprint might be 5 to 10 mil or so off, but as you can see I managed to solder it.) The inductors are basically what Nordic specifies in their sample circuits, all 5% tolerance. They are only needed if you use the buck converter. There’s also a ferrite bead which is whatever I had lying around.

> I don’t plan to select the p-FET very carefully because I’m not worried about current
> consumption at that magnitude. Is there a better solution?

The fet is better with higher consumption during transmit. But it always has a few nA leakage. A Schottky doesn’t have the leakage, but the higher voltage drop, costing you when running the dc/dc. So which is better depends on your sleep/run ratio. But maybe there is a fet out there with really low leakage – that is why I was asking.

> the balun is 2450BM14A0002 and the antenna is 2450AT18A100E

Thanks. Seem to be only available at Farnell/Newark, but they don’t have the nRF… :(

If you don’t mind using up a lot of the battery in case of reverse polarity, you can always put the shunt diode back and add a PTC fuse.

By the way, that balun is designed for Nordic’s nRF8001, a BLE chip without microcontroller. I assumed that it has basically the same radio as nRF51822, and it works well. The folks at Johanson tell me that they have a new design with a better match for nRF51822, which will be available in the Fall. There is also BAL-NRF01D3 from ST (not sure about the stock situation), and it’s not that hard to solder the 5 0402s you need to create a balun from discrete components. That’s especially true if you use a stencil. I don’t know about you, but I require a stencil and reflow to handle QFNs.

One big advantage of nRF51822 over nRF8001, apart from the fact that you don’t need a separate microcontroller, is that you don’t need to use the nRFgo Studio software to device services. Everything can be done by talking to the softdevice.

I’d hope to get a reply from the author too. In the meantime, my original analysis.

> i. how do you know that the antenna is tuned properly with the balun?

That balun specifically adapts complex impedance as output by Nordic chip to 50ohm. Antenna also has input impedance of 50ohm. So, what’s needed to be done for perfect match is transmission line (microstrip) of same impedance. Such microstrip would be ~3mm think for FR4 of 1.6mm width or half that for FR 0.8mm. Guan Yang has width ~0.7mm, so clearly doesn’t provide 50ohm impedance. However, rule of thumb is that you should bother with impedance matching only for transmission line length of >1/10 wavelength, that’s 1.25cm for 2.4GHz, this PCB has ~2mm length. Overall, that’s why using balun and chip antenna is cool.

> every PCB will have different ground planes so, how does the balun deal with tuning of the antenna?

Common recommendation is that there’s no ground plane under antenna. Then rest of PCB’s ground plane will serve as antenna’s ground plane.

> wouldn’t adding sensors and components to the breakout of the board change this ground even further and make the antenna detune as well?

Sure, everything has butterfly effect. But if that effect is below <1%, why would you bother? There're other ways to "detune" antenna, for example placing design in a (plastic) box will change electric permittivity *around antenna* (not just around ground plane), and can lead to say 5% "detuning". Solution? Sure, if you have network analyzer on your table, feel free to make zillions of iterations to get out last nanowatt of power. Everyone else just doesn't care. And yes, (small) radios around have losses 20% or maybe even 50%.

Hello, I want to use nrf51822 for my research project. Could you tell me or direct me to a link that explains how to program it and use it? Do you need the nrfgo starter kit to program it? Is it possible to just connect few wires to the chip, after all the caps and antenna circuits are in place, and program from a computer?

Oh, and the $300 nRFgo Starter Kit is, in general, not necessary. If you get the development kit (instead of the evaluation kit), it’s the easiest way to power the boards and test them, but if you’re a little creative and look carefully at the schematics you can find a different way to power the two boards included in the development kit.

Thank you very much for that nice article!
I want to use the nRF51822 in combination with another µC. So, of course, I need to program both IC’s. But now I got one question: What if I’d buy myself a Segger J-Link Debugger for educational purpose…how do I program and debug the nRF51822 then? I can’t find any information on the used interface….?

Note that Nordic combines the serial wire clock and reset lines. I’m not sure all otherwise SWD capable debuggers can deal with that. At least for getting started with nRF51822, I would highly recommend a Segger J-Link debugger, either the ones included (in various forms) with Nordic’s kits, or a standalone J-Link.

I’m using the dev kit and the Segger programmer. The dev kit is well worth the $100. I am able to program the two other boards (not usb dongle) using included Segger debugger. It’s necessary to externally power the board, use pins 1 (3.3V) and 5 (Gnd) on the P2 connector; this takes 0.5mm 2×40 pin header.

I’m about to design a board based on Guan’s design. I’m thinking of using PCB antenna because I’m not space constrained, and I’ve read that PCB antenna can be more efficient. I guess it has to be tuned though, so that may be argument against it. I’m a programmer, not an EE, so any tips would be appreciated.

I’m trying to use the nrf51822 development kit without the nrfgo board. I’ve connected 3.3V to pin 1 and ground to pin 5 of P2. When I try to upload from keil I get the error “JLink Warning: RESET (pin 15) high, but should be low. Please check target hardware.”
The other strange thing is when I measure the voltage from my source without connecting the chip, I get a solid 3.3V. When I connect the dev kit board to the voltage source, the voltage drops to around 1.5V. This maybe what is causing the issues. Any idea why this would be happening?

You must be connecting to the wrong pins. What’s powering the board? Is it a supply with the current limit set low? As soon as you see the voltage drop that much, that’s the problem; you wouldn’t even think of trying to connect to it. It’s been a few months, but I don’t recall having any such problem.

Hey Charles, I’m using a 9V battery with a 5V linear regulator and then using some resistors to divide to 3V3 so there shouldn’t be any current limiting that I’m aware of. Looking at the underside of the board, I’m connecting power to the bottom right most pin on the bottom header and GND to the pin 2 to the left of that. What would cause such a significant voltage drop and what would be the repercussions of connecting to it?
PS couldn’t figure out how to ‘reply’ to your response.

My R1 = 2200ohm and my R2 = 4700ohm. 4700/(4700+2200)) X 5V = 3.41V Which is what I was seeing when I hooked up the multimeter before adding the dev board to the circuit. I would have thought the 5V regulator would have given me a steady enough Vin that I could use voltage division to get the 3V3. Anyway, I hooked up the board to the 3V3 pin of my rpi instead and was able to flash the devices with no problem. Sounds like I’m missing some fundamentals. Anyway, thanks for the speedy response.

Glad it’s working. Your circuit would look like (Thevenin equivalent) a 3.41V source with a 1.5k series R. If you pull 1mA from it, the 1.5k drops 1.5V, dropping you down to the 1.5V range. Seen another way, if you pull current from a resistor divider, it’s like adding a third resistor to ground, which changes the voltage.

That’s hilarious, people use kiloohm resistors and say “there shouldn’t be any current limiting that I’m aware of.” And these people hack Bluetooth Low Energy. I guess it’s just New Year joke. Funny, indeed.

I’m a little confused… What is necessary to get access to the BLE (s110) stack provided by Nordic? Is the product key of the development kit enough or do I also need to buy the expensive nRFgo starter kit?

The product key is located on the Dev kit box or label of the evaluation kit and is all you need to access the area on the Nordic website where the s110 soft device is located as well as other associated files. The soft device is loaded into the nrf51822 SoC via the nRFgo studio utility and the Segger J-link lite programmer / debugger.

Hope this helped. BTW.”..The Nordic website also has a new developers forum for public discussions such as this..

I have been playing with the nRF51822 also. It reminds me of CC2540 but with an ARM instead of and 8051. From an RF standpoint, it works similar to the CC2540. I’ve tested CC2540 a lot,, but with the nRF51822, I just walked around the building with a linked board.

I’m seeing about 4.4mA running code from flash, about 12-30 uA in sleep, and maybe 50 uA while advertising at a few hertz. The radio power consumption is quite low and can be well controlled by advertising and connection interval settings. It’s really more about your application and what advertising intervals you need, etc. There’s a really nice radio notification feature that you can use to see when the radio is on. There are a few silicon bugs to be aware of that cause higher current consumption, but mostly have work arounds.
If you haven’t checked out the Nordic DevZone, you should! -c

@JT
If you follow the link in my post you can see some posts of advertising and the communications at the connection intervals. The sleep current is in the uAs and doesn’t show up in my setup. To measure sleep current, I’d need to not transmit and use a bigger sense resistor. I may do that in the next few weeks. I’m also going to more testing on the new ‘922, which supports BLE and ANT. There are a few more nRF51822 current plots here.
CJ

V useful blog, many thanks. Can I ask if you have tested / have a feeling for the comparative effectiveness of the various versions (pcb / chip etc) of the balun/antenna combos you’ve tried? Also any hard-won experience from your PCB layout / RF testing? Lastly, do you think the suggestion of halving the antenna track size for 0.8mm is good or unnecessary?

I have done this testing with CC2540 but not this chip. Here is a link to some CC2540 balun testing I did two years ago.

I found the integrated balun/filter was about 1dB – 1.5dB worse than a discrete network.

I also tested various trace antennas. I found a meandering trace to be a few dB better than a chip antenna. All traces and chip antennas, no matter how closely I followed app notes, needed significant matching to hit 50 ohms.

I tested various trace thicknesses: it didn’t obey some easy law like the ticker the better or the longer the better. In fact, one trace I did really long and fat that I knew wouldn’t fit in my enclosure, just to see how good a trace antenna could be, didn’t work as well as thinner traces.

If you have the time you could make several boards with different trace geometries. Scrape away trace to shorten them until they resonate on the 2.4GHz band. Then tweak the matching to get to the center of the S11 Smith Chart. Do this to all test boards. You’ll find several dB difference in performance.

If you have plenty of link margin (extra signal strength) just make something that works out to roughly half wavelength on paper and go with it. Spending weeks testing different geometries will only buy you a few dB, maybe 6dB, over some random piece of trace matched to 50 ohms.

I haven’t tested different combinations myself, and in general things have worked quite well or well enough, so unfortunately (?) I don’t have any hard-won experience.

If you have a track width calculator handy like the one in KiCad, I would look into using grounded coplanar waveguide instead of microstrip. That’s basically where there is ground plane both on the opposite side of the board and surrounding your transmission line, the way you would do a regular trace through ground plane. The math works out so you can have much thinner traces.

(I think you meant transmission line track width, not antenna track width for a trace antenna. If you’re doing a PCB trace antenna, track width is probably less important because there’s usually no ground plane underneath, so PCB dielectric matters less. I’m just guessing here, IANAEE.)

Thanks for pointing that out – I had missed it. So to summarise … the QFN nRF51 package is called nRF51822-QFxxxx and needs the NRF01D3 balun and 2.2nF and 0.8pF capacitors and the BGA nRF51 package is called nRF51822-CExxxx and needs the NRF02D3 balun and just the 2.2nF.

Curiously, for QF/01 – the January ST balun docs have an unreferenced capacitor ‘XA’ and omit the 0.8pF, whereas the January Nordic reference layout has the 0.8pF and omits the ‘XA’ cap. Work in progress I think.

Also just noticed “nRF-Sniffer – PC Software and Device Firmware that allow you to see all Bluetooth low energy packets on the air between 2 devices” on the Nordic site.

I have begun working on this chip very recently. I made a custom board with nrf51822 chip with the necessary GPIOs and programming pins. I am using J-link EDU for programming and debugging purposes. So far i have only been able to read the chip id on J-Link Commander. But when i try to program the chip it says flash failed, problem with reset. I guess i have made some mistake in fanning out the necessary pins required to program the chip.

Kindly tell me which one of the pins on the chip are necessary for programming purposes and the connections to the debugger.

The nRF51 series only needs the SWDIO and the SWDCLK to program the chip. These lines are connected to the Segger programmer. You will need to connect the VTref lines on the segger programmer to the VCC on the target board. This sets up the level shifters in the J-link as well as letting the unit know there is a target board connected. Note. not all J-link products have level shifter and must be run at a target board level of 3.0 to 3.3 volts. (J-link lite for example)

I have to design a custom PCB board using the nRF51422 chip which is actually similar to the one. As it is my first experience with PCB design I would be grateful if you can give me some hints how to start or you can provide me with the information regarding your own design as I’m going to use Balun and chip antenna as well! (what kind of the SMD antenna and Balun you have used?) Thanks in advance for your help.

I have already seen this chip and as you said it must be easy to work with, but I still have problem with drawing the layout usin nRF51422 + this chip+ SMD chip antenna which might be for example FR05-S1-N-0-102!

I don’t really know how to start with the layout process and still not sure about the antenna I have to use.

furthermore I would like to know how I can program the chip in this board and which pins I have to consider for programming. I have already got the nRF51 DK)

Layout:
There are Gerber files located on the Nordic and Johanson website for the nRF51822 / 422 and their balun. The antenna used is a 1/4wave PCBA antenna. You will need to modify this layout to use a chip antenna. Johanson has app notes on that. Be sure to include the PI network between the balun and the chip antenna. This will be used for tuning the antenna if fine tuning is desired.

Programming:
If you have the nRF51-DK you can connect your target board up to the Debug Out connector (P19) on the nRF51-DK board for programming. The only lines you need are the SWDCLK, SWDIO. You also need to power up your target board independent of the nRF51-DK and run a voltage reference line from your board back to the –DK. You will need to keep your target board’s VCC 3.0 as there are no level translators on the –DK.
“When the external board is powered, the interface MCU will detect the supply voltage of the board and program/debug the target chip on external board instead of the on-board nRF51422.
Note: The voltage supported by external debugging/programming is 3.0 V.”

With the –DK you can use the stock J-link, or the j-link drag and drop, or the nRFgo Studio, command line based nRFJprog, the Keil compiler. You may also reprogram the Atmel device on the nRF51-DK to utilize the mbed drag and drop function as well. This firmware is located on the Nordic Website. Remember that when you use the drag and drop functions the flash is fully erased. Therefore it is necessary to merge the Softdevice with your application if you are using ANT or BTLE stacks. You can use a program like mergehex.exe to do that.

Hey Jay, I’ve been trying to do exactly what you’ve described here but am getting no joy. I’ve connected VTG from a power supply at 3V to my target board and pin 3 of P20, SWDIO and SWCLK. GND of both boards are connected together and also connected to pin 8 of P20. Seems pretty straight forward. I’ve tried the corresponding arrangement on P19 too. What are you using to do the actual programming? Do you have to disable the NRF on the DK? How do you tell the programmer which interface to use? Thanks in advance!

I read most of the postings, but discovered so far no hint for a plug and play solution. For embedded controllers connected via Ethernet I’m used to see an embedded internet server (one tiny example is mini-monster.ru . This is not possible using the ARM Cortex M0. Is there a version which has no internal PLC but only broadcasts measured values or may be polled?

It looks like Nordic opened up the download of the SDK (including the SoftDevice binaries) without asking for any product keys. I just downloaded nRF51_SDK_8.1.0_b6ed55f.zip from here without having bought anything: https://developer.nordicsemi.com/nRF51_SDK/. If this is indeed the complete SDK, then many thanks to Nordic for letting one avoid buying the eval kit and just develop on the own board directly.