RN4020 PICtail™/PICtail Plus Board User’s Guide OVERVIEW FIGURE 1: 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. Microchip RN4020 Certified Bluetooth Low Energy (BTLE) Module 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 • PIC18 USB-to-UART serial bridge/converter with a command shell for IO control • Status LEDs and utility button BOARD CONFIGURATION The jumper JP1 on the board can be used to select between PICtail mode or USB-to-UART bridge mode. When JP1 is shorted, the board operates in PICtail mode. In this mode, the UART, control signals, and digital inputs/outputs can be accessed over the standard PICtail Plus or PICtail connection interfaces to be driven by a PIC MCU. The USB-to-UART serial bridge over J5 is turned off. When JP1 is open, the board operates in USB-toUART bridge mode. In this mode, the PIC18 USB-toUART serial bridge over J5 is turned on, and the PICtail interface should not be used. Note: Ensure that the USB mini-B cable is detached when operating in PICtail mode. 2014 Microchip Technology Inc. GETTING STARTED The RN4020 module on the RN4020 PICtail Plus Daughter Board exposes a high speed UART interface which can be used to issue ASCII commands to configure and control the RN4020 module. For more information on the RN4020 commands, configuration and examples, refer to the user’s guide for the RN4020 module. While in PICtail mode, the board can be plugged into any standard Microchip development board that supports the PICtail Plus, or PICtail, connection interface. Note: Ensure that the PICtail connector pin-out on the host MCU development platform supports the pin-out on the PICtail interface on the RN4020 PICtail Plus Daughter Board. The firmware running on the Microchip 8/16/32-bit PIC MCU can be used to interface over UART and IO ports with the RN4020 on the PICtail board. Refer to the Other Information section for information about downloading PIC workspaces for PICtail mode. DS50002265A-page 1 RN4020 PICTAIL PLUS DAUGHTER BOARD While in USB-to-UART Bridge mode, the board can be 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 terminal 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 command 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 terminal emulator will enter the PIC18 command shell, as seen in Figure 2. Typing $$$ with a carriage return a second time on the 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. FIGURE 2: PIC18 Command Shell The supported commands are listed in Table 1. The supported commands can be issued with carriage return after entering the PIC18 command shell, as in the example that is shown below. 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 sheet, user’s guide, and code examples, visit the Microchip web site: www.microchip.com/rn4020 Revision A (June 2014) DS50002265A-page 2 This is the initial release of this document. 2014 Microchip Technology Inc. RN4020 PICTAIL PLUS DAUGHTER BOARD BOARD SCHEMATIC 3,2 3,2 3,2 3,2 %7B8$57B576 9''9 %7B8$57B7; %7B8$57B5; 6(16( %7B:$.( 3,2 %7B8$57B&76 9''9 &0'0/'3 6:$.( -3 0&/5 3,2 3,2 %7B8$57B5; %7B8$57B7; $,2 $,2 $,2 6:$.( 3,2 &0'0/'3 5 5 3,2 5 5 ' *UHHQ 5 5 *1' 9'' *1' 51 $,2 569' 0 $,2 569' 569' 8$57B7; 3,2 $,2 8$57B5; 5763,2 63,3,2 :$.(B6: &0'0/'3 - $,2 $,2 $,2 %7B8$57B7; %7B8$57B5; 6:$.( &0'0/'3 5)85;B( 5)87;B( 5*6&/ 5*6'$ *1' 5%$1 5%$1 *1' 5(,17 5'8576B( 9 9 9 5) 5) 5 5 9''9 ' 5HG 6 )1 5 N %7B:$.( :$.(B+: %7B:$.( 6:$.( %7B8$57B576 9LQ L 3RZHU1HW 0&/5 5%66$1 5)6&. 5)6',B( 5)6'2B( *1' 5%$1 5%$1 *1' 5(,17 5'8&76B( 9 9 9 5* 5* ' %OXH 3*' 3,2 3,&7$,/3/863LQ 5$ 5$ 5$ 5& 5& 5& 5$ 5$ 5$ 5& 5& 5& 9B9$5 *1' 3,&7$,/3LQ 9''9 L 3RZHU1HW &763,2 %7B8$57B&76 - 5( 5( 5$26& 5$26& 5& 5& 5% 5% 5% 5% 5% 5% 5% 5% - & X) 9''9 3,2 3,2 3*& 8 3,&/).,0/ 5$ 5$ 5% 0&/59335( 5% 5% 5% 3,2 9RXW 7&9'%75 9LQ 8 5& 5& 5& 986%9 ' ' 5& 3,20,62 %7B8$57B7; %7B8$57B5; 3,2 &0'0/'3 %7B8$57B&76 3,2 3,2 3RZHU1HW L & X) 6(16( %7B8$57B7; 9''9 3RZHU1HW L 986% 5 N 5 N 986% %7B8$57B5; ' ' 0&/5 - 3,&,&63 0/'3B(93,2&6 3,2 *1' - 63,B3,2 %7B8$57B576 3,2 569' 569' 569' 569' 569' 569' 3,2 %7B8$57B576 63,B3,2 9''9 3,2 3,2 3,2 3,2 %7B8$57B&76 %7B:$.( 3RZHU1HW ' L & Q) 9''9 3*' 3*& :63,2026, 3,26&. 3,2 *1' & X) 9''9 - DS50002265A-page 3 2014 Microchip Technology Inc. 986% 9LQ - 9%86 ' ' *1' %7B8$57B7; 6:$.( 07$% & Q) 30(*&7 86%0LQL% 9''9 & Q) %7B8$57B&76 9''9 5% 569' 5% &0'0/'3 5$ %7B:$.( 5$ 5$ %7B8$57B576 5% 5$ 966 5% 9'' 569' 5$ 5$ 966 5& 7+ 7DE *1' RN4020 PICTAIL PLUS DAUGHTER BOARD NOTES: DS50002265A-page 4 2014 Microchip Technology Inc. Note the following details of the code protection feature on Microchip devices: • Microchip products meet the specification contained in their particular Microchip Data Sheet. • Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. • There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. • Microchip is willing to work with the customer who is concerned about the integrity of their code. • Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.” Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act. Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer’s risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights. Trademarks The Microchip name and logo, the Microchip logo, dsPIC, FlashFlex, KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro, PICSTART, PIC32 logo, rfPIC, SST, SST Logo, SuperFlash and UNI/O are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor, MTP, SEEVAL and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries. Analog-for-the-Digital Age, Application Maestro, BodyCom, chipKIT, chipKIT logo, CodeGuard, dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN, ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial Programming, ICSP, Mindi, MiWi, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, mTouch, Omniscient Code Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit, PICtail, REAL ICE, rfLAB, Select Mode, SQI, Serial Quad I/O, Total Endurance, TSHARC, UniWinDriver, WiperLock, ZENA and Z-Scale are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. GestIC and ULPP are registered trademarks of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries. All other trademarks mentioned herein are property of their respective companies. © 2014, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. ISBN: 978-1-63276-253-5 QUALITY MANAGEMENT SYSTEM CERTIFIED BY DNV == ISO/TS 16949 == 2014 Microchip Technology Inc. Microchip received ISO/TS-16949:2009 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California and India. The Company’s quality system processes and procedures are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified. DS50002265A-page 5 Worldwide Sales and Service AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: http://www.microchip.com/ support Web Address: www.microchip.com Asia Pacific Office Suites 3707-14, 37th Floor Tower 6, The Gateway Harbour City, Kowloon Hong Kong Tel: 852-2943-5100 Fax: 852-2401-3431 India - Bangalore Tel: 91-80-3090-4444 Fax: 91-80-3090-4123 Austria - Wels Tel: 43-7242-2244-39 Fax: 43-7242-2244-393 Denmark - Copenhagen Tel: 45-4450-2828 Fax: 45-4485-2829 Atlanta Duluth, GA Tel: 678-957-9614 Fax: 678-957-1455 Austin, TX Tel: 512-257-3370 Boston Westborough, MA Tel: 774-760-0087 Fax: 774-760-0088 Chicago Itasca, IL Tel: 630-285-0071 Fax: 630-285-0075 Cleveland Independence, OH Tel: 216-447-0464 Fax: 216-447-0643 Dallas Addison, TX Tel: 972-818-7423 Fax: 972-818-2924 Detroit Novi, MI Tel: 248-848-4000 Houston, TX Tel: 281-894-5983 Indianapolis Noblesville, IN Tel: 317-773-8323 Fax: 317-773-5453 Los Angeles Mission Viejo, CA Tel: 949-462-9523 Fax: 949-462-9608 New York, NY Tel: 631-435-6000 San Jose, CA Tel: 408-735-9110 Canada - Toronto Tel: 905-673-0699 Fax: 905-673-6509 DS50002265A-page 6 Australia - Sydney Tel: 61-2-9868-6733 Fax: 61-2-9868-6755 China - Beijing Tel: 86-10-8569-7000 Fax: 86-10-8528-2104 China - Chengdu Tel: 86-28-8665-5511 Fax: 86-28-8665-7889 China - Chongqing Tel: 86-23-8980-9588 Fax: 86-23-8980-9500 China - Hangzhou Tel: 86-571-8792-8115 Fax: 86-571-8792-8116 China - Hong Kong SAR Tel: 852-2943-5100 Fax: 852-2401-3431 China - Nanjing Tel: 86-25-8473-2460 Fax: 86-25-8473-2470 China - Qingdao Tel: 86-532-8502-7355 Fax: 86-532-8502-7205 China - Shanghai Tel: 86-21-5407-5533 Fax: 86-21-5407-5066 China - Shenyang Tel: 86-24-2334-2829 Fax: 86-24-2334-2393 China - Shenzhen Tel: 86-755-8864-2200 Fax: 86-755-8203-1760 China - Wuhan Tel: 86-27-5980-5300 Fax: 86-27-5980-5118 China - Xian Tel: 86-29-8833-7252 Fax: 86-29-8833-7256 India - New Delhi Tel: 91-11-4160-8631 Fax: 91-11-4160-8632 India - Pune Tel: 91-20-3019-1500 Japan - Osaka Tel: 81-6-6152-7160 Fax: 81-6-6152-9310 Japan - Tokyo Tel: 81-3-6880- 3770 Fax: 81-3-6880-3771 Korea - Daegu Tel: 82-53-744-4301 Fax: 82-53-744-4302 Korea - Seoul Tel: 82-2-554-7200 Fax: 82-2-558-5932 or 82-2-558-5934 France - Paris Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79 Germany - Dusseldorf Tel: 49-2129-3766400 Germany - Munich Tel: 49-89-627-144-0 Fax: 49-89-627-144-44 Germany - Pforzheim Tel: 49-7231-424750 Italy - Milan Tel: 39-0331-742611 Fax: 39-0331-466781 Italy - Venice Tel: 39-049-7625286 Malaysia - Kuala Lumpur Tel: 60-3-6201-9857 Fax: 60-3-6201-9859 Netherlands - Drunen Tel: 31-416-690399 Fax: 31-416-690340 Malaysia - Penang Tel: 60-4-227-8870 Fax: 60-4-227-4068 Poland - Warsaw Tel: 48-22-3325737 Philippines - Manila Tel: 63-2-634-9065 Fax: 63-2-634-9069 Singapore Tel: 65-6334-8870 Fax: 65-6334-8850 Taiwan - Hsin Chu Tel: 886-3-5778-366 Fax: 886-3-5770-955 Spain - Madrid Tel: 34-91-708-08-90 Fax: 34-91-708-08-91 Sweden - Stockholm Tel: 46-8-5090-4654 UK - Wokingham Tel: 44-118-921-5800 Fax: 44-118-921-5820 Taiwan - Kaohsiung Tel: 886-7-213-7830 Taiwan - Taipei Tel: 886-2-2508-8600 Fax: 886-2-2508-0102 Thailand - Bangkok Tel: 66-2-694-1351 Fax: 66-2-694-1350 China - Xiamen Tel: 86-592-2388138 Fax: 86-592-2388130 China - Zhuhai Tel: 86-756-3210040 Fax: 86-756-3210049 03/25/14 2014 Microchip Technology Inc.