SparkFun Pro nRF52840 Mini Hookup Guide
Lets quickly overview Nordic's nRF52840. Its list of features is exhaustingly-awesome. Just to top off a few of our favorite features, there's:
- ARM Cortex-M4 CPU with floating point unit (FPU)
- 1MB internal Flash -- For all of your program, SoftDevice, and file-storage needs!
- 256kB internal RAM -- For your stack and heap storage.
- Integrated 2.4GHz radio with support for:
- Bluetooth Low Energy (BLE) -- With peripheral and/or central BLE device support
- Bluetooth 5 -- Mesh Bluetooth!
- ANT -- If you want to turn the device into a heart-rate or exercise monitor.
- Nordic's proprietary RF protocol -- If you want to communicate, securely, with other Nordic devices.
- Every I/O peripheral you could need
- USB -- Turn your nRF52840 into a USB mass-storage device, use a CDC (USB serial) interface, and more. This is a big add compared to the nRF52832!
- UART -- Serial interfaces with support for hardware flow-control if desired.
- I2C -- Everyone's favorite 2-wire bi-directional bus interface
- SPI -- If you prefer the 3+-wire serial interface
- Analog-to-digital converters (ADC) -- Eight pins on the nRF52840 Mini Breakout support analog inputs
- PWM -- Timer support on any pin means PWM support for driving LEDs or servo motors.
- Real-time clock (RTC) -- Keep close track of seconds and milliseconds, also supports timed deep-sleep features.
- Peripheral-multiplexing -- (Nearly) any pin can support any of the above features!
Nordic's nRF52840 builds on their nRF52832 by adding a heap (pun intended) of memory, but the most significant addition is that of built-in support for Full-Speed USB 2.0 interfaces.
The USB interface supports any USB device class you can imagine, including communication device class (CDC, USB-to-serial), mass-storage device (MSC, removable flash-drives), human-interface device (HID, keyboard/mouse), and audio.
On-chip USB support means, most significantly, that a USB bootloader can be built into the chip. No more USB-to-serial converters required to load compiled code onto your chip! For more information on the USB bootloader pre-programmed onto the SparkFun Pro nRF52840 Mini Breakout, check out the Using the Bootloader section.
Coming from the world of AVR's like the Arduino Uno's ATmega328 -- or even more modern processors like the SAMD21 -- one of the coolest features of the nRF52840's Cortex-M4 is its expansive pin multiplexing capability. Just about any pin can support any peripheral. Want UART0's RX to be on pin P0.02? You got it. Need to flip RX and TX? Just a quick definition change.
In the software development guides, we'll provide hardware definitions for "standard" I/O interfaces, but we'll also demonstrate how to tweak these definitions, so you can bend the nRF52840 to your whim.
The nRF52840's most unique feature is it's integrated 2.4GHz radio. This radio is most commonly used as a Bluetooth Low-Energy (BLE) interface, but it can also be used for Bluetooth 5 (a meshed, long-range extension of the Bluetooth spec), ANT (a proprietary network usually used for heart-rate monitors), or Nordic's proprietary 2.4GHz interface.
A Note on SoftDevices
To use the radio for any of the Nordic nRF52840's 2.4GHz RF interfaces -- Bluetooth, proprietary or otherwise -- you'll need to load a SoftDevice onto your nRF52840.
A SoftDevice is a "precompiled and linked binary software implementing a wireless protocol." It provides easy access to a Bluetooth or other 2.4GHz radio stack. They are, unfortunately, closed-source, but they do reduce complexity and compile-time for your application.
We load the S140 v6.1.1 SoftDevice onto the Pro nRF52840 Mini Breakout in production here at SparkFun. The S140 SoftDevice supports Bluetooth Low Energy applications.
New SoftDevices can be loaded onto your board via the USB bootloader, but it's important to know which SoftDevice is currently loaded.