This signals that the RN4020 is in Command mode and
ready to service commands coming in via the UART.
When the WAKE_SW pin is returned to a logically low
condition, Command mode is exited and “END” is sent to
the UART. The RN4020 will then enter Deep Sleep mode.
The MLDP_EV pin (pin 11) goes logically low to indicate
Deep Sleep Mode. If the UART baud rate is set for 2400
bps, the UART is always accessible and the WAKE_SW pin
does not need to be forced logically high to wake the
The CMD/MLDP pin (pin 8) is used to control the
RN4020 when the radio module is using the MLDP serial
data service. Forcing the CMD/MLDP pin logically high
puts the RN4020 into MLDP mode. In MLDP mode, all
data from the UART is sent to the peer device as a
datastream. This mode is useful for wire replacement
applications. Setting the CMD/MLDP pin logically low will
force an exit of MLDP mode, then the RN4020 returns to
Command mode and sends “CMD” to the UART.
If the RN4020 is in Dormant mode, taking the
WAKE_HW pin (pin 15) logically high will power up the
RN4020. Following the power-up sequence, the RN4020
can be instructed to perform a factory reset. The factory
reset is kicked off by flipping the WAKE_HW pin logically
high, logically low, and logically high three times within
five seconds. If the WAKE_SW pin is logically high during a
factory reset operation, a complete factory reset is
performed. If the WAKE_SW pin is logically low during the
factory reset, a partial factory reset is performed. A partial
factory reset preserves the device name, private service,
and scripts. A private service is any data link configuration
that is not a registered Bluetooth service. For instance,
Microchip’s MLDP is a private service.
Pin PIO1 defaults to the CONNECTION LED pin and
will present a logical high when the RN4020 is connected
to a peer device. The MLDP_EV pin is used as an indicator
in MLDP mode, and will go logically high when the
RN4020 must output a status to the UART or requests a
response from the host MCU. Active mode is indicated by
driving the WS pin logically high.
The RN4020 PICtail Plus Board
The business end of the RN4020 PICtail is exposed in
Photo 1. As you can see, all of the RN4020’s I/O pins are
accessible via a set of pads surrounding the radio module.
The RN4020 PICtail also includes an onboard 3. 3 volt
voltage regulator, a user pushbutton, three status LEDs, an
ICSP interface (J7), and an interface selection jumper (J1).
When jumper J1 is installed, the RN4020 PICtail’s
edge connector interface is active. The edge connector
mates with the Microchip Explorer 16 development board
or any other dev board that supports the PICtail or PICtail
Plus footprint. If the jumper at J1 is not installed, the
ADVANCED TECHNIQUES FOR DESIGN ENGINEERS
April 2015 59
■ Photo 2. The PIC18LF25K50 is configured as a USB CDC
device. This configuration allows the RN4020 PICtail to be
attached directly to a PC's USB port. Commands and data
are passed between the RN4020 PICtail and PC using a
simple terminal emulator program.
■ Figure 1. The
small and so is
the pin count.
That's a good
thing since the
more pins we
have to keep
up with, the
more code we
have to write.
CCS C Compiler