RN4020 PICtail/PICtail Plus Board Users Guide FIGURE 1: Microchip RN4020 Certified Bluetooth OVERVIEW Low Energy (BTLE) Module The RN4020 PICtail Plus Daughter Board is a Bluetooth Low Energy demonstration board that showcases the Microchip RN4020 Certified Bluetooth Low Energy (BTLE) module. The RN4020 module is a single-mode Bluetooth Smart module that complies with Bluetooth Core Specification 4.0. The high-speed UART interface and the General Purpose Input Output (GPIO) Ports are available on the RN4020 module to configure, control and transfer data. The RN4020 PICtail Plus Daughter Board has PICtail Plus and PICtail connectors to interface with a PIC microcontroller (MCU) on the development boards that support PICtail Plus or PICtail interface with the required pin mapping. The PICtail board also has a PIC18 USB-to-UART serial bridge on the board to enable easy serial connection to a PC over USB. The PIC18 also exposes a command shell to control its GPIO ports. FEATURES Microchip RN4020 Certified Bluetooth Low Energy (BTLE) module PICtail Plus Daughter Board or PICtail Daughter Board connection interfaces GETTING STARTED PIC18 USB-to-UART serial bridge/converter with The RN4020 module on the RN4020 PICtail Plus a command shell for IO control Daughter Board exposes a high speed UART interface which can be used to issue ASCII commands to config- Status LEDs and utility button ure and control the RN4020 module. For more informa- tion on the RN4020 commands, configuration and BOARD CONFIGURATION examples, refer to the users guide for the RN4020 The jumper JP1 on the board can be used to select module. between PICtail mode or USB-to-UART bridge mode. While in PICtail mode, the board can be plugged into any standard Microchip development board that When JP1 is shorted, the board operates in PICtail supports the PICtail Plus, or PICtail, connection mode. In this mode, the UART, control signals, and digital inputs/outputs can be accessed over the stan- interface. dard PICtail Plus or PICtail connection interfaces to be Note: Ensure that the PICtail connector pin-out on driven by a PIC MCU. The USB-to-UART serial bridge the host MCU development platform sup- over J5 is turned off. ports the pin-out on the PICtail interface on When JP1 is open, the board operates in USB-to- the RN4020 PICtail Plus Daughter Board. UART bridge mode. In this mode, the PIC18 USB-to- The firmware running on the Microchip 8/16/32-bit PIC UART serial bridge over J5 is turned on, and the PICtail MCU can be used to interface over UART and IO ports interface should not be used. with the RN4020 on the PICtail board. Refer to the Note: Ensure that the USB mini-B cable is Other Information section for information about detached when operating in PICtail mode. downloading PIC workspaces for PICtail mode. 2014 Microchip Technology Inc. DS50002265A-page 1RN4020 PICTAIL PLUS DAUGHTER BOARD While in USB-to-UART Bridge mode, the board can be FIGURE 2: PIC18 Command Shell plugged into a PC that supports serial COM ports. When plugged in over USB mini-B receptacle J5 to a PC, the board enumerates as a serial COM port. A ter- minal emulator application on the PC can be used to open the COM port and issue commands when the RN4020 is in Command mode, or to transfer data when it is in Microchip Low Power Data Profile (MLDP) mode. The USB-to-UART Bridge mode enables a simple com- mand shell running on the USB-to-UART Bridge that is used to control the GPIOs on RN4020 through the PIC18. Typing with a carriage return on the termi- The supported commands are listed in Table 1. The nal emulator will enter the PIC18 command shell, as supported commands can be issued with carriage seen in Figure 2. return after entering the PIC18 command shell, as in Typing with a carriage return a second time on the the example that is shown below. terminal emulator will exit the PIC18 command shell. There is a 1 second guard band duration for both entry into and exit out of the command shell. Command shell is entered or exited only if there is no data transfer during the duration of the guard band. EXAMPLE 1: I A,04 // Sets the PIC18 IO port RA2 to logic HIGH I C,02 // Sets the direction of PIC18 IO port RC1 to input I%B // Reads the logic levels on PIC18 IO port RB TABLE 1: BASIC COMMANDS SUPPORTED IN THE PIC18 COMMAND SHELL Basic Commands Supported Description I X,YY Sets or Clears the IO port A/B/C on PIC18 I X,YY Sets the direction of the IO port A/B/C on PIC18 I%X Reads the IO port A/B/C on PIC18 H Provides help on supported commands and may show additional commands, if available V Version of the command shell Legend: X A or B or C YY Hex byte value OTHER INFORMATION REVISION HISTORY To obtain the most recent and complete RN4020 data Revision A (June 2014) sheet, users guide, and code examples, visit the This is the initial release of this document. Microchip web site: www.microchip.com/rn4020 DS50002265A-page 2 2014 Microchip Technology Inc.