AN96841 Getting Started With EZ-BLE™ PRoC™ Module Authors: David Solda Associated Project: Refer to AN94020 Associated Part Family: CYBLE-022001-00 Software Version: PSoC Creator™ 3.1 SP2 and higher Related Application Notes: For a complete list of the application notes, click here. To get the latest version of this application note, or the associated project file, please visit http://www.cypress.com/go/AN96841.
Getting Started With EZ-BLE™ PRoC™ Module Introduction More Information Bluetooth Low Energy (BLE) is an ultra-low-power wireless standard defined by the Bluetooth Special Interest Group (SIG) for low-power, short-range communication. It features a physical layer, protocol stack, and profile architecture, all designed and optimized for the lowest power consumption. BLE operates in the 2.4-GHz ISM band, with a data rate of 1 Mbps. Cypress provides a wealth of data at www.cypress.
Getting Started With EZ-BLE™ PRoC™ Module EZ-BLE PRoC Module Overview The EZ-BLE PRoC Module (CYBLE-022001-00) is an integrated, fully certified BLE solution, which allows for rapid development and deployment of your BLE-enabled product. This section will provide an outline of the mechanical structure of the EZ-BLE PRoC Module. This information is necessary for customers designing their own PCB layout for this module.
Getting Started With EZ-BLE™ PRoC™ Module EZ-BLE PRoC Module Pinout and Functionality The EZ-BLE PRoC Module is designed to mount as a component on an end product PCB. Only a portion of the available I/O of the PRoC BLE silicon device are exposed on the CYBLE-022001-00 module in order to minimize the module footprint size. The EZ-BLE PRoC Module contains 21 connections on the bottom side of the module. Figure 2 and Figure 3 detail the bottom side connections available on the EZ-BLE PRoC Module. Figure 2.
Getting Started With EZ-BLE™ PRoC™ Module The connection pad spacing is listed in Table 1. Table 1. EZ-BLE PRoC Module Connection Pad Spacing (Center-to-Center) Pad Pitch Pad X Pad Y (Pad X - Pad Y) Bottom-Left Corner 1 1.64 mm Distance from bottom left corner to Pad 1 center 1 2 0.76 mm Distance from Pad 1 center to Pad 2 center 2 3 0.76 mm Distance from Pad 2 center to Pad 3 center 3 4 0.76 mm Distance from Pad 3 center to Pad 4 center 4 5 0.
Getting Started With EZ-BLE™ PRoC™ Module Module Solder Pad Number Functionality Silicon Port Pin UART 6 P1[6] RTS SPI I2C TCPWM SS Yes CapSense WCO Out EXT_CLK/ ECO_OUT EXTPA_EN SWD GPIO Sensor Yes 7 P0[7] CTS SCLK Yes Sensor 8 P0[4] RX MOSI SDA Yes Sensor 9 P0[5] TX MISO SCL Yes Sensor 10 GND Ground Connection 11 P0[6] RTS SS Yes Sensor 12 P1[7] CTS SCLK Yes Sensor 13 VDD Digital Power Supply Input 1.71 to 5.
Getting Started With EZ-BLE™ PRoC™ Module Figure 4: Power Modes Power Mode Current Consumption Code Execution Digital Peripherals Available Analog Peripherals Available Clock Sources Available Wake -Up Sources Wake -Up Time Active 2.2 mA @ 6 MHz Yes All All All - - Sleep 1.3 mA No All All Any interrupt source 0 Deep -Sleep 1.
Getting Started With EZ-BLE™ PRoC™ Module Bluetooth Low Energy Overview The Bluetooth SIG defines Bluetooth 4.1, also known as Bluetooth Smart or Bluetooth Low Energy as the lowest-power wireless standard operating in the 2.4-GHz ISM band. Figure 6 summarizes the BLE protocol stack architecture. The following sections briefly describe the BLE stack layers. For a detailed architecture description, see the Bluetooth 4.1 specification or the training videos on the Bluetooth Developer website.
Getting Started With EZ-BLE™ PRoC™ Module Security Manager (SM) The SM layer defines the methods used for key distribution to perform encryption and pairing. Pairing is the process to enable security features. In this process, two devices are authenticated, the link is encrypted, and then keys are exchanged. Bonding is the process in which the keys and identity information exchanged during the pairing process are saved within the paired devices.
Getting Started With EZ-BLE™ PRoC™ Module Figure 10 shows the services implemented in the peripheral. and characteristics Generic Attribute Profile (GATT) GATT defines the ways in which the attributes can be found and used. GATT operates in one of two roles: GATT client: The device that requests the data. The GAP layer operates in one of four roles: Broadcaster: This is a non-connectable advertising role that is used to broadcast its data, but cannot form BLE connections.
Getting Started With EZ-BLE™ PRoC™ Module Figure 10. Bluetooth Low Energy System Example In Figure 10, the heart rate monitoring device operates as the GAP peripheral and implements the heart rate sensor profile, while the smartphone receiving the data operates as the GAP central and implements the heart rate collector profile.
Getting Started With EZ-BLE™ PRoC™ Module Development Tools Cypress supports the EZ-BLE PRoC Module with high-quality software tools and development kits. They provide access to a suite of world-class Integrated Design Environments (IDEs). PSoC Creator is a single IDE to develop application code and then build, debug, and deploy an embedded design. Cypress provides the following software and hardware tools, to get started with a EZ-BLE PRoC Module based design: 1. 2. 3. 4. 5. 6. 7.
Getting Started With EZ-BLE™ PRoC™ Module Bluetooth Low Energy Component Software The Bluetooth Low Energy Component provides a comprehensive GUI-based configuration window that lets you quickly design applications that require BLE connectivity. The Component incorporates a Bluetooth Core Specification v4.1 compliant BLE protocol stack and provides API functions to enable user applications to interface with the underlying Bluetooth Low Energy Sub-System (BLESS) hardware via the stack.
Getting Started With EZ-BLE™ PRoC™ Module CySmart Mobile App In addition to the PC application, you can download the CySmart mobile app for iOS or Android from the respective app stores. The apps use the iOS Core Bluetooth framework and Android built-in platform framework for BLE to configure your BLE-enabled mobile as a BLE central device that can scan and connect to BLE peripheral devices. Figure 13.
Getting Started With EZ-BLE™ PRoC™ Module Figure 14. BLE Pioneer Kit The kit includes of a set of BLE example projects and documentation that should help you get started with developing your own BLE applications. Visit www.cypress.com/go/CY8CKIT-042-BLE to get latest updates on the kit and to download kit design, example projects and documentation files.
Getting Started With EZ-BLE™ PRoC™ Module The CYBLE-022001-EVAL board contains the following components: Cypress EZ-BLE PRoC Module (CYBLE-022001-00) – soldered directly to the Evaluation Board PCB substrate used for I/O fan out Connection headers Cmod capacitor (for use with Capacitive Sensing elements on the CY8CKIT-042-BLE kit) Inductors (power supply – see the datasheet specification for recommended external components) This evaluation board is designed to simulate the placement and connec
Getting Started With EZ-BLE™ PRoC™ Module C Y B L E - 0 2 2 0 0 1 - E V AL C o n n e c t i o n s t o C Y 8 C K I T - 0 4 2 - B L E The CYBLE-022001-00 module contains 21 connections on the back side of the module. Each of these connections is present on the CYBLE-022001-EVAL evaluation board too. Figure 18 shows the CYBLE-022001-EVAL and highlights the elements on the top side of the board. Figure 18.
Getting Started With EZ-BLE™ PRoC™ Module Figure 20 reiterates the Port-Pin connections on the CYBLE-022001-EVAL board. A “NC” connection denotes No Connect, where no physical connection is present between the EZ-BLE PRoC Module and the CYBLE-022001-EVAL board. Figure 20.
Getting Started With EZ-BLE™ PRoC™ Module CY8CKIT-042-BLE Baseboard Connection Header CY8CKIT-042-BLE Baseboard 2 Connection Port-Pin CYBLE-022001-EVAL Connection Port-Pin J11 P1_4 P1_4 J11 P0_6 P0_6 J11 P1_3 P1_3 J11 P0_7 P0_7 J11 P1_5 P1_5 J11 XRES XRES J11 P1_7 NC J11 GND GND J11 P1_6 NC J11 VDD VDD J12 GND GND J10 VDD VDD J10 P3_6 P3_6 J10 P3_7 P3_7 J10 P3_4 NC J10 P3_5 NC J10 P3_2 NC J10 P3_3 NC J10 P3_0 NC J10 P3_1 NC J10 P4_0 NC J10
Getting Started With EZ-BLE™ PRoC™ Module The connections shown in Table 3 apply to the Arduino compatible headers located on the CY8CKIT-042-BLE baseboard. Figure 21 shows the Arduino compatible headers located on the CY8CKIT-042-BLE baseboard. Figure 21. Arduino Compatible Headers on CY8CKIT-042-BLE Baseboard Connections above are labeled according to the CY8CKIT-042-BLE baseboard pinout. For the equivalent and available connections used with the CYBLE-022001-EVAL board, refer to Table 3.
Getting Started With EZ-BLE™ PRoC™ Module Learning Resources This section provides a list of EZ-BLE PRoC Module learning resources that can help you to get started and to develop complete applications with EZ-BLE PRoC Module. You can also use the Document Manager in PSoC Creator to view these resources. To open the Document Manager, choose the Help > Document Manager.
Getting Started With EZ-BLE™ PRoC™ Module My First EZ-BLE PRoC Module Design This section provides you with the step-by-step process for building a simple design with EZ-BLE PRoC Module using PSoC Creator. We will use a previous example project completed for the PRoC BLE device and reconfigure it to work with the EZBLE PRoC Module. About the Design This design demonstrates the “Find Me” profile operation using the BLE Component in PSoC Creator.
Getting Started With EZ-BLE™ PRoC™ Module Figure 22. My First EZ-BLE PRoC Module Design Creating your first EZ-BLE PRoC Module design involves four main steps: 1. Create the design in the PSoC Creator schematic page. 2. Write the application code to initialize and handle Bluetooth Low Energy events and take action. 3. Program the EZ-BLE PRoC Module on the BLE Pioneer Kit. 4. Test your design using the CySmart PC application or mobile app.
Getting Started With EZ-BLE™ PRoC™ Module 3. Choose the project template PRoC BLE Design, and give the project a name such as “My_First_Project,” as shown in Figure 24. Choose an appropriate location for your new project. Figure 24. Naming the New Project and Device Selector Guide Location 4. Once in the Device Selector Guide, scroll down and locate the CYBLE-022001-00 part number (Device Selector Guide location is shown in Figure 24). Figure 25. Device Selector Guide www.cypress.com Document No.
Getting Started With EZ-BLE™ PRoC™ Module 5. The EZ-BLE PRoC Module CYBLE-022001-00 is then shown in the “Device” location after selection from the Device Selector Guide. Click OK to start the project. Figure 26. Launching the Device Selector 6. Creating a new project generates a project folder with a baseline set of files. You can view these files in the Workspace Explorer window, as shown in Figure 27. Open the project schematic file TopDesign.cysch by double-clicking it. Figure 27.
Getting Started With EZ-BLE™ PRoC™ Module 7. You can see pre-populated Components in the schematic as Figure 28 shows. Figure 28. Pre-populated Components 8. Disable/enable the Components per your design.
Getting Started With EZ-BLE™ PRoC™ Module Figure 29.Enable/Disable Components 9. After performing the actions in step 7, you will see the schematic as shown in Figure 22. 10. Add one more LED by selecting the following schematic and right-clicking Copy and Paste as shown in Figure 30. Figure 30 Adding One More LED 11. You can configure the Bluetooth Low Energy Component with the following properties by double-clicking on the Component as shown in Figure 31.
Getting Started With EZ-BLE™ PRoC™ Module GAP Device Name set to ‘Find Me Target’ and Appearance set to ‘Generic Keyring’ as shown in Figure 36 GAP security set to least security configuration with no authentication or encryption as shown in Figure 37 Figure 31. Bluetooth Low Energy Component General Configuration Figure 32. Bluetooth Low Energy Component Profiles Configuration www.cypress.com Document No.: 001-96841 Rev.
Getting Started With EZ-BLE™ PRoC™ Module Figure 33. Bluetooth Low Energy Component GAP Advertisement Settings Figure 34. Bluetooth Low Energy Component GAP Advertisement Packet www.cypress.com Document No.: 001-96841 Rev.
Getting Started With EZ-BLE™ PRoC™ Module Figure 35. Bluetooth Low Energy Component GAP Scan Response Packet Figure 36. Bluetooth Low Energy Component GAP General Settings Figure 37. Bluetooth Low Energy Component GAP Security Settings www.cypress.com Document No.: 001-96841 Rev.
Getting Started With EZ-BLE™ PRoC™ Module 12. Double-click on LED1 and change the name to ‘Advertising_LED’ for LED1 as shown in Figure 38. Similarly rename the other two LEDs as ‘Disconnect_LED’ and ‘Alert_LED’. Configure the LED as Strong drive mode. Figure 38. Renaming a Pin Component 13. Double-click on SW1 and change the name to Wakeup_SW. Configure the pin as interrupt as shown in Figure 39 and Figure 40. Figure 39. Digital Input Pin Configuration www.cypress.com Document No.: 001-96841 Rev.
Getting Started With EZ-BLE™ PRoC™ Module Figure 40. Digital Input Pin Interrupt Configuration 14. Drag and drop an ‘Interrupt’ Component from the Component Catalog. Change the name to ‘Wakeup_Interrupt’ and wire it to the Wakeup_SW pin’s “irq” output as Figure 41 , Figure 42, and Figure 43 show. Figure 41. Location of the Interrupt Component www.cypress.com Document No.: 001-96841 Rev.
Getting Started With EZ-BLE™ PRoC™ Module Figure 42. Renaming the Interrupt Component Figure 43 Wiring the Interrupt and Pin Component www.cypress.com Document No.: 001-96841 Rev.
Getting Started With EZ-BLE™ PRoC™ Module 15. To assign pins to the LEDs and button, open the file My_First_Project.cydwr (Design-Wide Resource file) from “Workspace Explorer” and click the Pins tab. You can use this tab to select the device pins for the outputs (Advertising_LED, Disconnect_LED, and Alert_LED) and Wakeup_SW for input as Figure 44 shows. The following pin assignment is made with respect to the CY8CKIT-042 BLE pioneer kit and the CYBLE-022001-EVAL board connections.
Getting Started With EZ-BLE™ PRoC™ Module Write the Application Code The main.c file in the workspace has a template for the main program function.
Getting Started With EZ-BLE™ PRoC™ Module Figure 47.
Getting Started With EZ-BLE™ PRoC™ Module B LE Stack Event Handler Figure 48. Bluetooth Low Energy Stack Event Handler Flow Chart Stack ON or device disconnected? Y Start Advertising N Device connected? Y Retrieve Connection Handle Y Go to Hibernate N Advertising timeout? N Return from stack event handler www.cypress.com Document No.: 001-96841 Rev.
Getting Started With EZ-BLE™ PRoC™ Module Figure 49.
Getting Started With EZ-BLE™ PRoC™ Module B l u e t o o t h L o w E n e r g y S e r vi c e S p e c i f i c E ve n t H a n d l e r The BLE Component also generates events corresponding to each of the services supported by your design through the service event handler that was registered in the initialization section of the code (IasEventHandler in this example).
Getting Started With EZ-BLE™ PRoC™ Module Figure 51.
Getting Started With EZ-BLE™ PRoC™ Module Figure 52. Main Loop Flowchart Process BLE Events N System Normal Operation Device Connected ? Y Alert Level Updated N Y System Low Power Operation N Process the LED status BLE Idle? Y Go to deep sleep mode - Configure wakeup pin - Go to Hibernate - Execute deep sleep wakeup sequence - Sleep till ECO stabilizes Figure 53. Firmware Main Loop for(;;) { /* Single API call to service all the BLE stack events.
Getting Started With EZ-BLE™ PRoC™ Module case MILD_ALERT: if(--blinkTimeout == 0) { Alert_LED_Write(Alert_LED_Read() ^ 0x01); blinkTimeout = BLINK_TIMEOUT; } break; case HIGH_ALERT: Alert_LED_Write(LED_ON); break; default: break; } bleState = CyBle_GetState(); if(bleState != CYBLE_STATE_STOPPED && bleState != CYBLE_STATE_INITIALIZING) { /* Configure BLESS in DeepSleep mode */ CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP); /* Configure PRoC BLE system in sleep mode */ CySysPmSleep(); /* BLE link layer timing inter
Getting Started With EZ-BLE™ PRoC™ Module Program the Device This section shows how to program the device. If you are using a development kit with a built-in programmer, connect the kit board to your computer using the USB cable. For other kits, refer to the kit user guide. 3. Choose the Debug > Program to program the device with the project, as Figure 57 shows. Figure 57.
Getting Started With EZ-BLE™ PRoC™ Module My First EZ-BLE PRoC Module Design – Shortcut Download the example project from AN94020 – Getting Started with PRoC BLE and follow these steps to quickly generate the example project described in the previous pages. 1. Download the AN94020.zip package from the AN94020 web page. 2. Extract the contents to a destination directory on your PC. 3. Locate My_First_Project.cywrk (PSoC Creator Workspace) and open it with PSoC Creator 3.1 SP2 or newer. 4.
Getting Started With EZ-BLE™ PRoC™ Module 7. When the pin assignment table is displayed, you will notice that two of the connections have been unassigned. This is due to the limited I/O supported on the EZ-BLE PRoC Module. Both ‘Disconnect_LED’ and ‘Wakeup_SW’ will be shown as unassigned. 8. To complete the assignments, assign P3[4] to ‘Disconnect_LED’ and P3[5] to ‘Wakeup_SW’. These connections can be determined through checking the CY8CKIT-042-BLE and CYBLE-022001-EVAL schematics. 9.
Getting Started With EZ-BLE™ PRoC™ Module Test Your Design This section describes how to test your BLE design using the CySmart PC application and BLE Pioneer Kit or BLE Pioneer Kit and mobile apps. The setup for testing your design using the BLE Pioneer Kit is shown in Figure 61. Figure 61.
Getting Started With EZ-BLE™ PRoC™ Module Figure 62. Launching CySmart Application. Figure 63. CySmart BLE Dongle Selection 3. Select the Configure Master Settings menu item and restore the values to their default settings, as shown in Figure 64. www.cypress.com Document No.: 001-96841 Rev.
Getting Started With EZ-BLE™ PRoC™ Module Figure 64. CySmart Master Settings Configuration 4. Press the reset or SW1 button on the BLE Pioneer Kit to start the BLE advertisements from your design. 5. In the CySmart application, click the Start Scan button. Your device (BLE Peripheral) name should appear in the ‘Discovered devices’ list. 6. Click Stop Scan and then click Connect to establish a BLE connection between the CySmart tool and your device, as shown in Figure 65 . Figure 65.
Getting Started With EZ-BLE™ PRoC™ Module 7. Once connected, discover all the attributes on your design from the CySmart application, as shown in Figure 66 Figure 66. Discover Attributes 8. Select the ‘Alert Level’ characteristic and write a value of 0, 1, or 2 to Alert Level characteristic under the IAS as Figure 67 shows. Observe that the state of the LED on your device change based on your Alert Level characteristic configuration. Figure 67. Alert Notification www.cypress.com Document No.
Getting Started With EZ-BLE™ PRoC™ Module Using Mobile Apps Similar to the CySmart PC application, you can use the CySmart iOS or Android app to establish a BLEconnection with your design and perform read or write operations on different BLEservice characteristics as follows. 1. Turn ON the Bluetooth on your iOS or Android device 2. Launch the CySmart application 3. Press the reset or SW1 button on the BLE Pioneer Kit to start the BLE advertisements from your design 4.
Getting Started With EZ-BLE™ PRoC™ Module Summary About the Author This application note explored the basics of BLE protocol and the EZ-BLE PRoC Module solution, architecture, and development tools. The EZ-BLE PRoC Module is a fully integrated BLE solution that allows rapid development and production release for customer applications.
Getting Started With EZ-BLE™ PRoC™ Module Appendix A: EZ-BLE PRoC Module Features Table 6 summarizes the features and capabilities of the EZ-BLE PRoC Module from Cypress. Table 6. EZ-BLE PRoC Module Features and Capabilities Device Family Features CYBLE-022001-00 BLE Subsystem BLE radio and link-layer hardware blocks with BLE 4.
Getting Started With EZ-BLE™ PRoC™ Module Appendix B: Cypress Terms of Art This section lists the most commonly used terms that you might hear while working with Cypress’s PSoC family of devices. ® ® PSoC – PSoC is a programmable, embedded design platform that includes a CPU, such as the 32-bit ARM Cortex -M0, with both analog and digital programmable blocks. It accelerates embedded system design with reliable, easy-to-use solutions, such as touch sensing and enables low-power designs.
Getting Started With EZ-BLE™ PRoC™ Module Figure 69. Code Examples in PSoC Creator Appendix C: Code Examples PSoC Creator includes a large number of code example projects. These projects are available from the PSoC Creator Start Page, as Figure 69 shows. Example projects can speed up your design process by starting you off with a complete design, instead of a blank page. The example projects also show how PSoC Creator Components can be used for various applications.
Getting Started With EZ-BLE™ PRoC™ Module Appendix D: Regulatory information: FCC: FCC NOTICE: The device CYBLE-022001-00, including the antenna 2450AT18B100 from Johanson technology, complies with Part 15 of the FCC Rules. The device meets the requirements for modular transmitter approval as detailed in FCC public Notice DA00-1407.
Getting Started With EZ-BLE™ PRoC™ Module ANTENNA WARNING This device is tested with a standard SMA connector and with the antennas listed below. When integrated in the OEMs product, these fixed antennas require installation preventing end-users from replacing them with non-approved antennas. Any antenna not in the following table must be tested to comply with FCC Section 15.203 for unique antenna connectors and Section 15.247 for emissions.
Getting Started With EZ-BLE™ PRoC™ Module antenna used for this transmitter must not be co-located or operating in conjunction with any other antenna or transmitter. IC NOTICE The device CYBLE-022001-00 including the antenna 2450AT18B100 from Johanson technology, complies with Canada RSS-GEN Rules. The device meets the requirements for modular transmitter approval as detailed in RSS-GEN.
Getting Started With EZ-BLE™ PRoC™ Module Document History Document Title: AN96841 – Getting Started With EZ-BLE™ PRoC™ Module Document Number: 001-96841 Revision ** www.cypress.com ECN Orig. of Change Submission Date 4715534 DSO 04/08/2015 Description of Change New application note Document No.: 001-96841 Rev.
Getting Started With EZ-BLE™ PRoC™ Module Worldwide Sales and Design Support Cypress maintains a worldwide network of offices, solution centers, manufacturer’s representatives, and distributors. To find the office closest to you, visit us at Cypress Locations. PSoC® Solutions Products Automotive cypress.com/go/automotive psoc.cypress.com/solutions Clocks & Buffers cypress.com/go/clocks PSoC 1 | PSoC 3 | PSoC 4 | PSoC 5LP Interface cypress.com/go/interface Lighting & Power Control cypress.