RN4020
The Microchip RN4020 is a qualified and certified
Bluetooth 4.1 radio module. The RN4020 takes its
instructions via ASCII commands over a UART
connection. Everything the RN4020 needs to transmit and
receive is packed in under the module’s shield. There are
also under-the-hood provisions for analog and digital I/O.
In that the RN4020 can operate alone under control of its
internal scripting engine, a resource-rich microcontroller is
not required to assist the RN4020. A pair of connected
RN4020s is perfectly capable of taking care of themselves
with little or no help from outsiders.
Bringing Up Baby
You are reading this column, which means you are
also perfectly capable of reading the RN4020 datasheet.
So, instead of spouting RN4020 technical specifications
and I/O capabilities, let’s discuss the RN4020 in the
languages of ASCII and C. Our RN4020 hardware will be
represented by the Microchip RN4020 PICtail which you
can see under the lights in Photo 1.
BLE radios split up as centrals and peripherals. The
peripheral radio advertises its connection status, while the
central radio starts the connection process. When a pair of
BLE radios connect, the next thing they do is bond. Once
the radios have bonded, security items are saved and used
for the next connection between the two devices. Bonded
radios cannot cheat and connect to other devices.
Controlling the RN4020
Figure 1 is a skeletal pinout of the RN4020 BLE radio
module. The WAKE_SW, CMD/MLDP, and WAKE_HW pins
are responsible for initiating RN4020 state changes. The
status of the RN4020 is reported by three output pins
(PIO1, PIO2, PIO3). Let’s check out the various RN4020
states and their consequences beginning with the
WAKE_SW pin.
The WAKE_SW pin (pin 7) controls the RN4020
operating state. When WAKE_SW is forced logically high,
the RN4020 wakes up and enters Active mode. After
being roused, the RN4020 will send “CMD” to the UART.
THE DESIGN CYCLE
The RN4020 PICtail Plus BLE
■ BY FRED EADY
58 April 2015
Bluetooth has morphed yet again, and it seems that everybody wants Bluetooth on their
iPhone or Android phone. These days, Bluetooth Low Energy (BLE or BTLE) is the new "must
have" control and monitoring medium. The new crop of BLE radios are (as a whole) easy to
use. Most every manufacturer's BLE radio entry has an associated firmware API (Application
Interface). Many of the new BLE platforms employ simpler data interfaces which are based
on good old RS-232. The iPhone and Android application creation barriers that have for too
long impeded interactive BLE control are falling like hot rocks from a caveman's hands. In
this edition of the Design Cycle, we will take a look at the latest BLE offering from Microchip.
■ Photo 1. The RN4020 PICtail is designed to allow us to
come up to speed quickly on the RN4020 hardware and
API. Almost everything we need to evaluate the RN4020
is soldered onto the PICtail printed circuit board.